openmmtools.integrators.MTSIntegrator

class openmmtools.integrators.MTSIntegrator(timestep=Quantity(value=1.0, unit=femtosecond), groups=[(0, 1)])[source]

MTSIntegrator implements the rRESPA multiple time step integration algorithm.

This integrator allows different forces to be evaluated at different frequencies, for example to evaluate the expensive, slowly changing forces less frequently than the inexpensive, quickly changing forces.

To use it, you must first divide your forces into two or more groups (by calling setForceGroup() on them) that should be evaluated at different frequencies. When you create the integrator, you provide a tuple for each group specifying the index of the force group and the frequency (as a fraction of the outermost time step) at which to evaluate it. For example:

>>> integrator = MTSIntegrator(4*unit.femtoseconds, [(0,1), (1,2), (2,8)])

This specifies that the outermost time step is 4 fs, so each step of the integrator will advance time by that much. It also says that force group 0 should be evaluated once per time step, force group 1 should be evaluated twice per time step (every 2 fs), and force group 2 should be evaluated eight times per time step (every 0.5 fs).

For details, see Tuckerman et al., J. Chem. Phys. 97(3) pp. 1990-2001 (1992).

Attributes:
thisown

The membership flag

Methods

addComputeGlobal(self, variable, expression)

Add a step to the integration algorithm that computes a global value.

addComputePerDof(self, variable, expression)

Add a step to the integration algorithm that computes a per-DOF value.

addComputeSum(self, variable, expression)

Add a step to the integration algorithm that computes a sum over degrees of freedom.

addConstrainPositions(self)

Add a step to the integration algorithm that updates particle positions so all constraints are satisfied.

addConstrainVelocities(self)

Add a step to the integration algorithm that updates particle velocities so the net velocity along all constraints is 0.

addGlobalVariable(self, name, initialValue)

Define a new global variable.

addPerDofVariable(self, name, initialValue)

Define a new per-DOF variable.

addTabulatedFunction(self, name, function)

Add a tabulated function that may appear in expressions.

addUpdateContextState(self)

Add a step to the integration algorithm that allows Forces to update the context state.

beginIfBlock(self, condition)

Add a step which begins a new "if" block.

beginWhileBlock(self, condition)

Add a step which begins a new "while" block.

endBlock(self)

Add a step which marks the end of the most recently begun "if" or "while" block.

getComputationStep(self, index)

Get the details of a computation step that has been added to the integration algorithm.

getConstraintTolerance(self)

Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.

getGlobalVariable(self, index)

Get the current value of a global variable.

getGlobalVariableByName(self, name)

Get the current value of a global variable, specified by name.

getGlobalVariableName(self, index)

Get the name of a global variable.

getIntegrationForceGroups(self)

Get which force groups to use for integration.

getKineticEnergyExpression(self)

Get the expression to use for computing the kinetic energy.

getNumComputations(self)

Get the number of computation steps that have been added.

getNumGlobalVariables(self)

Get the number of global variables that have been defined.

getNumPerDofVariables(self)

Get the number of per-DOF variables that have been defined.

getNumTabulatedFunctions(self)

Get the number of tabulated functions that have been defined.

getPerDofVariable()

getPerDofVariableByName(self, name)

Get the value of a per-DOF variable, specified by name.

getPerDofVariableName(self, index)

Get the name of a per-DOF variable.

getRandomNumberSeed(self)

Get the random number seed.

getStepSize(self)

Get the size of each time step, in picoseconds.

getTabulatedFunction(-> TabulatedFunction)

Get a reference to a tabulated function that may appear in expressions.

getTabulatedFunctionName(self, index)

Get the name of a tabulated function that may appear in expressions.

setConstraintTolerance(self, tol)

Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.

setGlobalVariable(self, index, value)

Set the value of a global variable.

setGlobalVariableByName(self, name, value)

Set the value of a global variable, specified by name.

setIntegrationForceGroups(groups)

Set which force groups to use for integration.

setKineticEnergyExpression(self, expression)

Set the expression to use for computing the kinetic energy.

setPerDofVariable(self, index, values)

Set the value of a per-DOF variable.

setPerDofVariableByName(self, name, values)

