npt_langevin_step¶
- torch_sim.integrators.npt.npt_langevin_step(state, model, *, dt, kT, external_pressure, alpha, cell_alpha, b_tau)[source]¶
Perform one complete NPT Langevin dynamics integration step.
This function implements a modified integration scheme for NPT dynamics, handling both atomic and cell updates with Langevin thermostats to maintain constant temperature and pressure. The integration scheme couples particle motion with cell volume fluctuations.
- Parameters:
model (
ModelInterface) – Neural network model that computes energies, forces, and stress. Must return a dict with ‘energy’, ‘forces’, and ‘stress’ keys.state (
NPTLangevinState) – Current NPT state with particle and cell variablesdt (
torch.Tensor) – Integration timestep, either scalar or shape [n_systems]kT (
torch.Tensor) – Target temperature in energy units, either scalar or shape [n_systems]external_pressure (
torch.Tensor) – Target external pressure, either scalar or tensor with shape [n_systems, n_dim, n_dim]alpha (
torch.Tensor) – Position friction coefficient, either scalar or shape [n_systems]cell_alpha (
torch.Tensor) – Cell friction coefficient, either scalar or shape [n_systems]b_tau (
torch.Tensor) – Barostat time constant, either scalar or shape [n_systems]
- Returns:
- Updated NPT state after one timestep with new positions,
velocities, cell parameters, forces, energy, and stress
- Return type: