aim2dat.strct.structure_operations

Implements the StructureComparison and StructuresOperations classes to analyze a collection of structures.

Module Contents

Classes

StructureOperations

Serves as a wrapper to make the methods defined on a single

Functions

compare_structures(structures, compare_function, ...)

Parallelize structure comparison methods via this wrapper function.

structure_wrapper(structure, method, kwargs, check_stored)

Parallelize structure analysis and manipulation methods via this wrapper function.

class aim2dat.strct.structure_operations.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.ManipulationMixin

Serves as a wrapper to make the methods defined on a single Structure object accessible for a StructureCollection.

Overview

Properties

analysis_methods

class Return calculation methods.

append_to_coll

Whether to append manipulated structures also to the internal StructureCollection

chunksize

Number of tasks handed to each process at once.

manipulation_methods

class Return manipulation methods.

n_procs

Number of parallel processes.

output_format

Specify the output format of calculation methods. Supported options are 'dict'

structures

Return the internal StructureCollection object.

supported_output_formats

Return the supported output formats.

verbose

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 StructureCollection 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.

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.

class property analysis_methods : list

Return calculation methods.

Type:

list

property append_to_coll : bool

Whether to append manipulated structures also to the internal StructureCollection object.

Type:

bool

property chunksize : int

Number of tasks handed to each process at once.

Type:

int

class property manipulation_methods : list

Return manipulation methods.

Type:

list

property n_procs : int

Number of parallel processes.

Type:

int

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 StructureCollection object.

property supported_output_formats : list[str]

Return the supported output formats.

property verbose : bool

Print progress bar.

Type:

bool

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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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_threshold parameter and setting voronoi_weight_type to '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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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_cell is set to True).

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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 True if the structures match and otherwise False.

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 StructureCollection object.

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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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.

Parameters:
  • key (str, int, tuple or list) – Only used in the StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • scaling_factor (float) – Scaling factor.

Returns:

aim2dat.strct.Structure – Structure with scaled 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 StructureOperations class. Specifies the key or list/tuple of keys of the underlying StructureCollection object.

  • 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 None no scaling is applied. The default value is covalent.

Returns:

aim2dat.strct.Structure – Structure with substituted elements.

aim2dat.strct.structure_operations.compare_structures(structures, compare_function, comp_kwargs, threshold)[source]

Parallelize structure comparison methods via this wrapper function.

aim2dat.strct.structure_operations.structure_wrapper(structure, method, kwargs, check_stored)[source]

Parallelize structure analysis and manipulation methods via this wrapper function.