aim2dat.strct¶
Modules to analyze the chemical environment and the coordination of atoms.
Subpackages¶
Package Contents¶
Classes¶
Represents a structure and contains methods to calculate properties of a structure |
|
The StructureCollection class is a container for one or multiple atomic structures. It |
|
Serves as a wrapper to make the methods defined on a single |
|
Generates a surfaces and surface slabs based on a bulk crystal structure. |
-
class aim2dat.strct.Structure(elements: list[str], positions: list[list[float]], pbc: list[bool], is_cartesian: bool =
True, wrap: bool =False, cell: list[list[float]] =None, kinds: list[str] =None, label: str =None, store_calculated_properties: bool =True, attributes: dict =None, extras: dict =None, function_args: dict =None)[source]¶ Bases:
aim2dat.strct.mixin.AnalysisMixin,aim2dat.strct.mixin.ManipulationMixinRepresents a structure and contains methods to calculate properties of a structure (molecule or crystal) or to manipulate a structure.
Overview
Properties¶ class Return calculation methods.
Return the specified attributes.
Return the cell of the structure.
Cell angles.
cell lengths.
cell volume.
Return chemical formula.
Return the elements of the structure.
class Return export methods.
Return the specified extras.
Return function arguments for stored extras.
class Return import methods.
Return the kinds of the structure.
Return label of the structure (especially relevant in StructureCollection).
class Return manipulation methods.
Return the pbc of the structure.
Return the cartesian positions of the structure.
Return the scaled positions of the structure.
Store calculated properties to reuse them later.
Methods¶ calculate_angle(key, site_index1, site_index2, site_index3, backfold_positions)Calculate angle between three atoms.
calculate_coordination(key, r_max, method, min_dist_delta, n_nearest_neighbours, econ_tolerance, econ_conv_threshold, voronoi_weight_type, voronoi_weight_threshold, okeeffe_weight_threshold)Calculate coordination environment of each atomic site.
calculate_dihedral_angle(key, site_index1, site_index2, site_index3, site_index4, backfold_positions)Calculate dihedral angle between four atoms.
calculate_distance(key, site_index1, site_index2, backfold_positions, use_supercell, r_max)Calculate distance between two atoms.
calculate_ffingerprint(key, r_max, delta_bin, sigma, use_legacy_smearing, distinguish_kinds)Calculate f-fingerprint function for each element-pair and atomic site.
calculate_voronoi_tessellation(key, r_max)Calculate voronoi polyhedron for each atomic site.
copy()Return copy of Structure object.
delete_atoms(key, elements, site_indices, change_label)Delete atoms by element, list of elements, site index or list of site indices.
determine_point_group(key, threshold_distance, threshold_angle, threshold_inertia)Determine the point group of a molecule.
determine_space_group(key, symprec, angle_tolerance, hall_number, return_sym_operations, return_primitive_structure, return_standardized_structure, no_idealize)Determine the space group of the structure using spglib as backend.
from_aiida_structuredata(structure_node, use_uuid, label)class Append structure from AiiDA structure node.
from_ase_atoms(ase_atoms, attributes, label)class Get structure from ase atoms object.
from_file(file_path, attributes, label)class Get structure from file using the ase read-function.
from_pymatgen_structure(pymatgen_structure, attributes, label)class Get structure from pymatgen structure or molecule object.
get(key, value)Get attribute by key and return default if not present.
get_positions(cartesian, wrap)Return positions of atoms.
iter_sites(get_kind, get_cart_pos, get_scaled_pos, wrap)Iterate through the sites of the structure.
keys()Return property names to create the structure.
scale_unit_cell(key, scaling_factor, change_label)Scale unit cell of the structure.
set_attribute(key, value)Set attribute.
set_positions(positions, is_cartesian, wrap)Set postions of atoms.
substitute_elements(key, elements, radius_type, change_label)Substitute all atoms of one or several elements.
to_aiida_structuredata(label)Create AiiDA structuredata.
Create ase Atoms object.
to_file(file_path)Export structure to file using the ase interface.
Create pymatgen Structure (if cell is not None) or Molecule (if cell is None) object.
- property attributes : dict¶
Return the specified attributes.
- property cell : tuple | None¶
Return the cell of the structure.
- property chem_formula : dict¶
Return chemical formula.
- property elements : tuple¶
Return the elements of the structure.
- property extras : dict¶
Return the specified extras.
- property function_args : dict¶
Return function arguments for stored extras.
- property kinds : tuple | None¶
Return the kinds of the structure.
- property label : str | None¶
Return label of the structure (especially relevant in StructureCollection).
- property pbc : tuple¶
Return the pbc of the structure.
- property scaled_positions : tuple | None¶
Return the scaled positions of the structure.
- Type:¶
tuple or None
- property store_calculated_properties : bool¶
Store calculated properties to reuse them later.
-
calculate_angle(key: str | int | tuple | list =
None, site_index1: int =0, site_index2: int =1, site_index3: int =2, backfold_positions: bool =True) float¶ Calculate angle between three atoms.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
site_index3 (int) – Index of the site.
backfold_positions (bool) – Whether to backfold the atomic sites and return the smallest distance.
- Returns:¶
float – Angle calculated via the vectors from atom 2 to atom 1 and atom 3.
-
calculate_coordination(key: str | int | tuple | list =
None, r_max: float =10.0, method: str ='minimum_distance', min_dist_delta: float =0.1, n_nearest_neighbours: int =5, econ_tolerance: float =0.5, econ_conv_threshold: float =0.001, voronoi_weight_type: float ='rel_solid_angle', voronoi_weight_threshold: float =0.5, okeeffe_weight_threshold: float =0.5) dict¶ Calculate coordination environment of each atomic site.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
method (str (optional)) – Method used to calculate the coordination environment. The default value is
'minimum_distance'.min_dist_delta (float (optional)) – Tolerance parameter that defines the relative distance from the nearest neighbour atom for the
'minimum_distance'method.n_nearest_neighbours (int (optional)) – Number of neighbours that are considered coordinated for the
'n_neighbours'method.econ_tolerance (float (optional)) – Tolerance parameter for the econ method.
econ_conv_threshold (float (optional)) – Convergence threshold for the econ method.
voronoi_weight_type (str (optional)) – Weight type of the Voronoi facets. Supported options are
'covalent_atomic_radius','area'and'solid_angle'. The prefix'rel_'specifies that the relative weights with respect to the maximum value of the polyhedron are calculated.voronoi_weight_threshold (float (optional)) – Weight threshold to consider a neighbouring atom coordinated.
okeeffe_weight_threshold (float (optional)) – Threshold parameter to distinguish indirect and direct neighbour atoms for the
'okeeffe'.This parameter is depreciated and will be removed in a future version. The original results can be obtained by using the
voronoi_weight_thresholdparameter and settingvoronoi_weight_typeto'rel_solid_angle'.
- Returns:¶
dict – Dictionary containing the coordination information of the structure.
-
calculate_dihedral_angle(key: str | int | tuple | list =
None, site_index1: int =0, site_index2: int =1, site_index3: int =2, site_index4: int =3, backfold_positions: bool =True) float¶ Calculate dihedral angle between four atoms.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
site_index3 (int) – Index of the site.
site_index4 (int) – Index of the site.
backfold_positions (bool) – Whether to backfold the atomic sites and return the smallest distance.
- Returns:¶
float – Dihedral angle.
-
calculate_distance(key: str | int | tuple | list =
None, site_index1: int | list[int] =0, site_index2: int | list[int] =1, backfold_positions: bool =True, use_supercell: bool =False, r_max: float =7.5) float | list¶ Calculate distance between two atoms.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
backfold_positions (bool) – Whether to backfold the atomic sites and return the smallest distance.
use_supercell (bool) – User supercell to calculate all distances between the two atomic sites up to the radius
r_max.r_max (float) – Cut-off value for the maximum distance between two atoms in angstrom.
- Returns:¶
float – Distance between the two atoms or a list of distances (if
use_super_cellis set toTrue).
-
calculate_ffingerprint(key: str | int | tuple | list =
None, r_max: float =20.0, delta_bin: float =0.005, sigma: float =0.05, use_legacy_smearing: bool =False, distinguish_kinds: bool =False) tuple[dict, dict]¶ Calculate f-fingerprint function for each element-pair and atomic site.
The calculation is based on equation (3) in doi:10.1063/1.3079326.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
delta_bin (float (optional)) – Bin size to descritize the function in angstrom.
sigma (float (optional)) – Smearing parameter for the Gaussian function.
use_legacy_smearing (bool) – Use the depreciated smearing method.
distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.
- Returns:¶
element_fingerprints (dict) – Dictionary containing all fingerprint functions of the structure summed over all atoms of the same element.
atomic_fingerprints (dict) – Dictionary containing all individual fingerprint functions for each atomic site.
-
calculate_voronoi_tessellation(key: str | int | tuple | list =
None, r_max: float =10.0) list[list[dict]]¶ Calculate voronoi polyhedron for each atomic site.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
- Returns:¶
list – List of voronoi details for each atomic site.
-
delete_atoms(key: str | int | tuple | list =
None, elements: str | list[str] =[], site_indices: int | list[int] =[], change_label: bool =False) aim2dat.strct.Structure | aim2dat.strct.StructureCollection¶ Delete atoms by element, list of elements, site index or list of site indices.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.elements (str, list or tuple) – Element or tuple or list of the elements to be deleted.
site_indices (list or tuple) – Site index or tuple or list of site indices to be deleted.
- Returns:¶
aim2dat.strct.Structure – Structure with deleted atoms.
-
determine_point_group(key: str | int | tuple | list =
None, threshold_distance: float =0.1, threshold_angle: float =1.0, threshold_inertia: float =0.1) dict¶ Determine the point group of a molecule.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.threshold_distance (float (optional)) – Tolerance parameter for distances.
threshold_angle (float (optional)) – Tolerance parameter for angles.
threshold_inertia (float (optional)) – Tolerance parameter for inertia.
- Returns:¶
dict – Dictionary containing the point group and symmetry elements of the structure.
-
determine_space_group(key: str | int | tuple | list =
None, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0, return_sym_operations: bool =False, return_primitive_structure: bool =False, return_standardized_structure: bool =False, no_idealize: bool =False) dict¶ Determine the space group of the structure using spglib as backend.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.symprec (float (optional)) – Tolerance parameter for spglib
angle_tolerance (float (optional)) – Tolerance parameter for spglib.
hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it.
return_sym_operations (bool (optional)) – Additionally, return all symmetry elements.
return_primitive_structure (bool (optional)) – Whether to return the primitive standardized structure.
return_standardized_structure (bool (optional)) – Whether to the non-primitive standardized structure.
no_idealize (bool (optional)) – Whether to idealize unit cell vectors and angles.
- Returns:¶
dict – Dictionary containing the internal space group number and labels.
-
classmethod from_aiida_structuredata(structure_node: int | str | aiida.orm.StructureData, use_uuid: bool =
False, label: str =None) Structure[source]¶ Append structure from AiiDA structure node.
- Parameters:¶
label (str) – Label used internally to store the structure in the object.
structure_node (int, str or aiida.orm.nodes.data.structure.StructureData) – Primary key, UUID or AiiDA structure node.
use_uuid (bool (optional)) – Whether to use the uuid (str) to represent AiiDA nodes instead of the primary key (int).
- Returns:¶
aiida_scripst.strct.Structure – Structure.
-
classmethod from_ase_atoms(ase_atoms: ase.Atoms, attributes: dict =
None, label: str =None) Structure[source]¶ Get structure from ase atoms object.
-
classmethod from_file(file_path: str, attributes: dict =
None, label: str =None) Structure[source]¶ Get structure from file using the ase read-function.
-
classmethod from_pymatgen_structure(pymatgen_structure: pymatgen.core.Molecule | pymatgen.core.Structure, attributes: dict =
None, label: str =None) Structure[source]¶ Get structure from pymatgen structure or molecule object.
- Parameters:¶
pymatgen_structure (pymatgen.core.Structure or pymatgen.core.Molecule) – pymatgen structure or molecule object.
attributes (dict) – Additional information about the structure.
label (str) – Label used internally to store the structure in the object.
- Returns:¶
aiida_scripst.strct.Structure – Structure.
-
get_positions(cartesian: bool =
True, wrap: bool =False)[source]¶ Return positions of atoms.
- Parameters:¶
cartesian (bool (optional)) – Get cartesian positions. If set to
Falsescaled positions are returned.wrap (bool (optional)) – Wrap atomic positions into the unit cell.
-
iter_sites(get_kind: bool =
False, get_cart_pos: bool =False, get_scaled_pos: bool =False, wrap: bool =False)[source]¶ Iterate through the sites of the structure.
- Parameters:¶
get_kind (bool (optional)) – Include kind in tuple.
get_cart_pos (bool (optional)) – Include cartesian position in tuple.
get_scaled_pos (bool (optional)) – Include scaled position in tuple.
wrap (bool (optional)) – Wrap atomic positions back into the unit cell.
- Yields:¶
str or tuple – Either element symbol or tuple containing the element symbol, kind string, cartesian position or scaled position.
-
scale_unit_cell(key: str | int | tuple | list =
None, scaling_factor: float =1.0, change_label: bool =False) aim2dat.strct.Structure | aim2dat.strct.StructureCollection¶ Scale unit cell of the structure.
- set_attribute(key: str, value)[source]¶
Set attribute.
- Parameters:¶
key (str) – Key of the attribute.
value – Value of the attribute.
-
set_positions(positions: list | tuple, is_cartesian: bool =
True, wrap: bool =False)[source]¶ Set postions of atoms.
- Parameters:¶
positions (list or tuple) – Nested list or tuple of the coordinates (n atoms x 3).
is_cartesian (bool (optional)) – Whether the coordinates are cartesian or scaled.
wrap (bool (optional)) – Wrap atomic positions into the unit cell.
-
substitute_elements(key: str | int | tuple | list =
None, elements: list[tuple[str]] | list[tuple[int]] =[], radius_type: str | None ='covalent', change_label: bool =False) aim2dat.strct.Structure | aim2dat.strct.StructureCollection¶ Substitute all atoms of one or several elements.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.elements (list or tuple) – Tuple or list of tuples of the elements that are substituted.
radius_type (str or None (optional)) – Radius type used to calculate the scaling factor for the unit cell. If set to
Noneno scaling is applied. The default value iscovalent.
- Returns:¶
aim2dat.strct.Structure – Structure with substituted elements.
-
to_aiida_structuredata(label=
None)[source]¶ Create AiiDA structuredata.
- Returns:¶
aiida.orm.StructureData – AiiDA structure node.
-
class aim2dat.strct.StructureCollection(structures: list | None =
None)[source]¶ The StructureCollection class is a container for one or multiple atomic structures. It implements several
import_*andappend_*functions to add new data to the object.- Parameters:¶
structures (list) – List of
Structureor dict objects.
Overview
Properties¶ Labels assigened to the structures.
Methods¶ append(label, elements, positions, pbc, cell, is_cartesian, wrap, kinds, attributes, extras)Append structure.
append_from_aiida_structuredata(aiida_node, use_uuid, label)Append structure from aiida structuredata.
append_from_ase_atoms(label, ase_atoms, attributes)Append structure from ase atoms object.
append_from_file(label, file_path, attributes)Append structure from file using the ase read-function.
append_from_pymatgen_structure(label, pymatgen_structure, attributes)Append structure from pymatgen structure or molecule object.
append_structure(structure, label)Append
Structureobject to collection. The label of the structure needs to becopy()Return copy of
StructureCollectionobject.create_pandas_df(exclude_columns)Create a pandas data frame of the object.
duplicate_structure(key, new_label)Duplicate structure.
Get all attribute keys.
Get the element symbols of all structures.
Get the kind strings of all structures.
Return a list of all structures.
get_structure(key, return_index_label)Get structure by key.
import_from_aiida_db(group_label, use_uuid, raise_error)Import from the AiiDA database.
import_from_hdf5_file(file_path, raise_error)Import from hdf5-file. Calculated extras are not yet supported.
import_from_pandas_df(data_frame, structure_column, exclude_columns, use_uuid, raise_error)Import from pandas data frame.
index(label)Return index of label. If the label is not present,
Noneis returned.items()Return a list of label, value tuples.
pop(key)Pop structure.
store_in_aiida_db(group_label, group_description)Store structures into the AiiDA-database.
store_in_hdf5_file(file_path)Store structures in hdf5-file. Calculated extras are not yet supported.
- property labels : list[str]¶
Labels assigened to the structures.
-
append(label: str, elements: list, positions: list, pbc: list, cell: list =
None, is_cartesian: bool =True, wrap: bool =False, kinds: list =None, attributes: dict =None, extras: dict =None)[source]¶ Append structure.
- Parameters:¶
label (str) – String used to identify the structure.
elements (list) – List of element symbols or their atomic numbers.
positions (list) – List of the atomic positions, either cartesian or scaled coordinates.
pbc (list or bool) – Periodic boundary conditions.
cell (list or np.array) – Nested 3x3 list of the cell vectors.
is_cartesian (bool (optional)) – Whether the coordinates are cartesian or scaled.
wrap (bool (optional)) – Wrap atomic positions back into the unit cell.
kinds (list) – List of kind names (this allows custom kinds like Ni0, Ni1, …). If None, the elements will be used as the kind names.
attributes (dict) – Additional information about the structure.
extras (dict) – Extras of the structure.
-
append_from_aiida_structuredata(aiida_node: int | str | aiida.orm.StructureData, use_uuid: bool =
False, label: str =None)[source]¶ Append structure from aiida structuredata.
- Parameters:¶
aiida_node (int, str or aiida.orm.StructureData) – Primary key, UUID or AiiDA structure node.
use_uuid (bool (optional)) – Whether to use the uuid (str) to represent AiiDA nodes instead of the primary key (int).
label (str) – String used to identify the structure. Overwrites
labelproperty of the structure.
-
append_from_ase_atoms(label: str, ase_atoms: ase.Atoms, attributes: dict =
None)[source]¶ Append structure from ase atoms object.
- Parameters:¶
label (str) – String used to identify the structure.
ase_atoms (ase.Atoms) – ase Atoms object.
attributes (dict) – Additional information about the structure.
-
append_from_file(label: str, file_path: str, attributes: dict =
None)[source]¶ Append structure from file using the ase read-function.
- Parameters:¶
label (str) – String used to identify the structure.
file_path (str) – File path.
attributes (dict) – Additional information about the structure.
-
append_from_pymatgen_structure(label: str, pymatgen_structure: pymatgen.core.Molecule | pymatgen.core.Structure, attributes: dict =
None)[source]¶ Append structure from pymatgen structure or molecule object.
- Parameters:¶
label (str) – String used to identify the structure.
pymatgen_structure (pymatgen.core.Structure or pymatgen.core.Molecule) – pymatgen structure or molecule object.
attributes (dict) – Additional information about the structure.
-
append_structure(structure: aim2dat.strct.strct.Structure, label: str =
None)[source]¶ Append
Structureobject to collection. The label of the structure needs to be either given via the structures’s property or as keyword argument.- Parameters:¶
structure (Structure) – Structure object.
label (str (optional)) – String used to identify the structure. Overwrites
labelproperty of the structure.
- copy() StructureCollection[source]¶
Return copy of
StructureCollectionobject.
-
create_pandas_df(exclude_columns: list =
[]) pandas.DataFrame[source]¶ Create a pandas data frame of the object.
- duplicate_structure(key: str | int, new_label: str)[source]¶
Duplicate structure.
- Parameters:¶
key (str or int) – Key of the structure.
new_label (str) – Label of the copied structure.
- get_all_elements() list[str][source]¶
Get the element symbols of all structures.
- Returns:¶
list – List of all element symbols .
- get_all_kinds() list[source]¶
Get the kind strings of all structures.
- Returns:¶
list – List of all kinds.
- get_all_structures() list[aim2dat.strct.strct.Structure][source]¶
Return a list of all structures.
- Returns:¶
list – List of all structures stored in the object.
-
get_structure(key: str | int, return_index_label: bool =
False) aim2dat.strct.strct.Structure[source]¶ Get structure by key.
-
import_from_aiida_db(group_label: str =
None, use_uuid: bool =False, raise_error: bool =True)[source]¶ Import from the AiiDA database.
- Parameters:¶
group_label (str or list (optional)) – Constrains query to structures that are member of the group(s).
use_uuid (bool (optional)) – Whether to use the uuid (str) to represent AiiDA nodes instead of the primary key (int).
raise_error (bool (optional)) – Whether to raise an error if one of the constraints is not met.
-
import_from_hdf5_file(file_path: str, raise_error: bool =
True)[source]¶ Import from hdf5-file. Calculated extras are not yet supported.
- Parameters:¶
file_path (str) – File path.
raise_error (bool (optional)) – Whether to raise an error if one of the constraints is not met.
-
import_from_pandas_df(data_frame: pandas.DataFrame, structure_column: str =
'optimized_structure', exclude_columns: list =[], use_uuid: bool =False, raise_error: bool =True)[source]¶ Import from pandas data frame.
- Parameters:¶
data_frame (pd.DataFrame) – Pandas data frame containing at least one column with the AiiDA structure nodes.
structure_column (str (optional)) – Column containing AiiDA structure nodes used to determine structural and compositional properties. The default value is
'optimized_structure'.exclude_columns (list (optional)) – Columns of the data frame that are excluded. The default value is
[].use_uuid (bool (optional)) – Whether to use the uuid (str) to represent AiiDA nodes instead of the primary key (int).
raise_error (bool (optional)) – Whether to raise an error if one of the constraints is not met.
- index(label: str)[source]¶
Return index of label. If the label is not present,
Noneis returned.- Parameters:¶
str – Label of the structure.
- items() list[tuple[str, aim2dat.strct.strct.Structure]][source]¶
Return a list of label, value tuples.
- pop(key: str | int) aim2dat.strct.strct.Structure[source]¶
Pop structure.
- Parameters:¶
str – Key of the structure.
-
class aim2dat.strct.StructureOperations(structures: aim2dat.strct.StructureCollection, append_to_coll: bool =
True, output_format: str ='dict', n_procs: int =1, chunksize: int =50, verbose: bool =True)[source]¶ Bases:
aim2dat.strct.mixin.AnalysisMixin,aim2dat.strct.mixin.ManipulationMixinServes as a wrapper to make the methods defined on a single Structure object accessible for a StructureCollection.
Overview
Properties¶ class Return calculation methods.
Whether to append manipulated structures also to the internal
StructureCollectionNumber of tasks handed to each process at once.
class Return manipulation methods.
Number of parallel processes.
Specify the output format of calculation methods. Supported options are
'dict'Return the internal
StructureCollectionobject.Return the supported output formats.
Print progress bar.
Methods¶ calculate_angle(key, site_index1, site_index2, site_index3, backfold_positions)Calculate angle between three atoms.
calculate_coordination(key, r_max, method, min_dist_delta, n_nearest_neighbours, econ_tolerance, econ_conv_threshold, voronoi_weight_type, voronoi_weight_threshold, okeeffe_weight_threshold)Calculate coordination environment of each atomic site.
calculate_dihedral_angle(key, site_index1, site_index2, site_index3, site_index4, backfold_positions)Calculate dihedral angle between four atoms.
calculate_distance(key, site_index1, site_index2, backfold_positions, use_supercell, r_max)Calculate distance between two atoms.
calculate_ffingerprint(key, r_max, delta_bin, sigma, use_legacy_smearing, distinguish_kinds)Calculate f-fingerprint function for each element-pair and atomic site.
calculate_stabilities(unit, exclude_keys)Calculate the formation energies and stabilities of all structures.
calculate_voronoi_tessellation(key, r_max)Calculate voronoi polyhedron for each atomic site.
compare_sites_via_coordination(key1, key2, site_index1, site_index2, r_max, cn_method, min_dist_delta, n_nearest_neighbours, econ_tolerance, econ_conv_threshold, voronoi_weight_type, voronoi_weight_threshold, okeeffe_weight_threshold, distinguish_kinds, threshold)Compare two atomic sites based on their coordination and the distances to their neighbour
compare_sites_via_ffingerprint(key1, key2, site_index1, site_index2, r_max, delta_bin, sigma, use_weights, use_legacy_smearing, distinguish_kinds)Calculate similarity of two atom sites.
compare_structures_via_comp_sym(key1, key2, symprec, angle_tolerance, hall_number)Compare two structures merely based on the composition and space group.
compare_structures_via_direct_comp(key1, key2, symprec, angle_tolerance, hall_number, no_idealize, length_threshold, angle_threshold, position_threshold, distinguish_kinds)Compare structures by comparing lattice vectors, angles and scaled positions.
compare_structures_via_ffingerprint(key1, key2, r_max, delta_bin, sigma, use_weights, use_legacy_smearing, distinguish_kinds)Calculate similarity of two structures.
copy()Return copy of
StructureCollectionobject.delete_atoms(key, elements, site_indices, change_label)Delete atoms by element, list of elements, site index or list of site indices.
determine_point_group(key, threshold_distance, threshold_angle, threshold_inertia)Determine the point group of a molecule.
determine_space_group(key, symprec, angle_tolerance, hall_number, return_sym_operations, return_primitive_structure, return_standardized_structure, no_idealize)Determine the space group of the structure using spglib as backend.
find_duplicates_via_comp_sym(confined, remove_structures, symprec, angle_tolerance, hall_number)Find duplicate structures coimparing the composition and space group.
find_duplicates_via_direct_comp(confined, remove_structures, symprec, angle_tolerance, hall_number, no_idealize, length_threshold, angle_threshold, position_threshold, distinguish_kinds)Find duplicate structures comparing directly the lattice parameters and positions of the
find_duplicates_via_ffingerprint(confined, remove_structures, threshold, r_max, delta_bin, sigma, use_weights, use_legacy_smearing, distinguish_kinds)Find duplicate structures using the FFingerprint method.
find_eq_sites_via_coordination(key, r_max, cn_method, min_dist_delta, n_nearest_neighbours, econ_tolerance, econ_conv_threshold, voronoi_weight_type, voronoi_weight_threshold, okeeffe_weight_threshold, distinguish_kinds, threshold)Find equivalent sites by comparing the coordination of each site and its distance to the
find_eq_sites_via_ffingerprint(key, r_max, delta_bin, sigma, use_weights, use_legacy_smearing, distinguish_kinds, threshold)Find equivalent sites by comparing the F-Fingerprint of each site.
perform_analysis(key, method, kwargs)Perform structure analaysis using an external method.
perform_manipulation(key, method, kwargs)Perform structure manipulation using an external method.
scale_unit_cell(key, scaling_factor, change_label)Scale unit cell of the structure.
substitute_elements(key, elements, radius_type, change_label)Substitute all atoms of one or several elements.
- property append_to_coll : bool¶
Whether to append manipulated structures also to the internal
StructureCollectionobject.- Type:¶
bool
- property output_format : str¶
Specify the output format of calculation methods. Supported options are
'dict'and'DataFrame'.- Type:¶
str
- property structures : aim2dat.strct.StructureCollection¶
Return the internal
StructureCollectionobject.
- property supported_output_formats : list[str]¶
Return the supported output formats.
-
calculate_angle(key: str | int | tuple | list =
None, site_index1: int =0, site_index2: int =1, site_index3: int =2, backfold_positions: bool =True) float¶ Calculate angle between three atoms.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
site_index3 (int) – Index of the site.
backfold_positions (bool) – Whether to backfold the atomic sites and return the smallest distance.
- Returns:¶
float – Angle calculated via the vectors from atom 2 to atom 1 and atom 3.
-
calculate_coordination(key: str | int | tuple | list =
None, r_max: float =10.0, method: str ='minimum_distance', min_dist_delta: float =0.1, n_nearest_neighbours: int =5, econ_tolerance: float =0.5, econ_conv_threshold: float =0.001, voronoi_weight_type: float ='rel_solid_angle', voronoi_weight_threshold: float =0.5, okeeffe_weight_threshold: float =0.5) dict¶ Calculate coordination environment of each atomic site.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
method (str (optional)) – Method used to calculate the coordination environment. The default value is
'minimum_distance'.min_dist_delta (float (optional)) – Tolerance parameter that defines the relative distance from the nearest neighbour atom for the
'minimum_distance'method.n_nearest_neighbours (int (optional)) – Number of neighbours that are considered coordinated for the
'n_neighbours'method.econ_tolerance (float (optional)) – Tolerance parameter for the econ method.
econ_conv_threshold (float (optional)) – Convergence threshold for the econ method.
voronoi_weight_type (str (optional)) – Weight type of the Voronoi facets. Supported options are
'covalent_atomic_radius','area'and'solid_angle'. The prefix'rel_'specifies that the relative weights with respect to the maximum value of the polyhedron are calculated.voronoi_weight_threshold (float (optional)) – Weight threshold to consider a neighbouring atom coordinated.
okeeffe_weight_threshold (float (optional)) – Threshold parameter to distinguish indirect and direct neighbour atoms for the
'okeeffe'.This parameter is depreciated and will be removed in a future version. The original results can be obtained by using the
voronoi_weight_thresholdparameter and settingvoronoi_weight_typeto'rel_solid_angle'.
- Returns:¶
dict – Dictionary containing the coordination information of the structure.
-
calculate_dihedral_angle(key: str | int | tuple | list =
None, site_index1: int =0, site_index2: int =1, site_index3: int =2, site_index4: int =3, backfold_positions: bool =True) float¶ Calculate dihedral angle between four atoms.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
site_index3 (int) – Index of the site.
site_index4 (int) – Index of the site.
backfold_positions (bool) – Whether to backfold the atomic sites and return the smallest distance.
- Returns:¶
float – Dihedral angle.
-
calculate_distance(key: str | int | tuple | list =
None, site_index1: int | list[int] =0, site_index2: int | list[int] =1, backfold_positions: bool =True, use_supercell: bool =False, r_max: float =7.5) float | list¶ Calculate distance between two atoms.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
backfold_positions (bool) – Whether to backfold the atomic sites and return the smallest distance.
use_supercell (bool) – User supercell to calculate all distances between the two atomic sites up to the radius
r_max.r_max (float) – Cut-off value for the maximum distance between two atoms in angstrom.
- Returns:¶
float – Distance between the two atoms or a list of distances (if
use_super_cellis set toTrue).
-
calculate_ffingerprint(key: str | int | tuple | list =
None, r_max: float =20.0, delta_bin: float =0.005, sigma: float =0.05, use_legacy_smearing: bool =False, distinguish_kinds: bool =False) tuple[dict, dict]¶ Calculate f-fingerprint function for each element-pair and atomic site.
The calculation is based on equation (3) in doi:10.1063/1.3079326.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
delta_bin (float (optional)) – Bin size to descritize the function in angstrom.
sigma (float (optional)) – Smearing parameter for the Gaussian function.
use_legacy_smearing (bool) – Use the depreciated smearing method.
distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.
- Returns:¶
element_fingerprints (dict) – Dictionary containing all fingerprint functions of the structure summed over all atoms of the same element.
atomic_fingerprints (dict) – Dictionary containing all individual fingerprint functions for each atomic site.
-
calculate_stabilities(unit: str =
'eV', exclude_keys: list =[]) tuple[list, list][source]¶ Calculate the formation energies and stabilities of all structures.
The stabilities are only valid for binary systems.
- Parameters:¶
unit (str (optional)) – Energy unit.
exclude_keys (list) – List of keys of structures that are not included in the detection of the convex hull. This means that the stability of these structures may have a negative sign.
- Returns:¶
formation_energies (list) – List of the formation energies of all structures.
stabilities (list) – List of the stabilities of all structures.
-
calculate_voronoi_tessellation(key: str | int | tuple | list =
None, r_max: float =10.0) list[list[dict]]¶ Calculate voronoi polyhedron for each atomic site.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
- Returns:¶
list – List of voronoi details for each atomic site.
-
compare_sites_via_coordination(key1: str | int, key2: str | int, site_index1: int, site_index2: int, r_max: float =
10.0, cn_method: str ='minimum_distance', min_dist_delta: float =0.1, n_nearest_neighbours: int =5, econ_tolerance: float =0.5, econ_conv_threshold: float =0.001, voronoi_weight_type: float ='rel_solid_angle', voronoi_weight_threshold: float =0.5, okeeffe_weight_threshold: float =0.5, distinguish_kinds: bool =False, threshold: float =0.01)[source]¶ Compare two atomic sites based on their coordination and the distances to their neighbour atoms.
- Parameters:¶
key1 (str or int) – Index or label of the first structure.
key2 (str or int) – Index or label of the second structure.
site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
cn_method (str (optional)) – Method used to calculate the coordination environment.
min_dist_delta (float (optional)) – Tolerance parameter that defines the relative distance from the nearest neighbour atom for the
'minimum_distance'method.n_nearest_neighbours (int (optional)) – Number of neighbours that are considered coordinated for the
'n_neighbours'method.econ_tolerance (float (optional)) – Tolerance parameter for the econ method.
econ_conv_threshold (float (optional)) – Convergence threshold for the econ method.
voronoi_weight_type (str (optional)) – Weight type of the Voronoi facets. Supported options are
'covalent_atomic_radius','area'and'solid_angle'. The prefix'rel_'specifies that the relative weights with respect to the maximum value of the polyhedron are calculated.voronoi_weight_threshold (float (optional)) – Weight threshold to consider a neighbouring atom coordinated.
okeeffe_weight_threshold (float (optional)) – Threshold parameter to distinguish indirect and direct neighbour atoms for the
'okeeffe'.distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.threshold (float (optional)) – Threshold to consider two sites equivalent.
- Returns:¶
bool – Whether the two sites are equivalent or not.
-
compare_sites_via_ffingerprint(key1: str | int, key2: str | int, site_index1: int, site_index2: int, r_max: float =
15.0, delta_bin: float =0.005, sigma: float =10.0, use_weights: bool =True, use_legacy_smearing: bool =False, distinguish_kinds: bool =False)[source]¶ Calculate similarity of two atom sites.
The cosine-distance is used to compare the two structures.
- Parameters:¶
key1 (str or int) – Index or label of the first structure.
key2 (str or int) – Index or label of the second structure.
site_index1 (int) – Index of the site.
site_index2 (int) – Index of the site.
r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
delta_bin (float (optional)) – Bin size to descritize the function in angstrom.
sigma (float (optional)) – Smearing parameter for the Gaussian function.
use_weights (bool (optional)) – Whether to use importance weights for the element pairs.
use_legacy_smearing (bool) – Use the depreciated smearing method.
distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.
- Returns:¶
distance (float) – Measure for the similarity of the two sites.
-
compare_structures_via_comp_sym(key1: str | int, key2: str | int, symprec: float =
0.005, angle_tolerance: float =-1.0, hall_number: int =0) bool[source]¶ Compare two structures merely based on the composition and space group.
- Parameters:¶
key1 (str or int) – Index or label of the first structure.
key2 (str or int) – Index or label of the second structure.
symprec (float (optional)) – Tolerance parameter for spglib.
angle_tolerance (float (optional)) – Tolerance parameter for spglib.
hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it.
- Returns:¶
bool – Returns
Trueif the structures match and otherwiseFalse.
-
compare_structures_via_direct_comp(key1: str | int, key2: str | int, symprec: float =
0.005, angle_tolerance: float =-1.0, hall_number: float =0, no_idealize: bool =False, length_threshold: float =0.08, angle_threshold: float =0.03, position_threshold: float =0.025, distinguish_kinds: bool =False) bool[source]¶ Compare structures by comparing lattice vectors, angles and scaled positions.
-
compare_structures_via_ffingerprint(key1: str | int, key2: str | int, r_max: float =
15.0, delta_bin: float =0.005, sigma: float =0.05, use_weights: bool =True, use_legacy_smearing: bool =False, distinguish_kinds: bool =False) float[source]¶ Calculate similarity of two structures.
The cosine-distance is used to compare the two structures.
- Parameters:¶
key1 (str or int) – Index or label of the first structure.
key2 (str or int) – Index or label of the second structure.
r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
delta_bin (float (optional)) – Bin size to descritize the function in angstrom.
sigma (float (optional)) – Smearing parameter for the Gaussian function.
use_weights (bool (optional)) – Whether to use importance weights for the element pairs.
use_legacy_smearing (bool) – Use the depreciated smearing method.
distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.
- Returns:¶
distance (float) – Measure for the similarity of the two structures.
- copy() StructureOperations[source]¶
Return copy of
StructureCollectionobject.
-
delete_atoms(key: str | int | tuple | list =
None, elements: str | list[str] =[], site_indices: int | list[int] =[], change_label: bool =False) aim2dat.strct.Structure | aim2dat.strct.StructureCollection¶ Delete atoms by element, list of elements, site index or list of site indices.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.elements (str, list or tuple) – Element or tuple or list of the elements to be deleted.
site_indices (list or tuple) – Site index or tuple or list of site indices to be deleted.
- Returns:¶
aim2dat.strct.Structure – Structure with deleted atoms.
-
determine_point_group(key: str | int | tuple | list =
None, threshold_distance: float =0.1, threshold_angle: float =1.0, threshold_inertia: float =0.1) dict¶ Determine the point group of a molecule.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.threshold_distance (float (optional)) – Tolerance parameter for distances.
threshold_angle (float (optional)) – Tolerance parameter for angles.
threshold_inertia (float (optional)) – Tolerance parameter for inertia.
- Returns:¶
dict – Dictionary containing the point group and symmetry elements of the structure.
-
determine_space_group(key: str | int | tuple | list =
None, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0, return_sym_operations: bool =False, return_primitive_structure: bool =False, return_standardized_structure: bool =False, no_idealize: bool =False) dict¶ Determine the space group of the structure using spglib as backend.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.symprec (float (optional)) – Tolerance parameter for spglib
angle_tolerance (float (optional)) – Tolerance parameter for spglib.
hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it.
return_sym_operations (bool (optional)) – Additionally, return all symmetry elements.
return_primitive_structure (bool (optional)) – Whether to return the primitive standardized structure.
return_standardized_structure (bool (optional)) – Whether to the non-primitive standardized structure.
no_idealize (bool (optional)) – Whether to idealize unit cell vectors and angles.
- Returns:¶
dict – Dictionary containing the internal space group number and labels.
-
find_duplicates_via_comp_sym(confined: list =
None, remove_structures: bool =False, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0) list[tuple[str]][source]¶ Find duplicate structures coimparing the composition and space group.
- Parameters:¶
confined (list or None (optional)) – Confine comparison to a subset of the structure collection by giving a minimum and maximum index.
remove_structures (bool (optional)) – Whether to remove the duplicate structures.
symprec (float (optional)) – Tolerance parameter for spglib.
angle_tolerance (float (optional)) – Tolerance parameter for spglib.
hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it.
- Returns:¶
list – List of tuples containing the indices of the found duplicate pairs.
-
find_duplicates_via_direct_comp(confined: list =
None, remove_structures: bool =False, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0, no_idealize: bool =False, length_threshold: float =0.08, angle_threshold: float =0.03, position_threshold: float =0.025, distinguish_kinds: bool =False) list[tuple[str]][source]¶ - Find duplicate structures comparing directly the lattice parameters and positions of the
standardized structures..
- Parameters:¶
confined (list or None (optional)) – Confine comparison to a subset of the structure collection by giving a minimum and maximum index.
remove_structures (bool (optional)) – Whether to remove the duplicate structures.
symprec (float (optional)) – Tolerance parameter for spglib.
angle_tolerance (float (optional)) – Tolerance parameter for spglib.
hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it.
- Returns:¶
list – List of tuples containing the indices of the found duplicate pairs.
-
find_duplicates_via_ffingerprint(confined: list =
None, remove_structures: bool =False, threshold: float =0.001, r_max: float =15.0, delta_bin: float =0.005, sigma: float =0.05, use_weights: bool =True, use_legacy_smearing: bool =False, distinguish_kinds: bool =False) list[tuple[str]][source]¶ Find duplicate structures using the FFingerprint method.
- Parameters:¶
confined (list or None (optional)) – Confine comparison to a subset of the structure collection by giving a minimum and maximum index.
remove_structures (bool (optional)) – Whether to remove the duplicate structures.
threshold (float (optional)) – Threshold of the FFingerprint to detect duplicate structures.
r_max (float (optional)) – Maximum distance between two atoms used to construct the super cell.
delta_bin (float (optional)) – Bin size to discretize the function in angstrom.
sigma (float (optional)) – Smearing parameter for the Gaussian function.
use_weights (bool (optional)) – Whether to use importance weights for the element pairs.
use_legacy_smearing (bool) – Use the depreciated smearing method.
distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.
- Returns:¶
list – List of tuples containing the indices of the found duplicate pairs.
-
find_eq_sites_via_coordination(key: str | int, r_max: float =
10.0, cn_method: str ='minimum_distance', min_dist_delta: float =0.1, n_nearest_neighbours: int =5, econ_tolerance: float =0.5, econ_conv_threshold: float =0.001, voronoi_weight_type: float ='rel_solid_angle', voronoi_weight_threshold: float =0.5, okeeffe_weight_threshold: float =0.5, distinguish_kinds: bool =False, threshold: float =0.01)[source]¶ Find equivalent sites by comparing the coordination of each site and its distance to the neighbour atoms.
- Parameters:¶
key (str or int) – Index or label of the structure.
r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
cn_method (str (optional)) – Method used to calculate the coordination environment.
min_dist_delta (float (optional)) – Tolerance parameter that defines the relative distance from the nearest neighbour atom for the
'minimum_distance'method.n_nearest_neighbours (int (optional)) – Number of neighbours that are considered coordinated for the
'n_neighbours'method.econ_tolerance (float (optional)) – Tolerance parameter for the econ method.
econ_conv_threshold (float (optional)) – Convergence threshold for the econ method.
okeeffe_weight_threshold (float (optional)) – Threshold parameter to distinguish indirect and direct neighbour atoms for the
'okeeffe'.distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.threshold (float (optional)) – Threshold to consider two sites equivalent.
- Returns:¶
dict – Dictionary grouping equivalent sites.
-
find_eq_sites_via_ffingerprint(key: str | int, r_max: float =
20.0, delta_bin: float =0.005, sigma: float =0.05, use_weights: bool =True, use_legacy_smearing: bool =False, distinguish_kinds: bool =False, threshold: float =0.001)[source]¶ Find equivalent sites by comparing the F-Fingerprint of each site.
- Parameters:¶
key (str or int) – Index or label of the structure.
r_max (float (optional)) – Cut-off value for the maximum distance between two atoms in angstrom.
delta_bin (float (optional)) – Bin size to descritize the function in angstrom.
sigma (float (optional)) – Smearing parameter for the Gaussian function.
use_weights (bool) – Whether to use importance weights for the element pairs.
use_legacy_smearing (bool) – Use the depreciated smearing method.
distinguish_kinds (bool (optional)) – Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True.threshold (float (optional)) – Threshold to consider two sites equivalent.
- Returns:¶
dict – Dictionary grouping equivalent sites.
-
perform_analysis(key: str | int | tuple | list, method: collections.abc.Callable, kwargs: dict =
{})[source]¶ Perform structure analaysis using an external method.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.method (function) – Analysis function.
kwargs (dict) – Arguments to be passed to the function.
- Returns:¶
output – Output of the analysis.
-
perform_manipulation(key: str | int | tuple | list, method: collections.abc.Callable, kwargs: dict =
{})[source]¶ Perform structure manipulation using an external method.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.method (function) – Function which manipulates the structure(s).
kwargs (dict) – Arguments to be passed to the function.
- Returns:¶
aim2dat.strct.Structure or
aim2dat.strct.StructureCollection – Manipulated structure(s).
-
scale_unit_cell(key: str | int | tuple | list =
None, scaling_factor: float =1.0, change_label: bool =False) aim2dat.strct.Structure | aim2dat.strct.StructureCollection¶ Scale unit cell of the structure.
-
substitute_elements(key: str | int | tuple | list =
None, elements: list[tuple[str]] | list[tuple[int]] =[], radius_type: str | None ='covalent', change_label: bool =False) aim2dat.strct.Structure | aim2dat.strct.StructureCollection¶ Substitute all atoms of one or several elements.
- Parameters:¶
key (str, int, tuple or list) – Only used in the
StructureOperationsclass. Specifies the key or list/tuple of keys of the underlyingStructureCollectionobject.elements (list or tuple) – Tuple or list of tuples of the elements that are substituted.
radius_type (str or None (optional)) – Radius type used to calculate the scaling factor for the unit cell. If set to
Noneno scaling is applied. The default value iscovalent.
- Returns:¶
aim2dat.strct.Structure – Structure with substituted elements.
- class aim2dat.strct.SurfaceGeneration(structure: aim2dat.strct.strct.Structure)[source]¶
Generates a surfaces and surface slabs based on a bulk crystal structure.
Overview
Methods¶ create_surface(miller_indices, termination, tolerance, symprec, angle_tolerance, hall_number)Create surface from a bulk crystal structure.
generate_surface_slabs(miller_indices, nr_layers, periodic, vacuum, vacuum_factor, symmetrize, tolerance, symprec, angle_tolerance, hall_number)Generate surface slabs with all terminations for a certain direction given by its
store_surfaces_in_aiida_db(miller_indices, tolerance, symprec, angle_tolerance, hall_number, group_label, group_description)Store surfaces into the AiiDA-database.
to_aiida_surfacedata(miller_indices, termination, tolerance, symprec, angle_tolerance, hall_number)Create surface from a bulk crystal structure.
-
create_surface(miller_indices: tuple[int] | list[int] =
(1, 0, 0), termination: int =1, tolerance: float =0.005, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0) dict[source]¶ Create surface from a bulk crystal structure.
- Parameters:¶
miller_indices (list or tuple (optional)) – Miller indices of the surface. The default value is
(1, 0, 0).termination (int (optional)) – Determine termination of the surface.
tolerance (float (optional)) – Numerical tolerance. The default value is
0.005.symprec (float (optional)) – Tolerance parameter for spglib. The default value is
0.005.angle_tolerance (float (optional)) – Tolerance parameter for spglib. The default value is
-1.0.hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it. The default number is
0.
- Returns:¶
dict – Dictionary containing the surface data.
-
generate_surface_slabs(miller_indices: tuple[int] | list[int] =
(1, 0, 0), nr_layers: int =5, periodic: bool =False, vacuum: float =10.0, vacuum_factor: float =0.0, symmetrize: bool =True, tolerance: float =0.01, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0) aim2dat.strct.structure_collection.StructureCollection | None[source]¶ Generate surface slabs with all terminations for a certain direction given by its miller indices.
- Parameters:¶
miller_indices (list or tuple (optional)) – Miller indices of the surface. The default value is
(1, 0, 0).nr_layers (int (optional)) – Number of repititions of the underlying periodic surface cell. The default value is
5.periodic (bool (optional)) – Whether to apply periodic boundary conditions in the direction normal to the surface plane. The default value is
False.vacuum (float (optional)) – Vacuum space added at the top and bottom of the slab. The default value is
10.0.vacuum_factor (float (optional)) – Alternatively to the
vacuum-parameter the amount of vacuum can be set as a multiple of the slab size. The method is only applied if the parameter is larger than zero. The default value is0.0.symmetrize (bool (optional)) – Create slabs that have the same termination on both sides. The default value is
True.tolerance (float (optional)) – Numerical tolerance. The default value is
0.005.symprec (float (optional)) – Tolerance parameter for spglib. The default value is
0.005.angle_tolerance (float (optional)) – Tolerance parameter for spglib. The default value is
-1.0.hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it. The default number is
0.
- Returns:¶
StructureCollection – Collection of the generated surface slabs.
-
store_surfaces_in_aiida_db(miller_indices: tuple[int] =
(1, 0, 0), tolerance: float =0.005, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0, group_label: str =None, group_description: str =None)[source]¶ Store surfaces into the AiiDA-database.
- Parameters:¶
miller_indices (list or tuple (optional)) – Miller indices of the surface. The default value is
(1, 0, 0).tolerance (float (optional)) – Numerical tolerance. The default value is
0.005.symprec (float (optional)) – Tolerance parameter for spglib. The default value is
0.005.angle_tolerance (float (optional)) – Tolerance parameter for spglib. The default value is
-1.0.hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it. The default number is
0.group_label (str (optional)) – Label of the AiiDA group.
group_description (str (optional)) – Description of the AiiDA group.
- Returns:¶
list – List containing dictionary of all surface nodes.
-
to_aiida_surfacedata(miller_indices: tuple[int] | list[int] =
(1, 0, 0), termination: int =1, tolerance: float =0.005, symprec: float =0.005, angle_tolerance: float =-1.0, hall_number: int =0)[source]¶ Create surface from a bulk crystal structure.
- Parameters:¶
miller_indices (list or tuple (optional)) – Miller indices of the surface. The default value is
(1, 0, 0).termination (int (optional)) – Determine termination of the surface.
tolerance (float (optional)) – Numerical tolerance. The default value is
0.005.symprec (float (optional)) – Tolerance parameter for spglib. The default value is
0.005.angle_tolerance (float (optional)) – Tolerance parameter for spglib. The default value is
-1.0.hall_number (int (optional)) – The argument to constrain the space-group-type search only for the Hall symbol corresponding to it. The default number is
0.
- Returns:¶
SurfaceData – AiiDA surface data node.
-
create_surface(miller_indices: tuple[int] | list[int] =