MiddleMassiveNHCIntegrator¶
- class ufedmm.MiddleMassiveNHCIntegrator(temperature, time_constant, step_size, nchain=4, **kwargs)[source]¶
A massive, middle-type Nose-Hoover Chain Thermostat solver [6] 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.- 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:
nchain (int, default=4) – The number of thermostats in each Nose-Hoover chain. Short chains can sample stiff, nearly harmonic degrees of freedom poorly.
**kwargs – All keyword arguments in
AbstractMiddleRespaIntegrator, exceptnum_rattles.
Example
>>> import ufedmm >>> temp, tau, dt = 300*unit.kelvin, 10*unit.femtoseconds, 2*unit.femtoseconds >>> integrator = ufedmm.MiddleMassiveNHCIntegrator( ... temp, tau, dt, respa_loops=[4, 1], unroll_loops=False ... ) >>> print(integrator) Per-dof variables: kT, Q, v1, v2, v3, v4 Global variables: irespa0 = 0.0 Computation steps: 0: allow forces to update the context state 1: v <- v + 0.5*dt*f1/m 2: irespa0 <- 0 3: while (irespa0 < 3.5): 4: v <- v + 0.125*dt*f0/m 5: x <- x + 0.125*dt*v 6: constrain positions 7: v4 <- v4 + 0.125*dt*(Q*v3^2 - kT)/Q 8: v3 <- (v3*z + 0.125*dt*(Q*v2^2 - kT)/Q)*z; z=exp(-0.0625*dt*v4) 9: v2 <- (v2*z + 0.125*dt*(Q*v1^2 - kT)/Q)*z; z=exp(-0.0625*dt*v3) 10: v1 <- (v1*z + 0.125*dt*(m*v^2 - kT)/Q)*z; z=exp(-0.0625*dt*v2) 11: v <- v*exp(-0.25*dt*v1) 12: v1 <- (v1*z + 0.125*dt*(m*v^2 - kT)/Q)*z; z=exp(-0.0625*dt*v2) 13: v2 <- (v2*z + 0.125*dt*(Q*v1^2 - kT)/Q)*z; z=exp(-0.0625*dt*v3) 14: v3 <- (v3*z + 0.125*dt*(Q*v2^2 - kT)/Q)*z; z=exp(-0.0625*dt*v4) 15: v4 <- v4 + 0.125*dt*(Q*v3^2 - kT)/Q 16: x <- x + 0.125*dt*v 17: constrain positions 18: v <- v + 0.125*dt*f0/m 19: irespa0 <- irespa0 + 1 20: end 21: v <- v + 0.5*dt*f1/m
Methods