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 OpenMM System. If a System 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 simple ThermodynamicState objects.

Returns
stateslist of ThermodynamicState or CompoundThermodynamicState

The sequence of thermodynamic states for the given protocol.

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