rxn_network.flows#

Core flows for the reaction-network package.

class rxn_network.flows.core.SynthesisPlanningFlowMaker(name='synthesis_planning', get_entry_set_maker=<factory>, enumeration_maker=<factory>, calculate_competition_maker=<factory>, open_elem=None, chempots=None, use_basic_enumerators=True, use_minimize_enumerators=True, basic_enumerator_kwargs=<factory>, minimize_enumerator_kwargs=<factory>)[source]#

Bases: Maker

Maker to create an inorganic synthesis planning workflow. This flow has three stages.

Steps:
  1. Entries are acquired via GetEntrySetMaker. This job both gets the computed entries from a databse (e.g., Materials Project) and processes them for use in the reaction network.

  2. Reactions are enumerated via the provided ReactionEnumerationMaker (and associated enumerators). This computes the full reaction network so that selectivities can be calculated.

  3. The competition of all synthesis reactions to the desired target is assessed via the CalculateCompetitionMaker.

This flow also has the option to include an “open” element and a list of chempots. This will enumerate reactions at different conditions and evaluate their selectivities at those conditinons.

This flow does not produce a specific output document. Instead, it is convenient to analyze output documents from each of the jobs in the flow based on the desired analysis. For the final “results”, one should access the reaction set produced by the CalculateCompetitionMaker at the conditions of interest.

If you use this code in your work, please cite the following work:

McDermott, M. J. et al. Assessing Thermodynamic Selectivity of Solid-State Reactions for the Predictive Synthesis of Inorganic Materials. ACS Cent. Sci. (2023) doi:10.1021/acscentsci.3c01051.

Parameters:
  • name (str) – Name of the flow. Automatically generated if not provided.

  • get_entry_set_maker (GetEntrySetMaker) – `GetEntrySetMaker`used to create the job for acquiring entries. Automatically generated with default settings if not provided.

  • enumeration_maker (ReactionEnumerationMaker) – ReactionEnumerationMaker used to create the reaction enumeration job. Automatically generated with default settings if not provided.

  • calculate_competition_maker (CalculateCompetitionMaker) – CalculateCompetitionMaker used to create the selectivity analysis job. Automatically generated with default settings if not provided.

  • open_elem (Element | str | None) – Optional element to use as the “open” element. If provided, the flow will enumerate reactions at different chemical potentials of this element.

  • chempots (list[float] | None) – List of chemical potentials to use for the “open” element. If provided, the flow will enumerate reactions at different chemical potentials of this element.

  • use_basic_enumerators (bool) – Whether to use the BasicEnumerator and BasicOpenEnumerator enumerators in the enumeration job.

  • use_minimize_enumerators (bool) – Whether to use the MinimizeGibbsEnumerator and the MinimizeGrandPotentialEnumerator enumerators in the enumeration job.

  • basic_enumerator_kwargs (dict) – Keyword arguments to pass to the basic enumerators.

  • minimize_enumerator_kwargs (dict) – Keyword arguments to pass to the minimize enumerators.

make(target_formula, added_elems=None, entries=None)[source]#

Returns a flow used for planning optimal synthesis recipes to a specified target.

Parameters:
  • target_formula (str) – The chemical formula of a target phase (e.g., “BaTiO3”).

  • added_elems (Collection[str] | None) – An optional list of additional elements to consider (e.g., [“C”, “H”]). Defaults to None.

  • entries (GibbsEntrySet | None) – An optional provided set of entries to enumerate from. If entries are not provided, then they will be acquired from a database (e.g., Materials Project) and processed using the GetEntrySetMaker.

class rxn_network.flows.core.NetworkFlowMaker(name='find_reaction_pathways', get_entry_set_maker=<factory>, enumeration_maker=<factory>, network_maker=<factory>, solver_maker=None, open_elem=None, chempots=None, use_basic_enumerators=True, use_minimize_enumerators=True, basic_enumerator_kwargs=<factory>, minimize_enumerator_kwargs=<factory>)[source]#

Bases: Maker

Maker to create a chemical reaction network and perform (balanced) pathfinding on the network.

This flow has four stages:

  1. Entries are acquired via GetEntrySetMaker. This job both gets the computed entries from a databse (e.g., Materials Project) and processes them for use in the reaction network.

  2. Reactions are enumerated via the provided ReactionEnumerationMaker (and associated enumerators).

  3. The network is created using NetworkMaker and basic paths are found (k-shortest paths to each target).

  4. The final balanced reaction pathways are produced using the SolverMaker.

If you use this code in your own work, please consider citing this paper:

McDermott, M. J.; Dwaraknath, S. S.; Persson, K. A. A Graph-Based Network for Predicting Chemical Reaction Pathways in Solid-State Materials Synthesis. Nature Communications 2021, 12 (1), 3097. https://doi.org/10.1038/s41467-021-23339-x.

Parameters:
  • name (str) – The name of the network flow. Automatically assigned if not provided.

  • get_entry_set_maker (GetEntrySetMaker) – `GetEntrySetMaker`used to create the job for acquiring entries. Automatically generated with default settings if not provided.

  • enumeration_maker (ReactionEnumerationMaker) – ReactionEnumerationMaker used to create the reaction enumeration job. Automatically generated with default settings if not provided.

  • network_maker (NetworkMaker) – NetworkMaker used to create the reaction network from sets of reactions. Also identifies basic reaction pathways. Automatically generated with default settings if not provided.

  • solver_maker (PathwaySolverMaker | None) – PathwaySolverMaker used to find balanced reaction pathways from set of pathways emerging from pathfinding. Automatically generated with default settings if not provided.

  • open_elem (Element | None) – Optional element to use as the “open” element. If provided, the flow will enumerate reactions at different chemical potentials of this element.

  • chempots (list[float] | None) – List of chemical potentials to use for the “open” element. If provided, the flow will enumerate reactions at different chemical potentials of this element.

  • use_basic_enumerators (bool) – Whether to use the BasicEnumerator and BasicOpenEnumerator enumerators in the enumeration job.

  • use_minimize_enumerators (bool) – Whether to use the MinimizeGibbsEnumerator and the MinimizeGrandPotentialEnumerator enumerators in the enumeration job.

  • basic_enumerator_kwargs (dict) – Keyword arguments to pass to the basic enumerators.

  • minimize_enumerator_kwargs (dict) – Keyword arguments to pass to the minimize enumerators.

make(precursors, targets, entries=None)[source]#

Returns a flow used for finding reaction pathways between precursors and targets.

Parameters:
  • precursors (Iterable[str]) – precursor formulas

  • targets (Iterable[str]) – target formulas

  • entries (GibbsEntrySet | None) – Optional entry set. If not provided, entries will be automatically acquired from Materials Project. Defaults to None.

Returns:

_description_