## reaction_graph()


The reaction graph of two index-aligned graphs (same symbols, charge and spin).


Usage

``` python
reaction_graph(reactant: StereoMolGraph, product: StereoMolGraph) -> StereoReactionGraph
 
reaction_graph(reactant: MolGraph, product: MolGraph) -> ReactionGraph
```


Bonds 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](low_t.md#protomol.low_t) sets them.

``` python
>>> 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 [MolGraph](MolGraph.md#protomol.MolGraph)s or both [StereoMolGraph](StereoMolGraph.md#protomol.StereoMolGraph)s.

`GraphError`  
If their symbols, charge or spin differ.
