openmaterials.ai / codes / reaction-network
reaction-network: reaction pathways through a graph of solid-state reactions
Builds a weighted graph of balanced reactions among phases from thermochemistry data and searches it for low-cost multi-step routes to a target phase.
What it is and how it works
Phase space as a graph
Nodes are combinations of up to n phases, and edges are balanced reactions weighted by a softplus cost of the Gibbs energy per reactant atom. The C-Cl-Li-Mn-O-Y network had 5855 nodes and 121,176 edges (McDermott 2021).
Thermochemistry inputs
Formation enthalpies from the Materials Project, Gibbs energies from the Bartel descriptor, elemental G from FactSage, gases and A2CO3 from NIST-JANAF (McDermott 2021).
Softplus cost
C = ln(1 + exp((273 K / T) dG)) maps dG per reactant atom to a positive weight, so exergonic steps are cheap and endergonic steps stay possible (McDermott 2021).
Pathfinding
Yen's k shortest paths on Dijkstra, crossover reactions among intermediates from the phase diagram, then mass-balanced combinations via a pseudoinverse (McDermott 2021).
Filters
The code removes phases above a hull cutoff, interdependent steps and hypothetical intermediates. n = 2 reacting phases keeps the combinatorics in check (McDermott 2021).
Selectivity metrics
Later versions rank single reactions by primary competition among the precursors and secondary competition with the target (McDermott 2023).
What people do with it
- 121,176edges in the C-Cl-Li-Mn-O-Y networkMcDermott 2021
- 82985BaTiO3 synthesis reactions enumerated and rankedMcDermott 2023
- 3,017reactions forming Y2Mn2O7 in a 13-element spaceTodd 2021
Why Na2CO3 selects Y2Mn2O7
Among 3,017 reactions forming Y2Mn2O7 at 650 C, 2 NaMnO2 + 2 YOCl + 1/2 O2 sits on the Pareto front. Its chemical potential distance is 0.055 eV/atom against 1.608 (Li) and 0.924 (K). Todd 2021
Selectivity of BaTiO3 synthesis routes
From 2,536,160 binary reactions among 2417 phases, 82985 BaTiO3 routes were ranked and 9 tested. Metathesis routes gave mainly BaTiO3 at 600 to 700 C. BaCO3 + TiO2 was incomplete at 1000 C. McDermott 2023
How it is used
Choose the system
Target, precursors, temperature, energy above hull cutoff and any open element such as O2.
Build the network
Phases from the Materials Project get Gibbs energies, reactions are balanced and weighted.
Find paths
k shortest paths to each target, crossover reactions, balanced combinations of steps.
Inspect the ranking
Several low-cost pathways are listed. Compare them with in situ diffraction.
What reaction-network is
reaction-network builds a graph of possible reactions between phases and searches it for pathways to a target material, ranking them by thermodynamic cost. It is used to plan solid-state synthesis. On the map it serves the reaction quantities it computes.
WebsiteRepositoryOn the mapAll codesLicense: modified BSD (BSD-3-Clause)
In more detail
Network model and cost function
Every combination of distinct phases up to size n becomes a reactants node and a products node, and a directed edge joins two nodes whenever a stoichiometrically balanced reaction exists between them. Zero-weight edges loop products back into reactant nodes that contain them, so multi-step pathways appear as walks, and a precursors node and a target node bound the search. Raw Gibbs energies do not work as weights. Negative values create infinite cycles for Dijkstra, kinetic heuristics are excluded, and molar energies scale with stoichiometry. The softplus C = ln(1 + exp((273 K / T) dG)), dG per reactant atom, was chosen over ReLU and piecewise-linear forms (McDermott 2021).
Pathfinding, combinatorics and filters
Yen's algorithm yields k shortest loopless paths to each target from Dijkstra's first path, and pathfinding runs separately toward each product, including byproducts such as CO2. Crossover reactions among the intermediates are computed combinatorially and from the compositional phase diagram, which admits open elements through a grand potential. Steps are combined by solving A m = c with the Moore-Penrose pseudoinverse in SciPy, the total cost is the multiplicity-weighted mean, and interdependent step pairs are consolidated. For N = 76 phases the reaction count grows from about 5.78e3 at n = 1 to 8.56e6 at n = 2 and 5.36e9 at n = 3, so the authors recommend n = 2 (McDermott 2021).
Validation on reported syntheses
For YMnO3 by Li-assisted metathesis the network at 900 K with a 30 meV/atom hull filter gave 20 pathways, and paths 2 and 3 match the observed route through YOCl + LiMnO2, with YOCl, Y3O4Cl, Y2O3 and LiMnO2 all seen in situ. For Fe2SiS4 from iron silicides path 14 is the lowest-cost route containing all observed intermediates FeS2, FeSi and SiS2. For YBa2Cu3O6.5 from BaO2, BaCuO2 appears in 7 of the top 10 paths. For the unsynthesized cathode MgMo3(PO4)3O a network of 21,564 entries and 660,909 nodes produced 2,270 reactions, 186 after a metathesis filter (McDermott 2021).
Dependencies and later versions
Phase diagrams and reaction balancing run on pymatgen, graphs on graph-tool, with Materials Project data version 2020.09.08 (McDermott 2021). Todd 2021 implemented reaction enumeration and ranking by grand potential energy plus total chemical potential distance in the same package, enumerating 3,017 Y2Mn2O7 reactions from 2,878 phases stable at 650 C. McDermott 2023 added a jobflow synthesis planning workflow to the package at materialsproject/reaction-network, with Materials Project version 2022.10.28, a 0.830 eV per CO3 correction for carbonates and selectivity metrics tested on 3520 text-mined literature reactions, of which 82.8% have negative reaction energy.
What it computes on the map
1 quantity, drawn by tier with the data flow between them. Dashed boxes are intermediate quantities. Select one for its formula and the other codes that compute it.
Embed this submap
<iframe src="https://openmaterials.ai/m/c56731602651/00000000000000000008?embed=1" title="reaction-network on the OpenMaterials map" width="100%" height="480" loading="lazy" style="border:1px solid #EBEBEB;border-radius:6px"></iframe>
Each quantity with the interface the representation records.
- ReactionEnergyComputedReaction.energy (total eV) / .energy_per_atom (eV/atom) (reactions/computed.py:104-145)ev
References
The code
The papers that describe the code; cite them when you use it.
- M. J. McDermott, S. S. Dwaraknath, K. A. Persson, A graph-based network for predicting chemical reaction pathways in solid-state materials synthesis, Nature Communications, 2021. doi.org/10.1038/s41467-021-23339-x
Applications
Highly cited studies that cite the code, with a few picked by hand.
- P. K. Todd, M. J. McDermott, C. L. Rom et al., Selectivity in Yttrium Manganese Oxide Synthesis via Local Chemical Potentials in Hyperdimensional Phase Space, Journal of the American Chemical Society, 2021. doi.org/10.1021/jacs.1c06229
- M. J. McDermott, B. C. McBride, C. E. Regier et al., Assessing Thermodynamic Selectivity of Solid-State Reactions for the Predictive Synthesis of Inorganic Materials, ACS Central Science, 2023. doi.org/10.1021/acscentsci.3c01051
How to cite
M. J. McDermott, S. S. Dwaraknath, K. A. Persson, A graph-based network for predicting chemical reaction pathways in solid-state materials synthesis, Nat. Commun. 12, 3097 (2021)