Velocity Verlet with Nosé–Hoover thermostat

This NVT-ensemble integrator implements the Verlet algorithm algorithm with Nosé–Hoover chain thermostat with a chain length M = 2.

For reference and detailed description of the algorithm see the original papers by S. Nosé, W.G. Hoover and Martyna et al.:

class halmd.mdsim.integrators.verlet_nvt_hoover(args)

Construct velocity-Verlet integrator with Nosé–Hoover chain thermostat.

Parameters:
  • args (table) – keyword arguments
  • args.particle – instance of halmd.mdsim.particle
  • args.box – instance of halmd.mdsim.box
  • args.timestep (number) – integration time step (defaults to halmd.mdsim.clock.timestep)
  • args.temperature (number) – temperature of heat bath
  • args.resonance_frequency (number) – coupling frequency of the thermostat
set_timestep(timestep)

Set integration time step in MD units.

Parameters:timestep (number) – integration timestep

This method forwards to halmd.mdsim.clock.set_timestep(), to ensure that all integrators use an identical time step.

timestep

Integration time step in MD units.

set_temperature(temperature)

Set temperature of heat bath.

Parameters:temperature (number) – temperature of heat bath
temperature

Temperature of heat bath.

resonance_frequency

Resonance frequency of the Nosé–Hoover thermostat, this is connected to the mass of the thermostat via m_1 = d N T / \Omega^2 and m_2 = T/\Omega^2, where \Omega is 2\pi\times\textrm{resonance frequency}, N the total number of (point) particles, and d the dimension of space.

set_mass(mass)

Set mass of heat bath.

Parameters:mass (table) – Sequence of masses m_1, m_2 for the heat bath coupling.
mass

Array of masses m_1, m_2 of heat bath, connected to the coupling strength of the thermostat.

integrate()

Calculate first half-step.

By default this function is connected to halmd.mdsim.core.on_integrate().

finalize()

Calculate second half-step.

By default this function is connected to halmd.mdsim.core.on_finalize().

position()

Return current values of thermostat chain variables (which are generalised positions).

velocity()

Return current “velocities” of the thermostat chain variables.

internal_energy()

Return internal energy of thermostat variables divided by particle.nparticle.

disconnect()

Disconnect integrator from core and profiler.

class writer(args)

Write heat bath variables (generalised positions and velocities) and derived quantities (internal energy) to file.

Parameters:
  • args (table) – keyword arguments
  • args.file – instance of file writer
  • args.fields (table) – data field names to be written
  • args.location (string table) – location within file (optional)
  • args.every (number) – sampling interval (optional)
Returns:

instance of group writer

The table fields specifies which data fields are written. It may either be passed as an indexed table, e.g. {"position", "velocity"}, or as a dictionary, e.g., {xi = "position", v_xi = "velocity"}; the table form is interpreted as {position = "position", ...}. The keys denote the field names in the file and are appended to location. Valid values are position, velocity, internal_energy.

The argument location specifies a path in a structured file format like H5MD given as a table of strings. If omitted it defaults to {"observables", "nose_hoover"}.

If every is not specified or 0, a phase space sample will be written at the start and end of the simulation.

disconnect()

Disconnect Nosé–Hoover writer from observables sampler.