generator#

Generate defect objects

Functions

create_interstitials

Create Interstitial objects based on Voronoi with pymatgen, staring from a bulk structure (unit cell or supercell).

create_substitutions

Create Substitution objects for each non-equivalent site, staring from a bulk structure (unit cell or supercell).

create_vacancies

Create Vacancy objects for each non-equivalent site, staring from a bulk structure (unit cell or supercell).

create_interstitials(structure, elements, supercell_size=None, **kwargs)[source]#

Create Interstitial objects based on Voronoi with pymatgen, staring from a bulk structure (unit cell or supercell).

Parameters:
  • structure (Structure) – Bulk structure.

  • elements (list) – List of element symbols.

  • supercell_size (int) – Input for the make_supercell function of the Structure class. If None the input structure is not modified. The default is None.

  • kwargs

    Kwargs to pass to VoronoiInterstitialGenerator:

    • clustering_tol: Tolerance for clustering the Voronoi nodes.

    • min_dist: Minimum distance between an interstitial and the nearest atom.

    • ltol: Tolerance for lattice matching.

    • stol: Tolerance for structure matching.

    • angle_tol: Angle tolerance for structure matching.

    • kwargs: Additional keyword arguments for the TopographyAnalyzer constructor.

Returns:

defects – List of Interstitial objects.

Return type:

list

create_substitutions(structure, elements_to_replace, supercell_size=None, **kwargs)[source]#

Create Substitution objects for each non-equivalent site, staring from a bulk structure (unit cell or supercell).

Parameters:
  • structure (Structure) – Bulk structure, both unit cell or supercell can be used as input.

  • elements_to_replace (dict) – Dict with element symbol of specie to be replaced as keys and element symbol of the species to be replaced with as values ({‘old_El’:’new_El’}).

  • supercell_size (int or numpy array) – Input for the make_supercell function of the Structure class. If None the input structure is not modified.

  • kwargs (dict) –

    Kwargs to pass to SpaceGroupAnalyzer class:

    • symprec (float):

      Tolerance for symmetry finding. Defaults to 0.01, which is fairly strict and works well for properly refined structures with atoms in the proper symmetry coordinates. For structures with slight deviations from their proper atomic positions (e.g., structures relaxed with electronic structure codes), a looser tolerance of 0.1 (the value used in Materials Project) is often needed.

    • angle_tolerance (float):

      Angle tolerance for symmetry finding. Defaults to 5 degrees.

Returns:

defects – List of Substitution objects.

Return type:

list

create_vacancies(structure, elements=None, supercell_size=None, **kwargs)[source]#

Create Vacancy objects for each non-equivalent site, staring from a bulk structure (unit cell or supercell).

Parameters:
  • structure (Structure) – Bulk structure, both unit cell or supercell can be used as input.

  • elements (str) – Symbol of the elements for which vacancies are needed. If None all of the elements are considered. The default is None.

  • supercell_size (int or numpy array) – Input for the make_supercell function of the Structure class. If None the input structure is not modified.

  • kwargs (dict) –

    Kwargs to pass to SpaceGroupAnalyzer class:

    • symprec (float):

      Tolerance for symmetry finding. Defaults to 0.01, which is fairly strict and works well for properly refined structures with atoms in the proper symmetry coordinates. For structures with slight deviations from their proper atomic positions (e.g., structures relaxed with electronic structure codes), a looser tolerance of 0.1 (the value used in Materials Project) is often needed.

    • angle_tolerance (float):

      Angle tolerance for symmetry finding. Defaults to 5 degrees.

Returns:

defects – List of Vacancy objects.

Return type:

list