MiddleMassiveGGMTIntegrator

class ufedmm.MiddleMassiveGGMTIntegrator(temperature, time_constant, step_size, **kwargs)[source]

A massive, middle-type Generalized Gaussian Moment Thermostat [5] solver with optional multiple time-scale integration via RESPA.

To enable RESPA, the forces in OpenMM system must be split into distinct force groups and the keyword respa_loop (see below) must be a list with multiple entries.

Warning

The velocity update of this solver involves the square root of \(1 + 2 \delta t\, m v^2 v_2/3\), which becomes negative when the thermostat variable \(v_2\) is negative and the kinetic energy of a degree of freedom is large. Velocities can then become NaN, and this gets more likely as the ratio between the step size and the time constant grows. For example, one in 250 harmonic degrees of freedom failed after a few thousand steps with a 5 fs step size and a 100 fs time constant. The GGMT integrators of OpenXPS, the successor of UFEDMM, use a splitting without this singularity.

Parameters:
  • temperature (float or unit.Quantity) – The temperature.

  • time_constant (float or unit.Quantity) – The characteristic time constant.

  • step_size (float or unit.Quantity) – The time-step size.

Keyword Arguments:

**kwargs – All keyword arguments in AbstractMiddleRespaIntegrator, except num_rattles.

Example

>>> import ufedmm
>>> temp, tau, dt = 300*unit.kelvin, 10*unit.femtoseconds, 2*unit.femtoseconds
>>> integrator = ufedmm.MiddleMassiveGGMTIntegrator(temp, tau, dt)
>>> print(integrator)
Per-dof variables:
  kT, Q1, Q2, v1, v2
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: constrain positions
   4: v1 <- v1 + 0.5*dt*(m*v^2 - kT)/Q1
   5: v2 <- v2 + 0.5*dt*((m*v^2)^2/3 - kT^2)/Q2
   6: v <- v*exp(-1.0*dt*(v1 + kT*v2))/sqrt(1 + 2.0*dt*m*v^2*v2/3)
   7: v1 <- v1 + 0.5*dt*(m*v^2 - kT)/Q1
   8: v2 <- v2 + 0.5*dt*((m*v^2)^2/3 - kT^2)/Q2
   9: x <- x + 0.5*dt*v
  10: constrain positions
  11: v <- v + 0.5*dt*f/m

Methods

set_extended_space_time_constants(time_constants)[source]
update_temperatures(system_temperature, extended_space_temperatures)[source]