npt_crescale_init¶
- torch_sim.integrators.npt.npt_crescale_init(state, model, *, kT, dt, tau_p=None, isothermal_compressibility=None, seed=None)[source]¶
Initialize the NPT cell rescaling state.
This function initializes a state for NPT molecular dynamics with a cell rescaling barostat. It sets up the system with appropriate initial conditions including particle positions, momenta, and cell variables.
Only allow isotropic external stress, but can run both isotropic and anisotropic cell rescaling.
- Parameters:
state (SimState | dict[Literal['positions', 'masses', 'cell', 'pbc', 'atomic_numbers', 'system_idx'], ~torch.Tensor]) – Initial system state as MDState or dict containing positions, masses, cell, and PBC information
model (
ModelInterface) – Model to compute forces and energieskT (Tensor) – Target temperature in energy units
dt (Tensor) – Integration timestep
tau_p (Tensor | None) – Barostat relaxation time. Controls how quickly pressure equilibrates.
isothermal_compressibility (Tensor | None) – Isothermal compressibility of the system.
seed (int | None) – Random seed for momenta initialization.
- Return type: