NVTAndersen

Included in QATK.Dynamics

class NVTAndersen(initial_velocity=None, time_step=None, reservoir_temperature=None, heating_rate=None, thermostat_timescale=None)

The NVT Andersen integrator class which implements the Andersen thermostat.

Parameters:
  • initial_velocity (ConfigurationVelocities | ZeroVelocities | MaxwellBoltzmannDistribution) – A class that implements a distribution of initial velocities for the particles in the MD simulation.
    Default: MaxwellBoltzmannDistribution

  • time_step (PhysicalQuantity of type time) – The time-step interval used in the MD simulation.
    Default: 1 * fs

  • reservoir_temperature (PhysicalQuantity of type temperature) – The reservoir temperature in the simulation.
    Default: 300.0 * Kelvin

  • heating_rate (PhysicalQuantity of type temperature/time | None) – The heating rate of the target temperature. A value of None disables the heating of the system.
    Default: 0.0 * Kelvin / fs

  • thermostat_timescale (PhysicalQuantity of type time) – The time constant for Andersen temperature coupling.
    Default: 100.0 * fs

classmethod getLogInfo(step, time, md_quantities)

Get the log information for the current MD step.

Parameters:
  • step (int) – The current MD step.

  • time (PhysicalQuantity of type time) – The current MD time in fs.

  • md_quantities (MDQuantities) – The MD quantities to log.

Returns:

The header rows and the row with the MD information.

Return type:

list of str, str

kineticEnergy(configuration)
Parameters:

configuration (DistributedConfiguration) – The current configuration to calculate the kinetic energy of.

Returns:

The kinetic energy of the current configuration.

Return type:

PhysicalQuantity of type energy

kineticEnergyLeapfrog(configuration, forces)
Parameters:
  • configuration (DistributedConfiguration) – The current configuration to calculate the kinetic energy of.

  • forces (PhysicalQuantity of type energy per distance) – The current forces on the configuration.

Returns:

The kinetic energy of the current configuration.

Return type:

PhysicalQuantity of type energy

thermostats()
Returns:

The list of thermostats.

Return type:

list

timeStep()
Returns:

The time step.

Return type:

PhysicalQuantity of type time

uniqueString()

Return a unique string representing the state of the object.

Usage Examples

Perform a simulation with the Andersen thermostat on a configuration of amorphous teflon.

# Set the simulation
atomic_constraints = [FixCenterOfMass()]
method = NVTAndersen(
    time_step=2*fs,
    initial_velocity=ConfigurationVelocities(),
    reservoir_temperature=400*Kelvin,
)
simulation = SoftMatterDynamicsSimulation(
    configuration, method, atomic_constraints=atomic_constraints
)

nvt_andersen_example.py equilibrated_teflon.hdf5

Notes

The NVTAndersen thermostat reproduces the canonical NVT ensemble[1]. It does this by coupling to a hypothetical heat bath. Each particle in the simulation interacts with the heat bath at a given time scale or collision frequency. Periodically, a number of particles are randomly selected to have collided with the heat bath. These particles have their velocity changed to one randomly selected from the Maxwell-Boltzmann distribution at the temperature of the surrounding heat bath. The thermostat time scale thus determines the rate of energy transfer from heat bath to the system.

This thermostat is only supported in the soft matter dynamics framework, and cannot be used in the general molecular dynamics framework. See the documentation for the SoftMatterDynamicsSimulation object to see which methods are supported in each dynamics framework.