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

Using the faster LangevinDynamicsMove #1138

Merged
merged 2 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion perses/app/setup_relative_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def run_setup(setup_options, serialize_systems=True, build_samplers=True):
hss[phase].energy_context_cache = energy_context_cache
hss[phase].sampler_context_cache = sampler_context_cache
elif setup_options['fe_type'] == 'repex':
hss[phase] = HybridRepexSampler(mcmc_moves=mcmc.LangevinSplittingDynamicsMove(
hss[phase] = HybridRepexSampler(mcmc_moves=mcmc.LangevinDynamicsMove(
timestep=timestep,
collision_rate=1.0 / unit.picosecond,
n_steps=n_steps_per_move_application,
Expand Down
4 changes: 2 additions & 2 deletions perses/tests/test_repex.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_RESTCapableHybridTopologyFactory_repex_neutral_mutation():
# Set up repex simulation
reporter_file = os.path.join(temp_dir, f"{wt_name}-{mutant_name}.nc")
reporter = MultiStateReporter(reporter_file, checkpoint_interval=10)
hss = HybridRepexSampler(mcmc_moves=mcmc.LangevinSplittingDynamicsMove(timestep=4.0 * unit.femtoseconds,
hss = HybridRepexSampler(mcmc_moves=mcmc.LangevinDynamicsMove(timestep=4.0 * unit.femtoseconds,
collision_rate=1.0 / unit.picosecond,
n_steps=50,
reassign_velocities=False,
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_RESTCapableHybridTopologyFactory_repex_charge_mutation():
# Set up repex simulation
reporter_file = os.path.join(temp_dir, f"{wt_name}-{mutant_name}.nc")
reporter = MultiStateReporter(reporter_file, checkpoint_interval=10)
hss = HybridRepexSampler(mcmc_moves=mcmc.LangevinSplittingDynamicsMove(timestep=4.0 * unit.femtoseconds,
hss = HybridRepexSampler(mcmc_moves=mcmc.LangevinDynamicsMove(timestep=4.0 * unit.femtoseconds,
collision_rate=1.0 / unit.picosecond,
n_steps=50,
reassign_velocities=False,
Expand Down
9 changes: 3 additions & 6 deletions perses/tests/test_resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ def test_resume_small_molecule():
checkpoint_interval=checkpoint_interval,
)
hss = HybridRepexSampler(
mcmc_moves=mcmc.LangevinSplittingDynamicsMove(
mcmc_moves=mcmc.LangevinDynamicsMove(
timestep=4.0 * unit.femtoseconds,
collision_rate=5.0 / unit.picosecond,
n_steps=250,
reassign_velocities=False,
n_restart_attempts=20,
splitting="V R R R O R R R V",
constraint_tolerance=1e-06,
),
hybrid_factory=htf,
Expand Down Expand Up @@ -197,13 +196,12 @@ def test_resume_protein_mutation_with_checkpoint(tmp_path):
checkpoint_interval=checkpoint_interval,
)
hss = HybridRepexSampler(
mcmc_moves=mcmc.LangevinSplittingDynamicsMove(
mcmc_moves=mcmc.LangevinDynamicsMove(
timestep=4.0 * unit.femtoseconds,
collision_rate=5.0 / unit.picosecond,
n_steps=250,
reassign_velocities=False,
n_restart_attempts=20,
splitting="V R R R O R R R V",
constraint_tolerance=1e-06,
),
hybrid_factory=htf,
Expand Down Expand Up @@ -268,13 +266,12 @@ def test_resume_protein_mutation_no_checkpoint(tmp_path):
checkpoint_interval=checkpoint_interval,
)
hss = HybridRepexSampler(
mcmc_moves=mcmc.LangevinSplittingDynamicsMove(
mcmc_moves=mcmc.LangevinDynamicsMove(
timestep=4.0 * unit.femtoseconds,
collision_rate=5.0 / unit.picosecond,
n_steps=250,
reassign_velocities=False,
n_restart_attempts=20,
splitting="V R R R O R R R V",
constraint_tolerance=1e-06,
),
hybrid_factory=htf,
Expand Down
4 changes: 2 additions & 2 deletions perses/tests/testsystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import numpy as np
from functools import partial
from openmmtools import states
from openmmtools.mcmc import MCMCSampler, LangevinSplittingDynamicsMove
from openmmtools.mcmc import MCMCSampler, LangevinDynamicsMove
from perses.utils.smallmolecules import sanitizeSMILES, canonicalize_SMILES
from perses.storage import NetCDFStorage, NetCDFStorageView
from perses.rjmc.topology_proposal import OESMILES_OPTIONS
Expand Down Expand Up @@ -117,7 +117,7 @@ def __init__(self, storage_filename=None, mode='w', ncmc_nsteps=5, mcmc_nsteps=1
self._timestep = 1.0*unit.femtosecond
self._ncmc_nsteps = ncmc_nsteps
self._mcmc_nsteps = mcmc_nsteps
self._move = LangevinSplittingDynamicsMove(timestep=self._timestep, splitting=self._splitting, n_restart_attempts=10)
self._move = LangevinDynamicsMove(timestep=self._timestep, splitting=self._splitting, n_restart_attempts=10)
self._move.n_restart_attempts = 10


Expand Down