npt_nose_hoover_init

torch_sim.integrators.npt.npt_nose_hoover_init(state, model, *, kT, dt, chain_length=3, chain_steps=2, sy_steps=3, t_tau=None, b_tau=None, **kwargs)[source]

Initialize the NPT Nose-Hoover state.

This function initializes a state for NPT molecular dynamics with Nose-Hoover chain thermostats for both temperature and pressure control. It sets up the system with appropriate initial conditions including particle positions, momenta, cell variables, and thermostat chains.

To seed the RNG set state.rng = seed before calling.

Parameters:
  • model (ModelInterface) – Model to compute forces and energies

  • state (SimState) – Initial system state as SimState containing positions, masses, cell, and PBC information

  • kT (float | Tensor) – Target temperature in energy units

  • external_pressure – Target external pressure

  • dt (float | Tensor) – Integration timestep

  • chain_length (int) – Length of Nose-Hoover chains. Defaults to 3.

  • chain_steps (int) – Chain integration substeps. Defaults to 2.

  • sy_steps (int) – Suzuki-Yoshida integration order. Defaults to 3.

  • t_tau (float | Tensor | None) – Thermostat relaxation time. Controls how quickly temperature equilibrates. Defaults to 100*dt

  • b_tau (float | Tensor | None) – Barostat relaxation time. Controls how quickly pressure equilibrates. Defaults to 1000*dt

  • **kwargs (Any) – Additional state variables like atomic_numbers or pre-initialized momenta

Returns:

Initialized state containing:
  • Particle positions, momenta, forces

  • Cell position, momentum and mass (all with batch dimensions)

  • Reference cell matrix (with batch dimensions)

  • Thermostat and barostat chain variables

  • System energy

  • Other state variables (masses, PBC, etc.)

Return type:

NPTNoseHooverState

Notes

  • Uses separate Nose-Hoover chains for temperature and pressure control

  • Cell mass is set based on system size and barostat relaxation time

  • Initial momenta are drawn from Maxwell-Boltzmann distribution if not provided

  • Cell dynamics use logarithmic coordinates for volume updates

  • All cell properties are properly initialized with batch dimensions