torch_sim.integrators

Integrators for molecular dynamics simulations.

This module provides a collection of integrators for molecular dynamics simulations, supporting NVE (microcanonical), NVT (canonical), and NPT (isothermal-isobaric) ensembles. Each integrator handles batched simulations efficiently using PyTorch tensors and supports periodic boundary conditions.

NVE:
  • Velocity Verlet integrator for constant energy simulations nve.nve_step()

NVT:
NPT:

References

[1] Leimkuhler B, Matthews C.2016 Efficient molecular dynamics using geodesic

integration and solvent-solute splitting. Proc. R. Soc. A 472: 20160138

[2] Martyna, G. J., Tuckerman, M. E., Tobias, D. J., & Klein, M. L. (1996).

Explicit reversible integrators for extended systems dynamics. Molecular Physics, 87(5), 1117-1157.

[3] Grønbech-Jensen, N., & Farago, O. (2014).

Constant pressure and temperature discrete-time Langevin molecular dynamics. The Journal of chemical physics, 141(19).

[4] LAMMPS: https://docs.lammps.org/fix_press_langevin.html

Examples

>>> import torch_sim as ts
>>> state = ts.nvt_langevin_init(model, initial_state, kT=300.0 * units.temperature)
>>> for _ in range(1000):
...     state = ts.nvt_langevin_step(
...         model, state, dt=1e-3 * units.time, kT=300.0 * units.temperature
...     )

Notes

All integrators support batched operations for efficient parallel simulation of multiple systems.

Module Attributes

INTEGRATOR_REGISTRY

Integrator registry - maps integrator names to (init_fn, step_fn) pairs.

Classes

Integrator

Enumeration of available molecular dynamics (MD) integrators.

Modules

md

Core molecular dynamics state and operations.

npt

Implementations of NPT integrators.

nve

Implementations of NVE integrators.

nvt

Implementations of NVT integrators.