nvt_vrescale_init¶
- torch_sim.integrators.nvt.nvt_vrescale_init(state, model, *, kT, seed=None, **_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.
- Parameters:
model (ModelInterface) – Neural network model that computes energies and forces. Must return a dict with ‘energy’ and ‘forces’ keys.
state (SimState | dict[Literal['positions', 'masses', 'cell', 'pbc', 'atomic_numbers', 'system_idx'], ~torch.Tensor]) – Either a SimState object or a dictionary 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]
seed (int | None) – Random seed for reproducibility
_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.