openmmtools.states.create_thermodynamic_state_protocol¶
- openmmtools.states.create_thermodynamic_state_protocol(system, protocol, constants=None, composable_states=None)[source]¶
An optimized utility function to create a list of thermodynamic states.
The method takes advantage of the fact that copying a thermodynamic state does not require a copy of the OpenMM
System
object and that setting parameters that are controlled by the(Compound)ThermodynamicState
is effectively instantaneous.- Parameters:
- reference_stateThermodynamicState or openmm.System
ThermodynamicState
or The OpenMMSystem
. If aSystem
the constants must specify the temperature.- protocoldict: str -> list
A dictionary associating the thermodynamic parameters to a list of values. All the lists must have the same length.
- constantsdict: str -> list
A dictionary associating a thermodnamic parameter to a value that must remain constant along the protocol.
- composable_statesIComposableState or list, optional
If specified, the function returns a list of
CompoundThermodynamicState
instead of simpleThermodynamicState
objects.
- Returns:
- stateslist of
ThermodynamicState
orCompoundThermodynamicState
The sequence of thermodynamic states for the given protocol.
- stateslist of
Examples
>>> from openmm import unit >>> from openmmtools import testsystems >>> system = testsystems.AlanineDipeptideExplicit().system >>> protocol = {'temperature': [300, 310, 330]*unit.kelvin, ... 'pressure': [1.0, 1.1, 1.2]*unit.atmosphere} >>> states = create_thermodynamic_state_protocol(system, protocol) >>> len(states) 3