nvt_langevin_init¶
- torch_sim.integrators.nvt.nvt_langevin_init(state, model, *, kT, seed=None, **_kwargs)[source]¶
Initialize an NVT state from input data for Langevin dynamics.
Creates an initial state for NVT molecular dynamics by computing initial energies and forces, and sampling momenta from a Maxwell-Boltzmann distribution at the specified temperature.
- 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. This provides a proper thermal initial state for the subsequent Langevin dynamics.