Interfaces¶
- class Interfaces(configurations=None)¶
Class to set up configurations with multiple interfaces by: 1. Adding layer configurations 2. Calculating lattice matches 3. Creating an ‘Interfaces’ configuration.
Layers can be cleaved, resized (in C in terms of atomic planes) and displaced prior to creating the interfaces configuration.
- Parameters:
configurations (list of
BulkConfiguration
) – The list of configurations to start with. The order of the list will also be the order of the layers.
- addLayer(configuration)¶
Add a new configuration as a layer.
- Parameters:
configuration (
BulkConfiguration
) – The configuration to add.
- atomicPlanes(layer_index)¶
The number of atomic planes for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The number of atomic planes.
- Return type:
int
- static availableHKMGConfigurations()¶
- Returns:
The list of available HKMG configuration keys.
- Return type:
list
- static availableMRAMConfigurations()¶
- Returns:
The list of available MRAM configuration keys.
- Return type:
list
- bestMatch()¶
- Returns:
The best match.
- Return type:
InterfacesMatch
- block(layer_index)¶
The block configuration for the given index. The block has a standardized unit cell and, if there is a match selected, will have the surface vectors of the selected match.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The block configuration.
- Return type:
- calculateMatches(fixed_strain_layer_index=0)¶
Calculate new matches.
- Parameters:
fixed_strain_layer_index (int | StrainAll) – The index of the layer for which strain should be fixed.
- Returns:
The newly calculated matches.
- Return type:
list of InterfacesMatch
- clearAllLayers()¶
Remove all layers.
- cleavePlane(layer_index)¶
The cleave plane for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The cleave plane.
- Return type:
3-tuple of int
- static createAnnealingParameters(annealing_temperature=PhysicalQuantity(600.0, K), annealing_steps=20000, cooling_steps=10000, random_seed=None)¶
Setup annealing parameter used for optimizing interfaces.
- Parameters:
annealing_temperature (
PhysicalQuantity
of type temperature) – The target temperature.annealing_steps (int) – The number of annealing steps.
cooling_steps (int) – The number of cooling steps.
random_seed (int | None) – The random seed.
- Returns:
The annealing parameters.
- Return type:
list
- displacement(layer_index)¶
The displacement vector for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The displacement vector.
- Return type:
PhysicalQuantity
- static hKMGConfiguration(name)¶
Get one of the available HKMG configurations.
- Parameters:
name (str) – The name of the configuration. Should be one of the names in Interfaces.availableHKMGConfigurations()
- Returns:
The configuration.
- Return type:
- inputConfiguration(layer_index)¶
Get the input configuration for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The input configuration.
- Return type:
- layerLength(layer_index)¶
The layer length for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The layer length.
- Return type:
PhysicalQuantity of type length
- static mRAMConfiguration(name)¶
Get one of the available MRAM configurations.
- Parameters:
name (str) – The name of the configuration. Should be one of the names in Interfaces.availableMRAMConfigurations()
- Returns:
The configuration.
- Return type:
- makeConfiguration(match_index=<class 'NL.ComputerScienceUtilities.NLFlag._NLFlag.Automatic'>, optimize=False)¶
Make the configuration for the given match.
- Parameters:
match_index (InterfacesMatch | Automatic) – The index of the match to use. If Automatic is given, the best match will be used.
optimize (bool) – If True, the final configuration will be geometry-optimized.
- Returns:
The Interfaces configuration.
- Return type:
- matchIndex()¶
- Returns:
The index of the selected match.
- Return type:
int
- matchParameters()¶
- Returns:
The currently set match parameters.
- Return type:
dict
- matches()¶
- Returns:
The current matches.
- Return type:
list of InterfacesMatch
- maxStrain()¶
- Parameters:
max_strain (float) – The maximum mean absolute strain, as a fraction in the.
- maxSurfaceArea()¶
:param max_surface_area:The maximum surface area. :type max_surface_area:PhysicalQuantity of type area
- maxSurfaceVectorLength()¶
- Parameters:
max_surface_vector_length (PhysicalQuantity of type length) – The maximum surface vector length.
- minSurfaceVectorAngle()¶
- Parameters:
min_surface_vector_angle (PhysicalQuantity of type angle) – The minimum surface vector angle.
- minSurfaceVectorLength()¶
- Parameters:
min_surface_vector_length (PhysicalQuantity of type length) – The minimum surface vector length.
- modifyLayer(layer_index, cleave_plane=None, plane_indices=None, tolerance=None, strip_vacuum=None, displacement=None)¶
Convenience method to set up a layer.
- Parameters:
layer_index (int) – The index of the layer to change.
cleave_plane (3-tuple of int) – The cleave plane to set.
plane_indices (2-tuple of int) – The plane indices to set.
tolerance (int) – The logarithmic tolerance to use for detecting atomic planes. Must be in the range [-10, 4].
strip_vacuum (bool) – If True, strip the top and bottom vacuum. Put 1 Å back at the top.
displacement (PhysicalQuantity of type length) – The displacement vector to set, containing the displacements in A, B and C directions.
- numberOfLayers()¶
- Returns:
The number of layers currently in the store.
- Return type:
int
- numberOfMatches()¶
- Returns:
The current number of matches.
- Return type:
int
- planeIndices(layer_index)¶
The plane indices for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The plane indices.
- Return type:
2-tuple of int
- removeLayer(layer_index)¶
Remove the layer with the given index.
- Parameters:
layer_index (int) – The index of the layer to change.
- setCleavePlane(layer_index, cleave_plane)¶
Set a new cleave plane to the layer with the given index.
- Parameters:
layer_index (int) – The index of the layer to change.
cleave_plane (3-tuple of int) – The cleave plane to set.
- setDisplacement(layer_index, displacement)¶
Set a new displacement for the layer with the given index.
- Parameters:
layer_index (int) – The index of the layer to change.
displacement (PhysicalQuantity of type length) – The displacement vector to set, containing the displacements in A, B and C directions.
- setMatchParameters(max_strain=None, max_surface_area=None, min_surface_vector_length=None, max_surface_vector_length=None, min_surface_vector_angle=None)¶
Convenience method to set all match parameters at once.
- Parameters:
max_strain (float) – The maximum mean absolute strain to include in the lattice match, as a fraction in the range [0.0, 1.0].
:param max_surface_area:The maximum surface area to include in the lattice match. :type max_surface_area:PhysicalQuantity of type area
- Parameters:
min_surface_vector_length (PhysicalQuantity of type length) – The minimum surface vector length to include in the lattice match.
max_surface_vector_length (PhysicalQuantity of type length) – The maximum surface vector length to include in the lattice match.
min_surface_vector_angle (PhysicalQuantity of type angle) – The minimum surface vector angle to include in the lattice match.
- setMaxStrain(max_strain)¶
Set a new The maximum mean absolute strain to include in the lattice match, as a fraction in the range [0.0, 1.0].
- Parameters:
max_strain (float) – The maximum mean absolute strain to include in the lattice match, as a fraction in the.
- setMaxSurfaceArea(max_surface_area)¶
Set a new mum surface area to include in the lattice match.
:param max_surface_area:The maximum surface area. :type max_surface_area:PhysicalQuantity of type area
- setMaxSurfaceVectorLength(max_surface_vector_length)¶
Set a new maximum surface vector length to include in the lattice match.
- Parameters:
max_surface_vector_length (PhysicalQuantity of type length) – The maximum surface vector length.
- setMinSurfaceVectorAngle(min_surface_vector_angle)¶
Set a new minimum surface vector angle to include in the lattice match.
- Parameters:
min_surface_vector_angle (PhysicalQuantity of type angle) – The minimum surface vector angle.
- setMinSurfaceVectorLength(min_surface_vector_length)¶
Set a new minimum surface vector length to include in the lattice match.
- Parameters:
min_surface_vector_length (PhysicalQuantity of type length) – The minimum surface vector length.
- setPlaneIndices(layer_index, plane_indices, tolerance=-10)¶
Set new plane indices for the layer with the given index.
- Parameters:
layer_index (int) – The index of the layer to change.
plane_indices (2-tuple of int) – The plane indices to set.
tolerance (int) – The logarithmic tolerance to use for detecting atomic planes. Must be in the range [-10, 4].
- setStripVacuum(layer_index, strip_vacuum)¶
Set the strip vacuum flag to a layer.
- Parameters:
layer_index (int) – The index of the layer to change.
strip_vacuum (bool) – If True, strip the top and bottom vacuum. Put 1 Å back at the top.
- strainData(strain_type, as_percentages=False)¶
Get formatted match data in terms of the maximum or average mean absolute strains vs. the number of atoms.
- Parameters:
strain_type (Interfaces.MAX_MEAN_ABSOLUTE_STRAIN | Interface.AVG_MEAN_ABSOLUTE_STRAIN) – The type of data to get.
as_percentages (bool) – If True, the maximum or average mean absolute strains are given in percent ([0.0, 100.0]) instead of a fraction ([0.0, 1.0]).
- Returns:
The formatted match data.
- Return type:
2-tuple of list
- stripVacuum(layer_index)¶
The strip vacuum flag.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The strip vacuum flag.
- Return type:
bool
- title(layer_index)¶
The title of the given layer.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The layer title.
- Return type:
str
- tolerance(layer_index)¶
The tolerance for detecting atomic planes for the given index.
- Parameters:
layer_index (int) – The index of the layer.
- Returns:
The tolerance for detecting atomic planes.
- Return type:
int
Usage Examples¶
Create a configuration with three interfaces using layers of Si (001), SiO2 (quartz, 001) and Au (111).
from QuantumATK import *
from ExampleConfigurations import configurations
# Create Interfaces instance.
interfaces = Interfaces(configurations=configurations)
# Set up Layer 0.
interfaces.modifyLayer(
layer_index=0,
cleave_plane=(0, 0, 1),
plane_indices=(0, 3),
tolerance=-10,
displacement=(0.0, 0.0, 0.0) * Angstrom,
)
# Set up Layer 1.
interfaces.modifyLayer(
layer_index=1,
cleave_plane=(0, 0, 1),
plane_indices=(0, 8),
tolerance=-10,
displacement=(0.0, 0.0, 0.4) * Angstrom,
)
# Set up Layer 2.
interfaces.modifyLayer(
layer_index=2,
cleave_plane=(1, 1, 1),
plane_indices=(0, 2),
tolerance=-10,
displacement=(0.0, 0.0, 0.0) * Angstrom,
)
# Set up the match parameters.
interfaces.setMatchParameters(
max_strain=0.08,
max_surface_area=300.0 * Angstrom**2,
min_surface_vector_length=1.0 * Angstrom,
max_surface_vector_length=20.0 * Angstrom,
min_surface_vector_angle=30.0 * Degrees,
)
# Generate matches.
interfaces.calculateMatches(
fixed_strain_layer_index=0
)
# Create the interfaces configuration.
configuration = interfaces.makeConfiguration(
match_index=12,
strip_vacuum=False,
optimize=False
)
si_sio2_au_example.py
ExampleConfigurations.py
The Interfaces class is first instantiated with the input configurations. Next, each layer is modified and the match parameters set. Specifically, the SiO2 layer is displaced by 0.4 Å in the C direction and the Au layer is cleaved to expose the (1, 1, 1) surface. This is followed by a call to calculateMatches, with the Si layer (layer index 0) having its strain fixed to 0. This method loops over all possible interface matches within the limits set by the match parameters. Finally, makeConfiguration is called with a given match_index to produce the final interfaces stack configuration (see figure).

