nvalchemi.dynamics.NPH#

class nvalchemi.dynamics.NPH(model, dt, pressure, barostat_time, pressure_coupling='isotropic', n_steps=None, hooks=None, convergence_hook=None, **kwargs)[source]#

Isenthalpic-isobaric (NPH) integrator via MTK barostat.

Temperature fluctuates; enthalpy H = E + PV is conserved.

Parameters:
  • model (BaseModelMixin) – The neural network potential model. Must produce "stress" output in addition to forces.

  • dt (float or torch.Tensor) – Integration timestep in femtoseconds [M] or scalar.

  • pressure (float or torch.Tensor) – Target pressure [M] (isotropic), [M, 3] (anisotropic), or [M, 3, 3] (triclinic). Scalar is broadcast to [M] isotropic.

  • barostat_time (float or torch.Tensor) – Barostat coupling time \(\tau_P\) in femtoseconds [M] or scalar.

  • pressure_coupling ({"isotropic", "anisotropic", "triclinic"}) – Pressure control mode. Default "isotropic".

  • n_steps (int, optional) – Total steps for run().

  • hooks (list[Hook], optional) – Initial hooks.

  • convergence_hook (ConvergenceHook or dict, optional) – Convergence criterion.

  • **kwargs – Forwarded to BaseDynamics.

__needs_keys__#

{"forces", "stress"}.

Type:

set[str]

__provides_keys__#

{"positions", "velocities", "cell"}.

Type:

set[str]

post_update(batch)[source]#

Velocity half → barostat half (symmetric closure).

Parameters:

batch (Batch) – Current batch; velocities updated in-place.

Return type:

None

pre_update(batch)[source]#

Barostat half → velocity half → position full → cell full.

Parameters:

batch (Batch) – Current batch; positions, velocities, and cell updated in-place.

Return type:

None