rxn_network.thermo#

rxn_network.thermo.chempot_diagram#

This module implements added features to the ChemicalPotentialDiagram class from pymatgen.

class rxn_network.thermo.chempot_diagram.ChemicalPotentialDiagram(entries, limits=None, default_min_limit=-100.0)[source]#

Bases: ChemicalPotentialDiagram

This class is an extension of the ChemicalPotentialDiagram class from pymatgen. Several features have been added to the original class for the purpose of efficiently calculating the shortest distance between two chemical potential domains.

For more information on this specific implementation of the algorithm, please cite/reference the paper below:

Todd, P. K., McDermott, M. J., Rom, C. L., Corrao, A. A., Denney, J. J., Dwaraknath, S. S., Khalifah, P. G., Persson, K. A., & Neilson, J. R. (2021). Selectivity in Yttrium Manganese Oxide Synthesis via Local Chemical Potentials in Hyperdimensional Phase Space. Journal of the American Chemical Society, 143(37), 15185-15194. https://doi.org/10.1021/jacs.1c06229

Initialize a ChemicalPotentialDiagram object.

Parameters:
  • entries (list[PDEntry]) – List of PDEntry-like objects containing a composition and energy. Must contain elemental references and be suitable for typical phase diagram construction. Entries must be within a chemical system with 2 or more elements.

  • limits (dict[Element, float] | None) – Bounds of elemental chemical potentials (min, max), which are used to construct the border hyperplanes used in the HalfspaceIntersection algorithm; these constrain the space over which the domains are calculated and also determine the size of the plotted diagram. Any elemental limits not specified are covered in the default_min_limit argument.

  • default_min_limit (float) – Default minimum chemical potential limit for unspecified elements within the “limits” argument. This results in default limits of (-100, 0).

shortest_domain_distance(f1, f2, offset=0.0)[source]#

Returns the chemical potential distance between two phase domains. Also works for metastable phases (see metastable_domains property).

Parameters:
  • f1 (str) – chemical formula of phase 1

  • f2 (str) – chemical formula of phase 2

  • offset (float) – an optional offset (eV/atom) to add to the calculated distance. See get_offset() method.

Returns:

Shortest distance between domain boundaries in the full (hyper)dimensional space, calculated using KDTree.

Return type:

float

get_offset(entry)[source]#

For a given entry, returns the distance between its hyperplane and the surface of the chemical potential diagram. This allows one to represent the energy above hull in chemical potential space. Returns zero for stable entries.

Parameters:

entry (PDEntry) – A stable or metastable entry within the chemical potential diagram

Returns:

Offset in chemical potential distance (eV/atom)

Return type:

float

property domains: dict[str, ndarray]#

Mapping of formulas to array of domain boundary points. Cached for quicker calculations.

property metastable_domains: dict[str, ndarray]#

Gets a dictionary of the chemical potential domains for metastable chemical formulas. This corresponds to the domains of the relevant phases if they were just barely thermodynamically stable (on the hull).

property hs_int: HalfspaceIntersection#

Returns the scipy HalfSpaceIntersection object used to calculate all domains.

rxn_network.thermo.utils#

Utility functions used in the thermodynamic analysis classes.

rxn_network.thermo.utils.expand_pd(entries, pbar=False)[source]#

Helper method for generating a set of smaller phase diagrams for analyzing thermodynamic stability in large chemical systems. This is necessary when considering chemical systems which contain 10 or more elements, due to dimensional limitations of the Qhull algorithm.

Parameters:
  • entries ([Entry]) – list of Entry objects for building phase diagram.

  • pbar (bool) – whether to show a progress bar.

Returns:

Dictionary of PhaseDiagram objects indexed by chemical subsystem string; e.g. {“Li-Mn-O”: <PhaseDiagram object>, “C-Y”: <PhaseDiagram object>, …}

Return type:

dict[str, PhaseDiagram]