PotentialKey

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

Bases: DefaultModel

A unique identifier of an instance of physical parameters as applied to a segment of a chemical topology.

These refer to a single term in a force field as applied to a single segment of a chemical topology, i.e. a single atom or dihedral. For example, a PotentialKey corresponding to a bond would store the the force constant and the equilibrium bond length as determined by the force field. These keys to not have direct knowledge of where in a topology they have been applied.

Examples

Create a PotentialKey corresponding to the parameter with id b55 in OpenFF “Parsley” 1.0.0

>>> from openff.interchange.models import PotentialKey
>>> from openff.toolkit import ForceField
>>> parsley = ForceField("openff-1.0.0.offxml")
>>> param = parsley["Bonds"].get_parameter({"id": "b55"})[0]
>>> bond_55 = PotentialKey(id=param.smirks)
>>> bond_55
PotentialKey associated with handler 'None' with id '[#16X4,#16X3:1]-[#8X2:2]'

Create a PotentialKey corresponding to the angle parameters in OPLS-AA defined between atom types opls_135, opls_135, and opls_140

>>> oplsaa_angle = PotentialKey(id="opls_135-opls_135-opls_140")
>>> oplsaa_angle
PotentialKey associated with handler 'None' with id 'opls_135-opls_135-opls_140'
Fields
field id: str [Required]

A unique identifier of this potential, i.e. a SMARTS pattern or an atom type

field mult: int | None = None

The index of this duplicate interaction

field associated_handler: str | None = None

The type of handler this potential key is associated with, i.e. ‘Bonds’, ‘vdW’, or ‘LibraryCharges

field bond_order: float | None = None

If this is a key to a WrappedPotential interpolating multiple parameter(s), the bond order determining the coefficients of the wrapped potentials.

field virtual_site_type: str | None = None

The ‘type’ of virtual site (i.e. BondCharge) this parameter is associated with.

field cosmetic_attributes: dict[str, Any] = {}

A dictionary of cosmetic attributes associated with this potential key.