npt_crescale_triclinic_step¶
- torch_sim.integrators.npt.npt_crescale_triclinic_step(state, model, *, dt, kT, external_pressure, tau=None)[source]¶
Perform one NPT integration step with anisotropic stochastic cell rescaling.
Implements the anisotropic C-Rescale barostat from Del Tatto et al. (2022) [7] extending the isotropic scheme of Bernetti & Bussi (2020) [6]. Cell lengths and angles can change independently. Uses instantaneous kinetic energy. Both positions and momenta are scaled.
Trotter splitting:
V-Rescale(dt/2) -> B(dt/2) -> Barostat(dt) -> Force eval -> B(dt/2) -> V-Rescale(dt/2)
Barostat sub-steps (3-step volume + deformation update):
Step 1 – Propagate \(\sqrt{V}\) for \(\Delta t/2\) (same SDE as isotropic, Eq. 7 of [6]):
\[\Delta\lambda = -\frac{\beta_T\lambda}{2\tau_p} \left(P_0 - \frac{\text{Tr}(\mathbf{P}_{\text{int}})}{3} - \frac{k_BT}{2V}\right)\frac{\Delta t}{2} + \sqrt{\frac{k_BT\beta_T\Delta t}{4\tau_p}}\;R\]Step 2 – Compute deviatoric deformation matrix:
\[\begin{split}\tilde{\mathbf{A}} &= \frac{\beta_T}{3\tau_p} \left(\mathbf{P}_{\text{int}} - \frac{\text{Tr}(\mathbf{P}_{\text{int}})}{3}\,\mathbf{I}\right) \\ \boldsymbol{\mu}_{\text{dev}} &= \exp\bigl(\tilde{\mathbf{A}}\,\Delta t + \sigma\,\tilde{\mathbf{R}}\bigr)\end{split}\]where \(\sigma = \sqrt{2\beta_T k_BT\Delta t/(3\tau_p)}\;/\;\sqrt{V'}\) and \(\tilde{\mathbf{R}}\) is a traceless random matrix.
Step 3 – Propagate \(\sqrt{V}\) for \(\Delta t/2\) (same as step 1).
Total scaling and update:
\[\begin{split}\boldsymbol{\mu} &= \boldsymbol{\mu}_{\text{dev}} \cdot (V'/V)^{1/3} \\ \mathbf{r}_i &\leftarrow \boldsymbol{\mu}\,\mathbf{r}_i + (\boldsymbol{\mu}^{-T} + \boldsymbol{\mu})\, \frac{\mathbf{p}_i}{2m_i}\,\Delta t \\ \mathbf{p}_i &\leftarrow \boldsymbol{\mu}^{-T}\,\mathbf{p}_i \\ \mathbf{h} &\leftarrow \mathbf{h}\,\boldsymbol{\mu}^T\end{split}\]Variable mapping (equation -> code):
- Parameters:
model (ModelInterface) – Model to compute forces and energies
state (NPTCRescaleState) – Current system state
external_pressure (float | Tensor) – Target external pressure
tau (float | Tensor | None) – V-Rescale thermostat relaxation time. If None, defaults to 100*dt
- Returns:
Updated state after one integration step
- Return type:
References