isomorphism()
An atom map m with relabel(g1, m) == g2, or None if there is none.
Usage
isomorphism(
g1,
g2,
)Atom k of g2 is atom m[k] of g1 (the direction of relabel and of canonical_form’s atom_map). Test the result with is not None: two empty graphs give (). Both graphs must be of one type (GraphError otherwise).
>>> from protomol import from_smiles, relabel
>>> g1, g2 = from_smiles("OC"), from_smiles("CO")
>>> m = isomorphism(g1, g2)
>>> relabel(g1, m) == g2True
>>> isomorphism(from_smiles("C[C@H](O)F"), from_smiles("C[C@@H](O)F")) is NoneTrue