## canonical_enantiomer()


`gra` or its [enantiomer](enantiomer.md#protomol.enantiomer), whichever has the smaller canonical JSON.


Usage

``` python
canonical_enantiomer(gra: G) -> G
 
canonical_enantiomer(gra: ReactionGraph | StereoReactionGraph) -> ReactionGraph | StereoReactionGraph
 
canonical_enantiomer(gra: AnyGraph) -> AnyGraph
```


A reproducible choice of one of two mirror images (like InChI's `/m0`); a tie (an achiral graph) keeps `gra`. Atom indices are kept. On a reaction graph the choice doesn't depend on its direction (P60): each of the two is compared in its canonical direction, `canonical_json(canonical_direction(x)[0])`, and the winner is returned in `gra`'s direction.

``` python
>>> from protomol import from_smiles
>>> r, s = from_smiles("C[C@H](O)CC"), from_smiles("C[C@@H](O)CC")
>>> canonical_json(canonical_enantiomer(r)) == canonical_json(s)
```

True

``` python
>>> canonical_enantiomer(s) == s
```

True
