MassiveGGMTIntegrator

class openxps.integrators.MassiveGGMTIntegrator(temperature, timeConstant, stepSize, *, stochastic=False, forceFirst=False, halleyIterations=3)[source]

A massive, second- and fourth-moment GGMT integrator [2].

The massive GGMT integrator is effective at maintaining temperature control under steady-state conditions, such as in d-AFED/TAMD [3, 4] or UFED [5] simulations.

Note

If stochasticity is enabled, the friction coefficient is initially set to the inverse of the time constant, but this value can be customized via setFrictionCoefficient(). Otherwise, the friction coefficient is zero and cannot be changed.

Warning

This integrator is incompatible with systems subject to constraints.

Parameters:
  • temperature (Quantity) – The temperature of the heat bath.

  • timeConstant (Quantity) – The time constant (a.k.a. coupling/damping/relaxation time) of the thermostat.

  • stepSize (Quantity) – The integration step size.

Keyword Arguments:
  • stochastic – If True, the integrator will apply a stochastic rescaling to each velocity and its fourth-moment thermostat variable at the center of the step.

  • forceFirst – If True, the integrator will apply a force-first scheme. Otherwise, it will apply a symmetric operator splitting scheme.

  • halleyIterations – The number of Halley iterations used to solve the hyperbolic Kepler equation of the Coulomb sub-step (see Notes). The default reaches double precision.

Notes

Propagated alone, the cubic friction of the GGMT equations has a finite-time singularity, which makes Trotter-factorized integrators fail at large step sizes. Here it is propagated together with the fourth-moment thermostat variable, as an exactly solvable Coulomb problem that requires one hyperbolic Kepler equation per step. The stochastic version rescales each velocity and its fourth-moment thermostat variable by a common random factor [1] at the center of the step, where the friction coefficient sets the rate of the rescaling.

Example

>>> import openxps as xps
>>> from openmm import unit
>>> from openmmtools import testsystems

Symmetric scheme (default)

>>> integrator = xps.integrators.MassiveGGMTIntegrator(
...     temperature=300 * unit.kelvin,
...     timeConstant=100 * unit.femtoseconds,
...     stepSize=2 * unit.femtoseconds,
... )
>>> integrator
Per-dof variables:
  v1, v2, active, meanAnomaly, angle, expAngle
Global variables:
  kT = 2.494338...
  invQ = 40.090...
  invQ2 = 2.416...
Computation steps:
   0: allow forces to update the context state
   1: v <- v + 0.5*dt*f/m
   2: x <- x + 0.5*dt*v
   3: v1 <- active*(v1 + 0.5*dt*(m*v^2 - kT)*invQ)
   4: v <- v*exp(-0.5*dt*(v1 + kT*v2))
   5: meanAnomaly <- (2*step(sinh0) - 1)*log(abs(sinh0) + cosh0) + ...
   6: angle <- start - residual*coshA/(2*coshA^3 - residual*sinhA); ...
   7: angle <- angle - residual*coshA/(2*coshA^3 - residual*sinhA); ...
   8: expAngle <- expA*(1 - delta + delta^2/2 - delta^3/6); ...
   9: v <- v*cosh0*2*expAngle/(expAngle^2 + 1); ...
  10: v2 <- active*(0.5*(expAngle - 1/expAngle)*...
  11: v <- v*exp(-0.5*dt*(v1 + kT*v2))
  12: v1 <- active*(v1 + 0.5*dt*(m*v^2 - kT)*invQ)
  13: x <- x + 0.5*dt*v
  14: v <- v + 0.5*dt*f/m

Force-first scheme

>>> integrator_ff = xps.integrators.MassiveGGMTIntegrator(
...     temperature=300 * unit.kelvin,
...     timeConstant=40 * unit.femtoseconds,
...     stepSize=2 * unit.femtoseconds,
...     forceFirst=True
... )
>>> model = testsystems.AlanineDipeptideVacuum()
>>> try:
...     integrator_ff.registerWithSystem(model.system, False)
... except ValueError as e:
...     print(e)
Massive GGMT integrators do not support constraints.

Methods

getFrictionCoefficient()

Get the friction coefficient.

Returns:

The friction coefficient.

Return type:

openmm.unit.Quantity

getTemperature()

Get the temperature.

Returns:

The temperature.

Return type:

openmm.unit.Quantity

getTimeConstant()

Get the time constant.

Returns:

The time constant.

Return type:

openmm.unit.Quantity

registerWithSystem(system, isExtension)[source]

Register the integrator with the system.

setFrictionCoefficient(value)[source]

Set the friction coefficient.

Parameters:

value (Quantity | float) – The friction coefficient.

Raises:

ValueError – If the integrator is deterministic and the value is not zero.

setTemperature(value)

Set the temperature.

Parameters:

value (Quantity | float) – The temperature.

setTimeConstant(value)

Set the time constant.

Parameters:

value (Quantity | float) – The time constant.