pymatgen.analysis.diffusion.utils.parse_entries module¶
Functions for combining many ComputedEntry objects into MigrationGraph objects.
- get_inserted_on_base(base_ent: ComputedStructureEntry, inserted_ent: ComputedStructureEntry, migrating_ion_entry: ComputedEntry, sm: StructureMatcher) Structure | None [source]¶
For a structured-matched pair of base and inserted entries, map all of the Li positions in the inserted entry to positions in the base entry and return a new structure where all the sites are decorated with the insertion energy. Since the calculation of the insertion energy needs the energy of the metallic working ion, a migrating_ion_entry must also be provided.
- Parameters:
base_ent – The entry for the host structure
inserted_ent – The entry for the inserted structure
migrating_ion_entry – The entry containing the migrating ion
sm – StructureMatcher object used to obtain the mapping
- Returns:
List of entries for each working ion in the list of
- get_insertion_energy(base_entry: ComputedStructureEntry, inserted_entry: ComputedStructureEntry, migrating_ion_entry: ComputedEntry) float [source]¶
Calculate the insertion energy for a given inserted entry :param base_entry: The entry for the host structure :param inserted_entry: The entry for the inserted structure :param migrating_ion_entry: The entry for the metallic phase of the working ion
- Returns:
- insertion energy defined as
(E[inserted] - (E[Base] + n * E[working_ion])) / n
Where n is the number of working ions and E[inserted]. Additionally, and E[base] and E[inserted] are for structures of the same size (sans working ion).
- Return type:
float
- get_matched_structure_mapping(base: Structure, inserted: Structure, sm: StructureMatcher)[source]¶
Get the mapping from the inserted structure onto the base structure, assuming that the inserted structure sans the working ion is some kind of SC of the base.
- Parameters:
base – host structure, smaller cell
inserted – bigger cell
sm – StructureMatcher instance
- Returns:
supercell matrix to apply to s1 to get s2 total-t : translation to apply on s1 * sc_m to get s2
- Return type:
sc_m
- get_sym_migration_ion_sites(base_struct: Structure, inserted_struct: Structure, migrating_ion: str, symprec: float = 0.01, angle_tol: float = 5.0) Structure [source]¶
Take one inserted entry then map out all symmetry equivalent copies of the cation sites in base entry. Each site is decorated with the insertion energy calculated from the base and inserted entries.
- Parameters:
base_struct – the base structure.
inserted_struct – inserted structure.
migrating_ion – Ion that migrates.
symprec – the symprec tolerance for the space group analysis
angle_tol – the angle tolerance for the space group analysis
- Returns:
Structure with only the migrating ion sites decorated with insertion energies.
- process_entries(base_entries: list[ComputedStructureEntry], inserted_entries: list[ComputedStructureEntry], migrating_ion_entry: ComputedEntry, symprec: float = 0.01, ltol: float = 0.2, stol: float = 0.3, angle_tol: float = 5.0) list[dict] [source]¶
Process a list of base entries and inserted entries to create input for migration path analysis Each inserted entries can be mapped to more than one base entry. Return groups of structures decorated with the working ions to indicate the metastable sites, ranked by the number of working ion sites (highest number is the first).
- Parameters:
base_entries – Full list of base entries
inserted_entries – Full list of inserted entries
migrating_ion_entry – The metallic phase of the working ion, used to calculate insertion energies.
symprec – symmetry parameter for SpacegroupAnalyzer
ltol – Fractional length tolerance for StructureMatcher
stol – Site tolerance for StructureMatcher
angle_tol – Angle tolerance for StructureMatcher and SpacegroupAnalyzer
only_single_cat – If True, only use single cation insertions so the site energy is more accurate use_strict_tol: halve the ltol and stol parameter for more strict matching.
- Returns:
- List of dictionaries that each contain {‘base’: Structure Object of host,
’inserted’: Structure object of all inserted sites}
- Return type:
list