pymatgen.transformations.advanced_transformations module¶

class
ChargeBalanceTransformation
(charge_balance_sp)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
This is a transformation that disorders a structure to make it charge balanced, given an oxidation statedecorated structure.
Parameters: charge_balance_sp – specie to add or remove. Currently only removal is supported 
inverse
¶

is_one_to_many
¶


class
DopingTransformation
(dopant, ionic_radius_tol=inf, min_length=10, alio_tol=0, codopant=False, max_structures_per_enum=100, allowed_doping_species=None, **kwargs)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
A transformation that performs doping of a structure.
Parameters:  dopant (Specielike) – E.g., Al3+. Must have oxidation state.
 ionic_radius_tol (float) – E.g., Fractional allowable ionic radii mismatch for dopant to fit into a site. Default of inf means that any dopant with the right oxidation state is allowed.
 min_Length (float) – Min. lattice parameter between periodic images of dopant. Defaults to 10A for now.
 alio_tol (int) – If this is not 0, attempt will be made to dope sites with oxidation_states + alio_tol of the dopant. E.g., 1 means that the ions like Ca2+ and Ti4+ are considered as potential doping sites for Al3+.
 codopant (bool) – If True, doping will be carried out with a codopant to maintain charge neutrality. Otherwise, vacancies will be used.
 max_structures_per_enum (float) – Maximum number of structures to return per enumeration. Note that there can be more than one candidate doping site, and each site enumeration will return at max max_structures_per_enum structures. Defaults to 100.
 allowed_doping_species (list) – Species that are allowed to be doping sites. This is an inclusionary list. If specified, any sites which are not
 **kwargs – Same keyword args as
EnumerateStructureTransformation
, i.e., min_cell_size, etc.

