xnn.common.deploy.openmm_force.create_torch_force#
- xnn.common.deploy.openmm_force.create_torch_force(model, topology, atoms=None, force_group=0, total_charge=0.0, spin_multiplicity=1.0, cutoff=None, dtype=None)[source]#
An openmm-torch
TorchForceevaluatingmodelon the atoms of an OpenMM topology.- Parameters:
model (torch.nn.Module, str or tuple) – As for
openmm_potential(), or a(potential, cutoff)pair already loaded.topology (openmm.app.Topology) – The system’s topology; its periodic box vectors make the force periodic.
atoms (sequence of int or None, optional) – The model’s atoms;
None(default) for all.force_group (int, optional) – The force group, by default 0.
total_charge (float) – As for
openmm_potential().spin_multiplicity (float) – As for
openmm_potential().cutoff (float | None) – As for
openmm_potential().dtype – As for
openmm_potential().
- Returns:
The force, to add to an
openmm.System.- Return type:
openmmtorch.TorchForce