pymatgen.analysis.defects.point_defects module¶

class
Defect
[source]¶ Bases:
object
Abstract class for point defects

get_coordinated_elements
(n)[source]¶ Elements of sites in structure surrounding the defect site.
Parameters: n – Index of defect list

get_coordinated_sites
(n)[source]¶ The sites in structure surrounding the defect site.
Parameters: n – Index of defects list

get_defectsite_coordination_number
(n)[source]¶ Coordination number of interstitial site.
Parameters: n – Index of interstitial list

get_defectsite_multiplicity
(n)[source]¶ Returns the symmtric multiplicity of the defect site at the index.

make_supercells_with_defects
(scaling_matrix)[source]¶ Generate the supercell with input multipliers and create the defect. First supercell has no defects. To create unit cell with defect pass unit matrix.

struct_radii
¶ Radii of elements in the structure

struct_valences
¶ Valence of elements in the structure

structure
¶ Returns the structure without any defects Useful for MottLittleton calculations.


class
Interstitial
(structure, valences, radii, site_type='voronoi_vertex', accuracy='Normal', symmetry_flag=True, oxi_state=False)[source]¶ Bases:
pymatgen.analysis.defects.point_defects.Defect
Subclass of Defect to generate interstitial sites
Given a structure, generate symmetrically distinct interstitial sites. For a nonionic structure, use oxi_state=True and give atomic radii.
Parameters:  structure – pymatgen.core.structure.Structure
 valences – Dictionary of oxidation states of elements in {el:valence} form
 radii – Radii of elemnts in the structure
 site_type – “voronoi_vertex” uses voronoi nodes “voronoi_edgecenter” uses voronoi polyhedra edge centers “voronoi_facecenter” uses voronoi polyhedra face centers “all” combines vertices, edgecenters and facecenters. Default is “voronoi_vertex”
 accuracy – Flag denoting whether to use high accuracy version of Zeo++. Options are “Normal” and “High”. Default is normal.
 symmetry_flag – If True, only returns symmetrically distinct sites
 oxi_state – If False, input structure is considered devoid of oxidationstate decoration. And oxistate for each site is determined. Use True, if input structure is oxistate decorated. This option is useful when the structure is not electroneutral after deleting/adding sites. In that case oxidecorate the structure before deleting/adding the sites.

append_defectsite
(site)[source]¶ Append a site to list of possible interstitials
Parameters: site – pymatgen.core.sites.Site

delete_defectsite
(n)[source]¶ Remove a symmetrically distinct interstitial site
Parameters: n – Index of interstitial site

enumerate_defectsites
()[source]¶ Enumerate all the symmetrically distinct interstitial sites. The defect site has “X” as occupied specie.

get_coordsites_charge_sum
(n)[source]¶ Total charge of the interstitial coordinated sites.
Parameters: n – Index of interstitial list

get_coordsites_min_max_charge
(n)[source]¶ Minimum and maximum charge of sites surrounding the interstitial site.
Parameters: n – Index of symmetrical distinct interstitial site

get_radius
(n)[source]¶ Volume of the nth interstitial
Parameters: n – Index of symmetrically distinct vacancies list Returns: floating number representing radius of interstitial sphere

make_supercells_with_defects
(scaling_matrix, element)[source]¶ Returns sequence of supercells in pymatgen.core.structure.Structure format, with each supercell containing an interstitial. First supercell has no defects.

prune_defectsites
(el='C', oxi_state=4, dlta=0.1)[source]¶ Prune all the defect sites which can’t acoomodate the input elment with the input oxidation state.

class
InterstitialAnalyzer
(inter, el, oxi_state, scd=2)[source]¶ Bases:
object
Use GULP to compute the interstitial formation energy, relaxed structures. Works only for metal oxides due to the use of Buckingham Potentials.
Parameters:  inter – pymatgen.defects.point_defects.Interstitial
 el – Element name in short hand notation (“El”)
 oxi_state – Oxidtation state
 scd – Super cell dimension as number. The scaling is equal along xyz.