apply_transformation
(structure, return_ranked_list=False)[source]¶ Parameters: structure (Structure) – Input structure to dope Returns: Structure, “energy”: float}] Return type: [{“structure”

inverse
¶

is_one_to_many
¶

class
EnumerateStructureTransformation
(min_cell_size=1, max_cell_size=1, symm_prec=0.1, occu_tol=None, refine_structure=False, enum_precision_parameter=0.001, check_ordered_symmetry=True)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
Order a disordered structure using enumlib. For complete orderings, this generally produces fewer structures that the OrderDisorderedStructure transformation, and at a much faster speed.
Parameters:  min_cell_size (int) – The minimum cell size wanted. Must be an int. Defaults to 1.
 max_cell_size (int) – The maximum cell size wanted. Must be an int. Defaults to 1.
 symm_prec (float) – Tolerance to use for symmetry detection. Defaults to 0.1.
 occu_tol (int) – If set, the code will first round and scale occupancies to the nearest rational number, with maximum denominator = occu_tol. This handles structures that contain partial occupancies that are close to a rational number. E.g., sometimes the reported occupancy is 0.249, and if occu_tol is set to 4, this will be rounded to 0.25.
 refine_structure (bool) – This parameter has the same meaning as in enumlib_caller. If you are starting from a structure that has been relaxed via some electronic structure code, it is usually much better to start with symmetry determination and then obtain a refined structure. The refined structure have cell parameters and atomic positions shifted to the expected symmetry positions, which makes it much less sensitive precision issues in enumlib. If you are already starting from an experimental cif, refinement should have already been done and it is not necessary. Defaults to False.
 enum_precision_parameter (float) – Finite precision parameter for enumlib. Default of 0.001 is usually ok, but you might need to tweak it for certain cells.
 check_ordered_symmetry (bool) – Whether to check the symmetry of the ordered sites. If the symmetry of the ordered sites is lower, the lowest symmetry ordered sites is included in the enumeration. This is important if the ordered sites break symmetry in a way that is important getting possible structures. But sometimes including ordered sites slows down enumeration to the point that it cannot be completed. Switch to False in those cases. Defaults to True.

apply_transformation
(structure, return_ranked_list=False)[source]¶ Return either a single ordered structure or a sequence of all ordered structures.
Parameters:  structure – Structure to order.
 return_ranked_list (bool) – Whether or not multiple structures are returned. If return_ranked_list is a number, that number of structures is returned.
Returns: Depending on returned_ranked list, either a transformed structure or a list of dictionaries, where each dictionary is of the form {“structure” = …. , “other_arguments”}
The list of ordered structures is ranked by ewald energy / atom, if the input structure is an oxidation state decorated structure. Otherwise, it is ranked by number of sites, with smallest number of sites first.

inverse
¶

is_one_to_many
¶

class
MagOrderingTransformation
(mag_species_spin, order_parameter=0.5, energy_model=<pymatgen.analysis.energy_models.SymmetryModel object>, **kwargs)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
This transformation takes a structure and returns a list of magnetic orderings. Currently only works for ordered structures.
Parameters:  mag_elements_spin – A mapping of elements/species to magnetically order to spin magnitudes. E.g., {“Fe3+”: 5, “Mn3+”: 4}
 order_parameter – degree of magnetization. 0.5 corresponds to antiferromagnetic order
 energy_model – Energy model used to rank the structures. Some models are
provided in
pymatgen.analysis.energy_models
.  **kwargs – Same keyword args as
EnumerateStructureTransformation
, i.e., min_cell_size, etc.

classmethod
determine_min_cell
(structure, mag_species_spin, order_parameter)[source]¶ Determine the smallest supercell that is able to enumerate the provided structure with the given order parameter

inverse
¶

is_one_to_many
¶

class
MultipleSubstitutionTransformation
(sp_to_replace, r_fraction, substitution_dict, charge_balance_species=None, order=True)[source]¶ Bases:
object
Performs multiple substitutions on a structure. For example, can do a fractional replacement of Ge in LiGePS with a list of species, creating one structure for each substitution. Ordering is done using a dummy element so only one ordering must be done per substitution oxidation state. Charge balancing of the structure is optionally performed.
Note
There are no checks to make sure that removal fractions are possible and rounding may occur. Currently charge balancing only works for removal of species.
Performs multiple fractional substitutions on a transmuter.
Parameters:  sp_to_replace – species to be replaced
 r_fraction – fraction of that specie to replace
 substitution_dict – dictionary of the format {2: [“Mg”, “Ti”, “V”, “As”, “Cr”, “Ta”, “N”, “Nb”], 3: [“Ru”, “Fe”, “Co”, “Ce”, “As”, “Cr”, “Ta”, “N”, “Nb”], 4: [“Ru”, “V”, “Cr”, “Ta”, “N”, “Nb”], 5: [“Ru”, “W”, “Mn”] } The number is the charge used for each of the list of elements (an element can be present in multiple lists)
 charge_balance_species – If specified, will balance the charge on the structure using that specie.

inverse
¶

is_one_to_many
¶

class
SlabTransformation
(miller_index, min_slab_size, min_vacuum_size, lll_reduce=False, center_slab=False, primitive=True, max_normal_search=None, shift=0, tol=0.1)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
A transformation that creates a slab from a structure.
Parameters:  miller_index (3tuple or list) – miller index of slab
 min_slab_size (float) – minimum slab size in angstroms
 min_vacuum_size (float) – minimum size of vacuum
 lll_reduce (bool) – whether to apply LLL reduction
 center_slab (bool) – whether to center the slab
 primitive (bool) – whether to reduce slabs to most primitive cell
 max_normal_search (int) – maximum index to include in linear combinations of indices to find c lattice vector orthogonal to slab surface
 shift (float) – shift to get termination
 tol (float) – tolerance for primitive cell finding

inverse
¶

is_one_to_many
¶

class
SubstitutionPredictorTransformation
(threshold=0.01, **kwargs)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
This transformation takes a structure and uses the structure prediction module to find likely site substitutions.
Parameters:  threshold – Threshold for substitution.
 **kwargs – Args for SubstitutionProbability class lambda_table, alpha

inverse
¶

is_one_to_many
¶

class
SuperTransformation
(transformations, nstructures_per_trans=1)[source]¶ Bases:
pymatgen.transformations.transformation_abc.AbstractTransformation
This is a transformation that is inherently onetomany. It is constructed from a list of transformations and returns one structure for each transformation. The primary use for this class is extending a transmuter object.
Parameters:  transformations ([transformations]) – List of transformations to apply to a structure. One transformation is applied to each output structure.
 nstructures_per_trans (int) – If the transformations are onetomany and, nstructures_per_trans structures from each transformation are added to the full list. Defaults to 1, i.e., only best structure.

inverse
¶

is_one_to_many
¶