npt_crescale_anisotropic_step¶
- torch_sim.integrators.npt.npt_crescale_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 kinetic energy. Positions and momenta are scaled when scaling the cell.
Inspired from: https://github.com/bussilab/crescale/blob/master/simplemd_anisotropic/simplemd.cpp - Time reversible integrator - Instantaneous kinetic energy (not not the average from equipartition)
- Parameters:
model (
ModelInterface) – Model to compute forces and energiesstate (
NPTCRescaleState) – Current system statedt (
torch.Tensor) – Integration timestepkT (
torch.Tensor) – Target temperatureexternal_pressure (
torch.Tensor) – Target external pressuretau (
torch.Tensor | None) – V-Rescale thermostat relaxation time. If None, defaults to 100*dt
- Returns:
Updated state after one integration step
- Return type: