openmmml.mlpotential.MLPotentialImpl#
- class openmmml.mlpotential.MLPotentialImpl#
Abstract interface for classes that implement potential functions.
If you are defining a new potential function, you need to create subclasses of MLPotentialImpl and MLPotentialImplFactory. When a user creates a MLPotential and specifies a name for the potential to use, it looks up the factory that has been registered for that name and uses it to create a MLPotentialImpl of the appropriate subclass.
- __init__()#
Methods
__init__
()addForces
(topology, system, atoms, ...)Add Force objects to a System to implement the potential function.
- addForces(topology: Topology, system: System, atoms: Iterable[int] | None, forceGroup: int, **args)#
Add Force objects to a System to implement the potential function.
This is invoked by MLPotential.createSystem(). Subclasses must implement it to create the requested potential function.
- Parameters:
topology (Topology) – the Topology from which the System is being created
system (System) – the System that is being created
atoms (Optional[Iterable[int]]) – the indices of atoms the potential should be applied to, or None if it should be applied to the entire System
forceGroup (int) – the force group that any newly added Forces should be in
args – any additional keyword arguments that were provided to createSystem() are passed to this method. This allows subclasses to customize their behavior based on extra arguments.