nvalchemi.dynamics.NVTNoseHoover#
- class nvalchemi.dynamics.NVTNoseHoover(model, dt, temperature, thermostat_time, chain_length=3, yoshida_order=3, n_steps=None, hooks=None, convergence_hook=None, **kwargs)[source]#
NVT integrator via Nosé-Hoover chain (NHC) thermostat.
Deterministic extended-Lagrangian thermostat that rigorously samples the canonical ensemble for ergodic systems.
- Parameters:
model (BaseModelMixin) – The neural network potential model.
dt (float or torch.Tensor) – Integration timestep in femtoseconds
[M]or scalar.temperature (float or torch.Tensor) – Target temperature in Kelvin
[M]or scalar.thermostat_time (float or torch.Tensor) – Thermostat coupling time \(\tau_T\) in femtoseconds
[M]or scalar. Controls how tightly the thermostat couples to the system; typical values are 10–100 \(\times \Delta t\).chain_length (int, optional) – Number of links in the Nosé-Hoover chain. Default 3.
yoshida_order (int, optional) – Order of the Yoshida-Suzuki integrator. Must be 3 or 5. Default 3.
n_steps (int, optional) – Total steps for
run().hooks (list[Hook], optional) – Initial hooks.
convergence_hook (ConvergenceHook or dict, optional) – Convergence criterion.
**kwargs – Forwarded to
BaseDynamics.
- __needs_keys__#
{"forces"}.- Type:
set[str]
- __provides_keys__#
{"positions", "velocities"}.- Type:
set[str]
- apply_per_system_params(params, batch)[source]#
Rebind target temperature, chain masses, and velocities together.
Unlike Langevin, a Nosé-Hoover chain carries memory: the chain masses
Qare proportional tokT tau^2and the chain velocitieseta_dotare conjugate to them. Rebinding the target without transforming both leaves the thermostat driving toward the old temperature and breaks detailed balance, so all four move together:temperaturetakes the newkT.Qscales bykT_new / kT_old, preservingQ ∝ kT tau^2.eta_dotscales bysqrt(kT_old / kT_new), which keeps the chain kinetic energyQ eta_dot^2 / 2invariant under the mass change rather than injecting or removing thermostat energy.atomic velocities scale by
sqrt(kT_new / kT_old).
etaitself is a position-like variable and is left untouched.- Parameters:
params (Mapping[str, torch.Tensor]) – Must contain
"temperature"in Kelvin per graph, shape[B].batch (Batch) – The live batch;
velocitiesis modified in place.
- Raises:
RuntimeError – If called before the integrator state exists.
KeyError – If params names something this integrator cannot rebind.
- Return type:
None