Fig. 166 The resulting interfaces configuration.¶
This configuration also contains strain information in its metatext, which can be viewed in the preview pane of the Data View or in script by using
configuration.metatext()
General¶
The Interfaces class of QuantumATK allows the construction of multilayered configurations by automatically matching the 2D unit cells of an arbitrary number of layers and comparing the strain. The input configurations should be crystalline, but are not required to be. All input configurations will be cleaved to (001) unless another cleave plane is given, and made into slabs before being added to the multilayered configuration.
Notes¶
The layers are automatically adjusted to standardized unit cells when creating interfaces. In QuantumATK this means that the lattice vectors are prepared according to the following convention: the a-vector is along the x-axis, the b vector is in the a-b plane, the c vector is along the z-axis.
The parameter
plane_indices
can be used to expose different cut-planes at the interface of a given layer and to set the thickness of the layer.Using
match_index=Automatic
in the input parameters returns a match that balances the total number of atoms in the system with the mean absolute strain. It can be used to find a good match without having to filter through all possible matches.Using
quick_optimize
requires a valid QATK-ForceField license. This option only performs a generic pre-optimization to avoid too close atoms.When setting the
strip_vacuum
,displacements
andquick_optimize
options, the operations will be performed in that order. The layers are first stripped of vacuum along the C-direction before the interfaces configuration is produced. Atoms are then shifted based on any given (per-layer) displacements using layer index tags. Finally, quick-optimization is performed on the displaced configuration, which means the displacements may change. Essentially, if you use both displacements and quick-optimization, the displacements can be seen as setting the initial conditions for the optimization.