npt_crescale_average_anisotropic_step

torch_sim.integrators.npt.npt_crescale_average_anisotropic_step(state, model, *, dt, kT, external_pressure, tau=None)[source]

Perform one NPT integration step with cell rescaling barostat.

This function performs a single integration step for NPT dynamics using a cell rescaling barostat. It updates particle positions, momenta, and the simulation cell based on the target temperature and pressure.

Trotter based splitting: 1. Half Thermostat (velocity scaling) 2. Half Update momenta with forces 3. Barostat (cell rescaling) 4. Update positions (from barostat + half momenta) 5. Update forces with new positions and cell 6. Compute forces 7. Half Update momenta with forces 8. Half Thermostat (velocity scaling)

Only allow isotropic external stress. This method performs anisotropic cell rescaling. Lengths and angles can change independently. Based on pressure using average kinetic energy from equipartition theorem. Only positions are scaled when scaling the cell.

Inspired from: https://github.com/bussilab/crescale/blob/master/simplemd_anisotropic/simplemd.cpp - Time reversible integrator - Average kinetic energy, scaling only positions

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

  • state (NPTCRescaleState) – Current system state

  • dt (torch.Tensor) – Integration timestep

  • kT (torch.Tensor) – Target temperature

  • external_pressure (torch.Tensor) – Target external pressure

  • tau (torch.Tensor | None) – V-Rescale thermostat relaxation time. If None, defaults to 100*dt

Returns:

Updated state after one integration step

Return type:

NPTCRescaleState