reaction_graph()
The reaction graph of two index-aligned graphs (same symbols, charge and spin).
Usage
reaction_graph(reactant: StereoMolGraph, product: StereoMolGraph) -> StereoReactionGraph
reaction_graph(reactant: MolGraph, product: MolGraph) -> ReactionGraphBonds only in the reactant are breaking, and bonds only in the product are forming. Equal LS stay unchanged (atom_stereo, bond_stereo); others become a StereoChange(reactant=, product=, ts=) in stereo_changes, with its ts slot empty: the TS-slot rules are the scheme’s (P84), so low_t sets them.
>>> r = MolGraph(symbols=["H", "H", "H"], bonds=[(0, 1)])
>>> p = MolGraph(symbols=["H", "H", "H"], bonds=[(1, 2)])
>>> g = reaction_graph(r, p)
>>> g.bonds, g.breaking, g.forming(((0, 1), (1, 2)), ((0, 1),), ((1, 2),))
Raises
TypeError-
If the two graphs are not both MolGraphs or both StereoMolGraphs.
GraphError- If their symbols, charge or spin differ.