MigrationGraphDoc

class emmet.core.mobility.migrationgraph.MigrationGraphDoc(**data)

Bases: EmmetBaseModel

MigrationGraph Doc. Stores MigrationGraph and info such as ComputedStructureEntries (ComputedEntry can be used for working ion) and cutoff distance that are used to generated the object.

Note: this doc is not self-contained within pymatgen, as it has dependence on pymatgen.analysis.diffusion, a namespace package aka pymatgen-diffusion.

Parameters:
  • builder_meta (EmmetMeta | None)

  • battery_id (str | None)

  • last_updated (Annotated[datetime, BeforeValidator(func=~emmet.core.utils.convert_datetime, json_schema_input_type=PydanticUndefined)])

  • warnings (list[str])

  • deprecated (bool)

  • hop_cutoff (float | None)

  • entries_for_generation (list[ComputedStructureEntry] | None)

  • working_ion_entry (ComputedEntry | ComputedStructureEntry | None)

  • migration_graph (MigrationGraph | None)

  • populate_sc_fields (bool)

  • sc_gen_schema (str | None)

  • min_length_sc (float | None)

  • minmax_num_atoms (tuple[int, int] | None)

  • matrix_supercell_structure (Structure | None)

  • conversion_matrix (list[list[int | float]] | None)

  • inserted_ion_coords (list[dict[str, list[float] | str | int]] | None)

  • insert_coords_combo (list[str] | None)

  • paths_summary (dict[int, list[HopSummary]] | None)

  • migration_graph_w_cost (MigrationGraph | None)

classmethod from_entries_and_distance(battery_id, grouped_entries, working_ion_entry, hop_cutoff, populate_sc_fields=True, sc_gen_schema='complete', ltol=0.2, stol=0.3, angle_tol=5, min_length_sc=None, minmax_num_atoms=None, **kwargs)

Take a list of ComputedStructureEntry and generate a MigrationGraphDoc.

Note: Can use a ComputedEntry for the working ion.

Then a MigrationGraph object is generated with with_distance() method with a designated cutoff. If populate_sc_fields set to True, this method will populate the supercell related fields. Required kwargs are min_length_sc and minmax_num_atoms.

Return type:

Self

Parameters:
  • battery_id (str)

  • grouped_entries (list[ComputedStructureEntry])

  • working_ion_entry (ComputedEntry | ComputedStructureEntry)

  • hop_cutoff (float)

  • populate_sc_fields (bool)

  • sc_gen_schema (Literal['complete', 'hops_only'])

  • ltol (float)

  • stol (float)

  • angle_tol (float)

  • min_length_sc (float | None)

  • minmax_num_atoms (tuple[int, int] | None)

classmethod augment_from_mgd_and_npr(mgd, npr, barrier_type)

Takes an existing MigrationGraphDoc and augment it.

Specifically, the paths_summary and migration_graph_w_cost fields will be populated with transition state data from NebPathwayResult.

barrier_type can be set to ‘barrier’ or ‘energy_range’. See docstring of get_paths_summary_with_neb_res for detail.

Return type:

Self

Parameters:
static get_distinct_hop_sites(inserted_ion_coords, insert_coords_combo)

Expand the list of inserted coordinates and hop indices.

Return type:

tuple[list[list[float]], list[str], dict[str, str]]

Parameters:
  • inserted_ion_coords (list[dict[str, list[float]]])

  • insert_coords_combo (list[str])

Parameters

inserted_ion_coords: list[dict[str, list[float]]]

List of dict’s containing the working ion coordinates.

insert_coords_combo: list[str]

List of hop indices of the form “<int>+<int>”

Returns

list of list of float

List of working ion coordinates

list of str

List of hop keys

dict of str to str

Dict mapping of hop keys in different formats

static get_paths_summary_with_neb_res(mg, npr, barrier_type, zero_short_hop_cost=True, verbose=False)

This is a post-processing function that matches the results of transition state cals (NEB or ApproxNEB) and unique_hops in the MigrationGraph, and then outputs a ranked list according to the calculated barrier

Return type:

tuple[dict[int, list[HopSummary]], MigrationGraph]

Parameters:
  • mg (MigrationGraph)

  • npr (NebPathwayResult)

  • barrier_type (Literal['max_barrier', 'energy_range'])

  • zero_short_hop_cost (bool)

  • verbose (bool)

Parameters

mgd: MigrationGraph

The MigrationGraph to be matched and get paths from

npr: NebPathwayResult

The doc used to get transition state calc info

barrier_type: str

The type of barrier used to assign cost. Currently supporting ‘barrier’: max of forward & reverse barrier (max energy - ep energy) ‘energy_range’: max of energies - min of energies

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].