get_percentage_bond_distance_change
(n)[source]¶ Bond distance change after the introduction of interstitial
Parameters: n – Symmetrically distinct interstitial index

get_percentage_lattice_parameter_change
(n)[source]¶ Lattice parameter change after the introduction of interstitial
Parameters: n – Symmetrically distinct interstitial index

get_percentage_volume_change
(n)[source]¶ Volume change after the introduction of interstitial
Parameters: n – Symmetrically distinct interstitial index

class
InterstitialStructureRelaxer
(interstitial, el, oxi_state, supercell_dim=2)[source]¶ Bases:
object
Performs structural relaxation for each interstitial supercell.
Parameters:  interstitial – Unrelaxed interstitial
 el – Species string in short notation
 oxi_state – Oxidation state of the element
 supercell_dim – Dimensions of super cell

get_relaxed_energy
(n)[source]¶ Get the relaxed structure of nth symmetrically distinct interstitial.
Parameters: n – Symmetrically distinct interstitial index Note
0 corresponds to relaxed bulk structure

get_relaxed_interstitial
()[source]¶ Get the relaxed structure of nth symmetrically distinct interstitial.
Parameters: n – Symmetrically distinct interstitial index

get_relaxed_structure
(n)[source]¶ Get the relaxed structure of nth symmetrically distinct interstitial.
Parameters: n – Symmetrically distinct interstitial index Note
0 corresponds to relaxed bulk structure

class
RelaxedInterstitial
(struct_list, energy_list, valence_dict)[source]¶ Bases:
object
Stores the relaxed supercell structures for each interstitial Used to compute formation energies, displacement of atoms near the the interstitial.
Parameters:  struct_list – List of structures(supercells). The first structure should represent relaxed bulk structure and the subsequent ones interstitial structures (with the extra interstitial site appended at the end).
 energy_list – List of energies for relaxed interstitial structures. The first energy should correspond to bulk structure
 valence_dict – Valences of elements in dictionary form

formation_energy
(n, chem_pot=0)[source]¶ Compute the interstitial formation energy
Parameters:  n – Index of interstitials
 chem_pot – Chemical potential of interstitial site element. If not given, assumed as zero. The user is strongly urged to supply the chemical potential value

get_charge_coordination_number
(n)[source]¶ Charge coordination number for nth interstitial.
Parameters: n – Index of interstitials

get_coordinated_bulk_sites
(n)[source]¶ Bulk sites corresponding to the coordinated sites for nth interstitial.
Parameters: n – Index of interstitials

get_coordinated_site_displacement
(n)[source]¶ Compute the total displacement of coordinated sites from the interstitial sites during the relaxation
Parameters: n – Index of defect site

get_coordinated_sites
(n)[source]¶ Coordinated sites for nth interstitial.
Parameters: n – Index of interstitials

get_coordination_number
(n)[source]¶ Coordination number for nth interstitial.
Parameters: n – Index of interstitials

get_defectsite
(n)[source]¶ Returns the defect site of nth interstitial.
Parameters: n – Index of interstitial

get_percentage_bond_distance_change
(n)[source]¶ Bond distance change after the introduction of interstitial.
Parameters: n – index of interstitials

