Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use openmm.LangevinMiddleIntegrator #588

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions openff/evaluator/protocols/openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ class OpenMMSimulation(BaseSimulation):
"""Performs a molecular dynamics simulation in a given ensemble using
an OpenMM backend.

This protocol employs the Langevin integrator implemented in the ``openmmtools``
package to propagate the state of the system using the default BAOAB splitting [1]_.
This protocol employs the LangevinMiddleIntegrator implemented in openmm.
Further, simulations which are run in the NPT simulation will have a Monte Carlo
barostat (openmm.MonteCarloBarostat) applied every 25 steps (the OpenMM
default).
Expand Down Expand Up @@ -558,7 +557,9 @@ def _execute(self, directory, available_resources):
self.enable_pbc,
)

def _setup_simulation_objects(self, temperature, pressure, available_resources):
def _setup_simulation_objects(
self, temperature, pressure, available_resources
) -> tuple["openmm.Context", "openmm.LangevinMiddleIntegrator"]:
"""Initializes the objects needed to perform the simulation.
This comprises of a context, and an integrator.

Expand All @@ -576,8 +577,8 @@ def _setup_simulation_objects(self, temperature, pressure, available_resources):
openmm.Context
The created openmm context which takes advantage
of the available compute resources.
openmmtools.integrators.LangevinIntegrator
The Langevin integrator which will propogate
openmm.LangevinMiddleIntegrator
The LangevinMiddleIntegrator which will propogate
the simulation.
"""

Expand Down Expand Up @@ -618,10 +619,10 @@ def _setup_simulation_objects(self, temperature, pressure, available_resources):
thermostat_friction = to_openmm(self.thermostat_friction)
timestep = to_openmm(self.timestep)

integrator = openmmtools.integrators.LangevinIntegrator(
temperature=temperature,
collision_rate=thermostat_friction,
timestep=timestep,
integrator = openmm.LangevinMiddleIntegrator(
temperature,
thermostat_friction,
timestep,
)

# Create the simulation context.
Expand Down
Loading