openmm
#
Convert tensor representations into OpenMM systems.
Modules:
-
nonbonded
–Convert non-bonded potentials to OpenMM forces.
-
valence
–Convert valence potentials to OpenMM forces.
Functions:
-
convert_to_openmm_ffxml
–Convert a SMEE force field and system to OpenMM force field XML
-
ffxml_converter
–A decorator used to flag a function as being able to convert a tensor potential
-
convert_to_openmm_force
–Convert a
smee
potential to OpenMM forces. -
convert_to_openmm_system
–Convert a
smee
force field and system / topology into an OpenMM system. -
convert_to_openmm_topology
–Convert a
smee
system to an OpenMM topology. -
create_openmm_system
–Create an empty OpenMM system from a
smee
system. -
potential_converter
–A decorator used to flag a function as being able to convert a tensor potential
convert_to_openmm_ffxml
#
convert_to_openmm_ffxml(
force_field: TensorForceField,
system: TensorSystem | TensorTopology,
) -> list[str]
Convert a SMEE force field and system to OpenMM force field XML representations.
Parameters:
-
force_field
(TensorForceField
) –The force field to convert.
-
system
(TensorSystem | TensorTopology
) –The system to convert.
Returns:
-
list[str]
–One OpenMM force field XML representation per topology in the system.
Source code in smee/converters/openmm/_ff.py
ffxml_converter
#
A decorator used to flag a function as being able to convert a tensor potential of a given type and energy function to an OpenMM force field XML representation.
The decorated function should take a smee.TensorPotential
, and
the associated smee.ParameterMap
and list of atom types, and return a
xml.etree.ElementTree
representing the potential.
Source code in smee/converters/openmm/_ff.py
convert_to_openmm_force
#
convert_to_openmm_force(
potential: TensorPotential, system: TensorSystem
) -> list[Force]
Convert a smee
potential to OpenMM forces.
Some potentials may return multiple forces, e.g. a vdW potential may return one force containing intermolecular interactions and another containing intramolecular interactions.
See Also
potential_converter: for how to define a converter function.
Parameters:
-
potential
(TensorPotential
) –The potential to convert.
-
system
(TensorSystem
) –The system to convert.
Returns:
-
list[Force]
–The OpenMM force(s).
Source code in smee/converters/openmm/_openmm.py
convert_to_openmm_system
#
convert_to_openmm_system(
force_field: TensorForceField,
system: TensorSystem | TensorTopology,
) -> System
Convert a smee
force field and system / topology into an OpenMM system.
Parameters:
-
force_field
(TensorForceField
) –The force field parameters.
-
system
(TensorSystem | TensorTopology
) –The system / topology to convert.
Returns:
-
System
–The OpenMM system.
Source code in smee/converters/openmm/_openmm.py
convert_to_openmm_topology
#
convert_to_openmm_topology(
system: TensorSystem | TensorTopology,
) -> Topology
Convert a smee
system to an OpenMM topology.
Notes
Virtual sites are given the name "X{i}".
Parameters:
-
system
(TensorSystem | TensorTopology
) –The system to convert.
Returns:
-
Topology
–The OpenMM topology.
Source code in smee/converters/openmm/_openmm.py
create_openmm_system
#
create_openmm_system(
system: TensorSystem, v_sites: TensorVSites | None
) -> System
Create an empty OpenMM system from a smee
system.
Source code in smee/converters/openmm/_openmm.py
potential_converter
#
A decorator used to flag a function as being able to convert a tensor potential of a given type and energy function to an OpenMM force.