openmmml.embeddings.mechanicalembedding.MechanicalEmbedding#
- class openmmml.embeddings.mechanicalembedding.MechanicalEmbedding#
Mechanical embedding. This is the default embedding method, and uses the conventional force field to compute the interactions between the atoms within the ML subset and those outside of it.
If long-range electrostatics are in use by the conventional force field but not supported by the ML model, the conventional force field charges will be used to approximate the interactions between atoms within the ML subset in different periodic images. For some models, this cannot be determined based on the information provided to OpenMM-ML, and the mlLongRange option must be provided explicitly to control whether or not to include these interactions.
This implementation assumes that if a model reports using long-range interactions, or mlLongRange is True, then the long-range interactions that the model computes are purely electrostatic (Ewald/PME), not LJPME.
- __init__()#
Methods
__init__()createMixedSystem(potential, topology, ...)Creates a mixed system using the embedding method.
- createMixedSystem(potential: MLPotentialImpl, topology: Topology, system: System, atoms: list[int], forceGroup: int, interpolate: bool, **args) System#
Creates a mixed system using the embedding method.
This is invoked by MLPotential.createMixedSystem(). It must be implemented in subclasses. The implementation should call potential.addForces() as needed to generate the appropriate ML forces.
Each embedding method is responsible for implementing interpolation; if interpolate is True, a global parameter “lambda_interpolate” should be present in the returned system, with the behavior as described by MLPotential.createMixedSystem().