# md.methods.thermostats#

Overview

 Berendsen The Berendsen thermostat. Bussi The Bussi-Donadio-Parrinello thermostat. MTTK The Nosé-Hoover thermostat. Thermostat Base thermostat object class.

Details

Provide classes for thermostatting simulations.

Classes are for use with hoomd.md.methods.ConstantVolume and hoomd.md.methods.ConstantPressure.

Important

Ensure that your initial condition includes non-zero particle velocities and angular momenta (when appropriate). The coupling between the thermostat and the velocities / angular momenta occurs via multiplication, so the thermostat cannot convert a zero velocity into a non-zero one except through particle collisions.

class hoomd.md.methods.thermostats.Berendsen(kT, tau)#

The Berendsen thermostat.

Parameters:

Berendsen rescales the velocities of all particles on each time step. The rescaling is performed so that the difference in the current temperature from the set point decays exponentially:

$\frac{dT_\mathrm{cur}}{dt} = \frac{T - T_\mathrm{cur}}{\tau}$

Attention

Berendsen does not yield a proper canonical ensemble

Example:

# NVT integration using Berendsen thermostat
dt = 0.005
berendsen = hoomd.md.methods.thermostats.Berendsen(kT=1.0, tau=dt*100)
nvt = hoomd.md.methods.ConstantVolume(filter=hoomd.filter.All(),
thermostat=berendsen)
integrator = hoomd.md.Integrator(dt=dt, methods=[nvt])

kT#

Temperature of the simulation. $$[energy]$$

Type:

hoomd.variant.variant_like

tau#

Time constant of thermostat. $$[time]$$

Type:

float

class hoomd.md.methods.thermostats.Bussi(kT)#

Parameters:

kT (hoomd.variant.variant_like) – Temperature set point for the thermostat $$[\mathrm{energy}]$$.

Provides temperature control by rescaling the velocity by a factor taken from the canonical velocity distribution. On each timestep, velocities are rescaled by a factor $$\alpha=\sqrt{K_t / K}$$, where $$K$$ is the current kinetic energy, and $$K_t$$ is chosen randomly from the distribution

$P(K_t) \propto K_t^{N_f/2 - 1} \exp(-K_t / kT)$

where $$N_f$$ is the number of degrees of freedom thermalized.

Example:

# NVT integration using Bussi thermostat
bussi = hoomd.md.methods.thermostats.Bussi(kT=1.0)
nvt = hoomd.md.methods.ConstantVolume(filter=hoomd.filter.All(),
thermostat=bussi)
integrator = hoomd.md.Integrator(dt=0.005, methods=[nvt])

kT#

Temperature set point for the thermostat $$[\mathrm{energy}]$$.

Type:

hoomd.variant.variant_like

class hoomd.md.methods.thermostats.MTTK(kT, tau)#

The Nosé-Hoover thermostat.

Produces temperature control through a Nosé-Hoover thermostat.

Parameters:
• kT (hoomd.variant.variant_like) – Temperature set point for the thermostat $$[\mathrm{energy}]$$.

• tau (float) – Coupling constant for the thermostat $$[\mathrm{time}]$$

The translational thermostat has a momentum $$\xi$$ and position $$\eta$$. The rotational thermostat has momentum $$\xi_{\mathrm{rot}}$$ and position $$\eta_\mathrm{rot}$$. Access these quantities using translational_dof and rotational_dof.

Note

The coupling constant tau should be set within a reasonable range to avoid abrupt fluctuations in the kinetic temperature and to avoid long time to equilibration. The recommended value for most systems is $$\tau = 100 \delta t$$.

Example:

# NVT integration using MTTK Nose-Hoover thermostat
dt = 0.005
MTTK = hoomd.md.methods.thermostats.Berendsen(kT=1.0, tau=dt*100)
nvt = hoomd.md.methods.ConstantVolume(filter=hoomd.filter.All(),
thermostat=MTTK)
integrator = hoomd.md.Integrator(dt=dt, methods=[nvt])

kT#

Temperature set point for the thermostat $$[\mathrm{energy}]$$.

Type:

hoomd.variant.variant_like

tau#

Coupling constant for the thermostat $$[\mathrm{time}]$$

Type:

float

translational_dof#

Additional degrees of freedom for the translational thermostat ($$\xi$$, $$\eta$$)

Type:
rotational_dof#

Additional degrees of freedom for the rotational thermostat ($$\xi_\mathrm{rot}$$, $$\eta_\mathrm{rot}$$)

Type:
property energy#

Energy the thermostat contributes to the Hamiltonian $$[\mathrm{energy}]$$.

(Loggable: category=”scalar”)

thermalize_dof()#

Set the thermostat momenta to random values.

thermalize_dof sets a random value for the momentum $$\xi$$. When Integrator.integrate_rotational_dof is True, it also sets a random value for the rotational thermostat momentum $$\xi_{\mathrm{rot}}$$. Call thermalize_dof to set a new random state for the thermostat.

Important

You must call Simulation.run before thermalize_dof. Call run(steps=0) to prepare a newly created hoomd.Simulation.

class hoomd.md.methods.thermostats.Thermostat(kT)#

Base thermostat object class.

Note

Users should use the subclasses and not instantiate Thermostat directly.