nvt_vrescale_init¶
- torch_sim.integrators.nvt.nvt_vrescale_init(state, model, *, kT, **_kwargs)[source]¶
Initialize an NVT state from input data for velocity rescaling dynamics.
Creates an initial state for NVT molecular dynamics using the canonical sampling through velocity rescaling (CSVR) thermostat. This thermostat samples from the canonical ensemble by rescaling velocities with an appropriately chosen random factor.
To seed the RNG set
state.rng = seedbefore calling.- Parameters:
model (ModelInterface) – Neural network model that computes energies and forces. Must return a dict with ‘energy’ and ‘forces’ keys.
state (SimState) – SimState containing positions, masses, cell, pbc, and other required state vars
kT (float | Tensor) – Temperature in energy units for initializing momenta, either scalar or with shape [n_systems]
_kwargs (Any)
- Returns:
- Initialized state for NVT integration containing positions,
momenta, forces, energy, and other required attributes
- Return type:
Notes
The initial momenta are sampled from a Maxwell-Boltzmann distribution at the specified temperature. The V-Rescale thermostat provides proper canonical sampling through stochastic velocity rescaling.