xnn.common.deploy.openmm_force#
xnn potentials in OpenMM: a TorchForce for openmm-torch and an "xnn" potential for openmm-ml.
A model runs inside an OpenMM simulation as an openmm-torch TorchForce,
alone or on a subset of the atoms of a classical system (ML/MM):
from openmmml import MLPotential
potential = MLPotential("xnn", model="mace-off23-small")
system = potential.createSystem(topology) # all atoms
mixed = potential.createMixedSystem(topology, mm_system, ligand_atoms) # ML/MM
The "xnn" name is registered with openmm-ml through the
openmmml.potentials entry point. Without openmm-ml,
create_torch_force() builds the force directly. The force evaluates the
TorchScript export of the model (TorchScriptPotential,
the reference implementation, with its own neighbor list), converts OpenMM’s
nanometers and kJ/mol to and from xnn’s Angstrom and eV, and returns the
energy and the forces of every particle (zero outside the model’s atoms).
Module Attributes
the elementary charge times Avogadro's number, over 1000). |
|
Angstrom per nanometer. |
Functions
|
An openmm-torch |
|
The scripted |
Classes
|
A scriptable module with openmm-torch's calling convention. |
|
openmm-ml's implementation of the |
Creates |