openff.interchange.components.potentials.PotentialHandler

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

Base class for storing parametrized force field data.

Config
  • arbitrary_types_allowed: bool = True

  • json_encoders: dict = {<class ‘openff.units.units.Quantity’>: <function custom_quantity_encoder at 0x7fdff3466f70>}

  • json_loads: function = <function json_loader at 0x7fdff3459280>

  • validate_assignment: bool = True

Fields
field type: str [Required]

The type of potentials this handler stores.

field expression: str [Required]

The analytical expression governing the potentials in this handler.

field slot_map: Dict[Union[openff.interchange.models.TopologyKey, openff.interchange.models.VirtualSiteKey], openff.interchange.models.PotentialKey] = {}

A mapping between TopologyKey objects and PotentialKey objects.

field potentials: Dict[openff.interchange.models.PotentialKey, Union[openff.interchange.components.potentials.Potential, openff.interchange.components.potentials.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.

store_matches(parameter_handler: openff.toolkit.typing.engines.smirnoff.parameters.ParameterHandler, topology: _OFFBioTop) None[source]

Populate self.slot_map with key-val pairs of [TopologyKey, PotentialKey].

store_potentials(parameter_handler: openff.toolkit.typing.engines.smirnoff.parameters.ParameterHandler) None[source]

Populate self.potentials with key-val pairs of [PotentialKey, Potential].

get_force_field_parameters()[source]

Return a flattened representation of the force field parameters.

set_force_field_parameters(new_p)[source]

Set the force field parameters from a flattened representation.

get_system_parameters(p=None)[source]

Return a flattened representation of system parameters.

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

get_mapping() Dict[source]

Get a mapping between potentials and array indices.

parametrize(p=None)[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()[source]

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