Skip to main content

from_ts_geometries()

The AMChI string of a TS, with its connectivity and candidates derived.

Usage

Source

from_ts_geometries(
    geometry, reactant_geometry, product_geometry, *, stereo=True
)

The three geometries are in the same atom order: the TS (for the parities) and its reactant side and product side (for the bonds and the candidates). With stereo=False the string has no b, t, m or s layer.

Raises the errors of string, and ValueError if the atoms differ.

Examples

    >>> import amchi
    >>> from types import SimpleNamespace
    >>> symbols = ["C", "H", "H", "H", "H", "O", "H"]
    >>> ring = [[0, 0, 0.3], [1, 0, 0.3], [-0.5, 0.87, 0.3], [-0.5, -0.87, 0.3]]
    >>> # CH3 + H2O: H4 moves from O5 to C0
    >>> ts = SimpleNamespace(
    ...     symbols=symbols,
    ...     coordinates=[[0, 0, 0], *ring[1:], [0, 0, -1.3], [0, 0, -2.5],
    ...                  [0.9, 0, -2.8]],
    ... )
    >>> reactant = SimpleNamespace(
    ...     symbols=symbols,
    ...     coordinates=[[0, 0, 0], *ring[1:], [-0.5, 0.5, -3.2], [0, 0, -2.5],
    ...                  [0.9, 0, -2.8]],
    ... )
    >>> product = SimpleNamespace(
    ...     symbols=symbols,
    ...     coordinates=[[0, 0, 0], *ring[1:], [0, 0, -1.09], [0, 0, -3.2],
    ...                  [0.9, 0, -3.5]],
    ... )
    >>> amchi.from_ts_geometries(ts, reactant, product)
'AMChI=2S/CH5O/c1-3-2/h2H,1H3/k3-2/f3-1/r0'
    >>> amchi.from_ts_geometries(ts, product, reactant)
'AMChI=2S/CH5O/c1-3-2/h2H,1H3/k3-2/f3-1/r1'