openmmtools.mcmc.SequenceMove¶
- class openmmtools.mcmc.SequenceMove(move_list, **kwargs)[source]¶
A sequence of MCMC moves.
- Parameters:
- move_listlist-like of MCMCMove
The sequence of MCMC moves to apply.
Examples
NPT ensemble simulation of a Lennard Jones fluid with a sequence of moves.
>>> import numpy as np >>> from openmm import unit >>> from openmmtools import testsystems >>> from openmmtools.states import ThermodynamicState, SamplerState >>> test = testsystems.LennardJonesFluid(nparticles=200) >>> thermodynamic_state = ThermodynamicState(system=test.system, temperature=298*unit.kelvin, ... pressure=1*unit.atmospheres) >>> sampler_state = SamplerState(positions=test.positions) >>> # Create a move set that includes a Monte Carlo barostat move. >>> move = SequenceMove([GHMCMove(n_steps=50), MonteCarloBarostatMove(n_attempts=5)]) >>> # Create an MCMC sampler instance and run 5 iterations of the simulation. >>> sampler = MCMCSampler(thermodynamic_state, sampler_state, move=move) >>> sampler.run(n_iterations=2) >>> np.allclose(sampler.sampler_state.positions, test.positions) False
- Attributes:
- move_listlist of MCMCMove
The sequence of MCMC moves to apply.
Methods
apply
(thermodynamic_state, sampler_state[, ...])Apply the sequence of MCMC move in order.
Methods
__init__
(move_list, **kwargs)apply
(thermodynamic_state, sampler_state[, ...])Apply the sequence of MCMC move in order.
Attributes
context_cache
statistics
The statistics of all moves as a list of dictionaries.