NVTNoseHoover¶
Included in QATK.Dynamics
- class NVTNoseHoover(initial_velocity=None, time_step=None, reservoir_temperature=None, heating_rate=None, thermostat_timescale=None, chain_length=None, max_force_threshold=None)¶
The NVT Nose-Hoover integrator class.
- Parameters:
initial_velocity (
ConfigurationVelocities|ZeroVelocities|MaxwellBoltzmannDistribution) – A class that implements a distribution of initial velocities for the particles in the MD simulation. Default:MaxwellBoltzmannDistributiontime_step (PhysicalQuantity of type time) – The time-step interval used in the MD simulation. Default:
1.0 * fsreservoir_temperature (PhysicalQuantity of type temperature | list) – The reservoir temperature in the simulation. The temperature can be given as a single temperature value for the entire system, or as a list of 2-tuples of str and PhysicalQuantity of type temperature, applying local thermostats to the tagged groups of atoms. E.g.
[('group1', 280.0 * Kelvin), ('group2', 320.0 * Kelvin)]. Default:300.0 * Kelvinheating_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 / fsthermostat_timescale (PhysicalQuantity of type time) – The time constant for Berendsen temperature coupling. Default:
100.0 * fschain_length (int) – The number of subsequent Nose-Hoover thermostats. Zero means no thermostat is invoked. Default:
3max_force_threshold (PhysicalQuantity of type energy/length) – The maximum allowed force to run MD simulation with single time step. If maximum force in a MD simulation is larger than the threshold force, multiple time steps MD simulation is performed. Default: None
- 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 Example¶
Perform a molecular dynamics run of 50 steps on FCC Si, using the Nose-Hoover thermostat:
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=FaceCenteredCubic(5.4306*Angstrom),
elements=[Silicon, Silicon],
fractional_coordinates=[[0.0, 0.0, 0.0], [0.25, 0.25, 0.25]]
)
# Set calculator
calculator = TremoloXCalculator(parameters=Tersoff_Si_1988b())
bulk_configuration.setCalculator(calculator)
# Set up MD method
method = NVTNoseHoover(
time_step=1*femtoSecond,
reservoir_temperature=300*Kelvin,
thermostat_timescale=100*femtoSecond,
heating_rate=0*Kelvin/picoSecond,
chain_length=3,
initial_velocity=None
)
# Run MD simulation
md_trajectory = MolecularDynamics(
bulk_configuration,
constraints=[],
trajectory_filename='trajectory.nc',
steps=50,
log_interval=10,
method=method
)
Apply two thermostats to tagged groups of atoms of the configuration:
# Set up MD method with two thermostats on tagged groups of atoms.
method = NVTNoseHoover(
time_step=1*femtoSecond,
reservoir_temperature=[('region1', 300*Kelvin), ('region2', 600.0*Kelvin)],
thermostat_timescale=100*femtoSecond,
heating_rate=0*Kelvin/picoSecond,
chain_length=3,
initial_velocity=None
)
Notes¶
The Nose-Hoover-thermostat uses several subsequent thermostats to reproduce a canonical ensemble. For more details regarding the Nose-Hoover chain method, please consult Martyna et al. [1].
You can specify one or more thermostats acting on tagged sub-groups of atoms of the configuration, by giving a list of
(tag-name, temperature)-tuples in stead of a single, globalreservoir_temperaturevalue.If a non-zero
heating_rateis specified, the reservoir temperature will be changed linearly during the simulation, according to the specified heating rate.This method is supported in both the soft matter and general dynamics frameworks. See the documentation on the
SoftMatterDynamicsSimulationfor details on which methods are supported in each framework.