class
StructureMotifInterstitial
(struct, inter_elem, motif_types=('tet', 'oct'), op_threshs=(0.3, 0.5), dl=0.2, doverlap=1.0, facmaxdl=1.01, verbose=False)[source]¶ Bases:
pymatgen.analysis.defects.point_defects.Defect
Generate interstitial sites at positions where the interstitialcy is coordinated by nearest neighbors in a way that resembles basic structure motifs (e.g., tetrahedra, octahedra). The algorithm is called InFiT (Interstitialcy Finding Tool), it was introducted by Nils E. R. Zimmermann, Matthew K. Horton, Anubhav Jain, and Maciej Haranczyk (Front. Mater., 4, 34, 2017), and it is used by the Python Charged Defect Toolkit (PyCDT: D. Broberg et al., Comput. Phys. Commun., in press, 2018).
Generates symmetrically distinct interstitial sites at positions where the interstitial is coordinated by nearest neighbors in a pattern that resembles a supported structure motif (e.g., tetrahedra, octahedra).
Parameters:  struct (Structure) – input structure for which symmetrically distinct interstitial sites are to be found.
 inter_elem (string) – element symbol of desired interstitial.
 motif_types ([string]) – list of structure motif types that are to be considered. Permissible types are: tet (tetrahedron), oct (octahedron).
 op_threshs ([float]) – threshold values for the underlying order parameters to still recognize a given structural motif (i.e., for an OP value >= threshold the coordination pattern match is positive, for OP < threshold the match is negative.
 dl (float) – grid fineness in Angstrom. The input structure is divided into a grid of dimension a/dl x b/dl x c/dl along the three crystallographic directions, with a, b, and c being the lengths of the three lattice vectors of the input unit cell.
 doverlap (float) – distance that is considered to flag an overlap between any trial interstitial site and a host atom.
 facmaxdl (float) – factor to be multiplied with the maximum grid width that is then used as a cutoff distance for the clustering prune step.
 verbose (bool) – flag indicating whether (True) or not (False; default) to print additional information to screen.

enumerate_defectsites
()[source]¶ Get all defect sites.
Returns:  list of periodic sites
 representing the interstitials.
Return type: defect_sites ([PeriodicSite])

get_coordinating_elements_cns
(i)[source]¶ Get elementspecific coordination numbers of defect with index i.
Returns:  dictionary storing the coordination numbers (int)
 with string representation of elements as keys. (i.e., {elem1 (string): cn1 (int), …}).
Return type: elem_cn (dict)

get_motif_type
(i)[source]¶ Get the motif type of defect with index i (e.g., “tet”).
Returns: motif type. Return type: motif (string)

get_op_value
(i)[source]¶ Get orderparameter value of defect with index i.
Returns: OP value. Return type: opval (float)

make_supercells_with_defects
(scaling_matrix)[source]¶ Generate a sequence of supercells in which each supercell contains a single interstitial, except for the first supercell in the sequence which is a copy of the defectfree input structure.
Parameters: scaling_matrix (3x3 integer array) – scaling matrix to transform the lattice vectors. Returns: sequence of supercells. Return type: scs ([Structure])

class
TopographyAnalyzer
(structure, framework_ions, cations, tol=0.0001, max_cell_range=1, check_volume=True, constrained_c_frac=0.5, thickness=0.5)[source]¶ Bases:
object
This is a generalized module to perform topological analyses of a crystal structure using Voronoi tessellations. It can be used for finding potential interstitial sites. Applications including using these sites for inserting additional atoms or for analyzing diffusion pathways.
Note that you typically want to do some preliminary postprocessing after the initial construction. The initial construction will create a lot of points, especially for determining potential insertion sites. Some helper methods are available to perform aggregation and elimination of nodes. A typical use is something like:
a = TopographyAnalyzer(structure, ["O"], ["P"]) a.cluster_nodes() a.remove_collisions()
Init.
Parameters:  structure (Structure) – An initial structure.
 framework_ions ([str]) – A list of ions to be considered as a framework. Typically, this would be all anion species. E.g., [“O”, “S”].
 cations ([str]) – A list of ions to be considered as nonmigrating cations. E.g., if you are looking at Li3PS4 as a Li conductor, Li is a mobile species. Your cations should be [ “P”]. The cations are used to exclude polyhedra from diffusion analysis since those polyhedra are already occupied.
 tol (float) – A tolerance distance for the analysis, used to determine if something are actually periodic boundary images of each other. Default is usually fine.
 max_cell_range (int) – This is the range of periodic images to construct the Voronoi tesselation. A value of 1 means that we include all points from (x + 1, y + 1, z+ 1) in the voronoi construction. This is because the Voronoi poly extends beyond the standard unit cell because of PBC. Typically, the default value of 1 works fine for most structures and is fast. But for really small unit cells with high symmetry, you may need to increase this to 2 or higher.
 check_volume (bool) – Set False when ValueError always happen after tuning tolerance.
 constrained_c_frac (float) – Constraint the region where users want to do Topology analysis the default value is 0.5, which is the fractional coordinate of the cell
 thickness (float) – Along with constrained_c_frac, limit the thickness of the regions where we want to explore. Default is 0.5, which is mapping all the site of the unit cell.

cluster_nodes
(tol=0.2)[source]¶ Cluster nodes that are too close together using a tol.
Parameters: tol (float) – A distance tolerance. PBC is taken into account.

get_structure_with_nodes
()[source]¶ Get the modified structure with the voronoi nodes inserted. The species is set as a DummySpecie X.

class
Vacancy
(structure, valences, radii)[source]¶ Bases:
pymatgen.analysis.defects.point_defects.Defect
Subclass of Defect to generate vacancies and their analysis.
Parameters:  structure – pymatgen.core.structure.Structure
 valences – valences of elements as a dictionary
 radii – Radii of elements as a dictionary

get_coordsites_min_max_charge
(n)[source]¶ Minimum and maximum charge of sites surrounding the vacancy site.
Parameters: n – Index of vacancy list

get_defectsite_effective_charge
(n)[source]¶ Effective charge (In KrogerVink notation, cation vacancy has effectively ve charge and anion vacancy has +ve charge.)
Parameters: n – Index of vacancy list Returns: Effective charnge of defect site

get_defectsite_structure_index
(n)[source]¶ index of the vacacy site in the structure.sites list
Parameters: n – Index of vacancy list

get_surface_area
(n)[source]¶ Surface area of the nth vacancy
Parameters: n – Index of symmetrically distinct vacancies list Returns: floating number representing volume of vacancy

get_volume
(n)[source]¶ Volume of the nth vacancy
Parameters: n – Index of symmetrically distinct vacancies list Returns: floating number representing volume of vacancy

make_supercells_with_defects
(scaling_matrix, species=None, limit_return_structures=False)[source]¶ Generate sequence of supercells in pymatgen.core.structure.Structure format, with each supercell containing one vacancy.
Parameters:  scaling_matrix – super cell scale parameters in matrix forms
 species – Species in list format only for which vacancy supercells are required. If not specified all the species are considered.
 limit_return_structures – Boolean or positive number If number, only that many structures are returned.
Returns: Supercells with vacancies. First supercell has no defects.

class
VacancyFormationEnergy
(vacancy)[source]¶ Bases:
object
Using GULP compute the vacancy formation energy. Works only for binary metal oxides due to the use of Buckingham Potentials

class
VoronoiPolyhedron
(lattice, frac_coords, polyhedron_indices, all_coords, name=None)[source]¶ Bases:
object
Convenience container for a voronoi point in PBC and its associated polyhedron.

coordination
¶

volume
¶


symmetry_reduced_voronoi_nodes
(structure, rad_dict, high_accuracy_flag=False, symm_flag=True)[source]¶ Obtain symmetry reduced voronoi nodes using Zeo++ and pymatgen.symmetry.finder.SpacegroupAnalyzer
Parameters:  strucutre – pymatgen Structure object
 rad_dict – Dictionary containing radii of spcies in the structure
 high_accuracy_flag – Flag denotting whether to use high accuracy version of Zeo++
 symm_flag – Flag denoting whether to return symmetrically distinct sites only
Returns: Symmetrically distinct voronoi nodes as pymatgen Strucutre