pydantic model openff.interchange.models.TopologyKey[source]

Bases: DefaultModel

A unique identifier of a segment of a chemical topology.

These refer to a single portion of a chemical graph, i.e. a single valence term, (a bond, angle, or dihedral) or a single atom. These target only the information in the chemical graph and do not store physics parameters. For example, a TopologyKey corresponding to a bond would store the indices of the two atoms that compose the bond, but not the force constant or equilibrium bond length as determined by the force field.


Create a TopologyKey identifying some speicfic angle

>>> from openff.interchange.models import TopologyKey
>>> this_angle = TopologyKey(atom_indices=(2, 1, 3))
>>> this_angle
TopologyKey with atom indices (2, 1, 3)

Create a TopologyKey indentifying just one atom

>>> this_atom = TopologyKey(atom_indices=(4,))
>>> this_atom
TopologyKey with atom indices (4,)

Layer multiple TopologyKey objects that point to the same torsion

>>> key1 = TopologyKey(atom_indices=(1, 2, 5, 6), mult=0)
>>> key2 = TopologyKey(atom_indices=(1, 2, 5, 6), mult=1)
>>> assert key1 != key2
field atom_indices: Tuple[int, ...] = ()

The indices of the atoms occupied by this interaction

field mult: Optional[int] = None

The index of this duplicate interaction

field bond_order: Optional[float] = None

If this key represents as topology component subject to interpolation between multiple parameters(s), the bond order determining the coefficients of the wrapped potentials.