xnn.common.deploy.openmm_force.openmm_potential#

xnn.common.deploy.openmm_force.openmm_potential(model, atomic_numbers, atoms=None, periodic=False, total_charge=0.0, spin_multiplicity=1.0, cutoff=None, dtype=None)[source]#

The scripted OpenMMPotential of a model.

Parameters:
  • model (torch.nn.Module, str or tuple) – An xnn potential (bare or inside ForceStressOutput), or any source of from_pretrained() (a hub name, a checkpoint or model directory); a fine-tuned checkpoint comes with its LoRA updates folded in and its recorded dispersion term added back; or a (potential, cutoff) pair already loaded.

  • atomic_numbers (sequence of int) – Atomic numbers of the model’s atoms.

  • atoms (sequence of int or None, optional) – Their indices among the system’s particles; None for all.

  • periodic (bool, optional) – Whether the system is periodic, by default False.

  • total_charge (float, optional) – Charge state of the model’s atoms, by default neutral singlet.

  • spin_multiplicity (float, optional) – Charge state of the model’s atoms, by default neutral singlet.

  • cutoff (float, optional) – Neighbor-list cutoff in Angstrom, by default the model’s.

  • dtype (torch.dtype or str, optional) – The model’s dtype, by default its own.

Returns:

The module, ready for openmmtorch.TorchForce.

Return type:

torch.jit.ScriptModule