nvt_langevin_init

torch_sim.integrators.nvt.nvt_langevin_init(state, model, *, kT, **_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.

To seed the RNG set state.rng = seed before 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:

MDState

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.