Collection

pydantic model openff.interchange.components.potentials.Collection[source]

Bases: DefaultModel

Base class for storing parametrized force field data.

Fields
field type: str [Required]

The type of potentials this handler stores.

field is_plugin: bool = False

Whether this collection is defined as a plugin.

field expression: str [Required]

The analytical expression governing the potentials in this handler.

field key_map: dict[TopologyKey | LibraryChargeTopologyKey, PotentialKey] = {}

A mapping between TopologyKey objects and PotentialKey objects.

field potentials: dict[PotentialKey, Potential | WrappedPotential] = {}

A mapping between PotentialKey objects and Potential objects.

property independent_variables: set[str]

Return a set of variables found in the expression but not in any potentials.

get_force_field_parameters(use_jax: bool = False) Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]], jax.Array][source]

Return a flattened representation of the force field parameters.

set_force_field_parameters(new_p: Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]) None[source]

Set the force field parameters from a flattened representation.

get_system_parameters(p=None, use_jax: bool = False) Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]], jax.Array][source]

Return a flattened representation of system parameters.

These values are effectively force field parameters as applied to a chemical topology.

get_mapping() dict[PotentialKey, int][source]

Get a mapping between potentials and array indices.

parametrize(p=None, use_jax: bool = True) Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]], jax.Array][source]

Return an array of system parameters, given an array of force field parameters.

parametrize_partial()[source]

Return a function that will call self.parametrize() with arguments specified by self.mapping.

get_param_matrix() Union[jax.Array, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]][source]

Get a matrix representing the mapping between force field and system parameters.