Set the value of a per-DOF variable, specified by name.

setRandomNumberSeed(self, seed)

Set the random number seed.

setStepSize(self, size)

Set the size of each time step, in picoseconds.

step(self, steps)

Advance a simulation through time by taking a series of time steps.

__init__(timestep=Quantity(value=1.0, unit=femtosecond), groups=[(0, 1)])[source]

Create an MTSIntegrator.

Parameters:
timestepunit.Quantity with units compatible with femtoseconds, optional default=1*femtoseconds

The largest (outermost) integration time step to use.

groupslist of tuples, optional, default=(0,1)

A list of tuples defining the force groups. The first element of each tuple is the force group index, and the second element is the number of times that force group should be evaluated in one time step.

Methods

__init__([timestep, groups])

Create an MTSIntegrator.

addComputeGlobal(self, variable, expression)

Add a step to the integration algorithm that computes a global value.

addComputePerDof(self, variable, expression)

Add a step to the integration algorithm that computes a per-DOF value.

addComputeSum(self, variable, expression)

Add a step to the integration algorithm that computes a sum over degrees of freedom.

addConstrainPositions(self)

Add a step to the integration algorithm that updates particle positions so all constraints are satisfied.

addConstrainVelocities(self)

Add a step to the integration algorithm that updates particle velocities so the net velocity along all constraints is 0.

addGlobalVariable(self, name, initialValue)

Define a new global variable.

addPerDofVariable(self, name, initialValue)

Define a new per-DOF variable.

addTabulatedFunction(self, name, function)

Add a tabulated function that may appear in expressions.

addUpdateContextState(self)

Add a step to the integration algorithm that allows Forces to update the context state.

beginIfBlock(self, condition)

Add a step which begins a new "if" block.

beginWhileBlock(self, condition)

Add a step which begins a new "while" block.

endBlock(self)

Add a step which marks the end of the most recently begun "if" or "while" block.

getComputationStep(self, index)

Get the details of a computation step that has been added to the integration algorithm.

getConstraintTolerance(self)

Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.

getGlobalVariable(self, index)

Get the current value of a global variable.

getGlobalVariableByName(self, name)

Get the current value of a global variable, specified by name.

getGlobalVariableName(self, index)

Get the name of a global variable.

getIntegrationForceGroups(self)

Get which force groups to use for integration.

getKineticEnergyExpression(self)

Get the expression to use for computing the kinetic energy.

getNumComputations(self)

Get the number of computation steps that have been added.

getNumGlobalVariables(self)

Get the number of global variables that have been defined.

getNumPerDofVariables(self)

Get the number of per-DOF variables that have been defined.

getNumTabulatedFunctions(self)

Get the number of tabulated functions that have been defined.

getPerDofVariable()

getPerDofVariableByName(self, name)

Get the value of a per-DOF variable, specified by name.

getPerDofVariableName(self, index)

Get the name of a per-DOF variable.

getRandomNumberSeed(self)

Get the random number seed.

getStepSize(self)

Get the size of each time step, in picoseconds.

getTabulatedFunction(-> TabulatedFunction)

Get a reference to a tabulated function that may appear in expressions.

getTabulatedFunctionName(self, index)

Get the name of a tabulated function that may appear in expressions.

setConstraintTolerance(self, tol)

Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.

setGlobalVariable(self, index, value)

Set the value of a global variable.

setGlobalVariableByName(self, name, value)

Set the value of a global variable, specified by name.

setIntegrationForceGroups(groups)

Set which force groups to use for integration.

setKineticEnergyExpression(self, expression)

Set the expression to use for computing the kinetic energy.

setPerDofVariable(self, index, values)

Set the value of a per-DOF variable.

setPerDofVariableByName(self, name, values)

Set the value of a per-DOF variable, specified by name.

setRandomNumberSeed(self, seed)

Set the random number seed.

setStepSize(self, size)

Set the size of each time step, in picoseconds.

step(self, steps)

Advance a simulation through time by taking a series of time steps.

Attributes

BlockEnd

ComputeGlobal

ComputePerDof

ComputeSum

ConstrainPositions

ConstrainVelocities

IfBlockStart

UpdateContextState

WhileBlockStart

thisown

The membership flag