openmaterials.ai / codes / OpenMM

OpenMM: GPU molecular dynamics with a Python API and custom forces

A molecular dynamics library whose custom forces and integrators take a mathematical expression and run on CPUs and GPUs with little or no speed loss, now with PyTorch potentials.

What it is and how it works

Forces from an expression

CustomAngleForce('k*(theta-theta0)^2') is a complete new interaction. OpenMM compiles the expression for the CPU or GPU it runs on, often with little or no speed difference from a hand-written force (Eastman 2017).

CPU and GPU platforms

CUDA, OpenCL, HIP and CPU backends, ARM and PowerPC. DHFR with 23,558 atoms runs at 367 ns/day on a Titan X (Eastman 2017) and 1031 ns/day on an AMD V620 (Eastman 2023).

Machine-learned potentials

TorchForce embeds any TorchScript model. MLPotential('ani2x') builds a pure or mixed ML/MM system. NNPOps runs ANI-2x 5.7 times faster than TorchANI (Eastman 2023).

Input pipelines

A PDB file with a ForceField XML, or Amber prmtop, CHARMM, Gromacs and Desmond files. Forces and energies checked against Amber 16, Gromacs and CHARMM (Eastman 2017).

Polarizable force fields

AMOEBA with multipoles to quadrupoles and induced dipoles. DHFR runs at 20.90 ns/day on a Titan X with extrapolated polarization, 10.09 mutual (Eastman 2017).

Sampling and scale

Metadynamics natively or via PLUMED, collective variables from any energy term. A 1,067,095-atom virus runs at 32.3 to 70.9 ns/day on one to four A100s (Eastman 2023).

What people do with it

AlphaFold structure relaxation

Predicted structures relax by gradient descent in Amber99sb with OpenMM 7.3.1. This removes stereochemical violations without loss of accuracy. The CASP14 median is 0.96 Angstrom r.m.s.d.95. Jumper 2021

ColabFold on a single GPU

The AlphaFold2_mmseqs2 notebook relaxes predictions with Amber force fields, citing OpenMM 7. MMseqs2 search is 40 to 60 times faster. One GPU predicts close to 1000 structures a day. Mirdita 2022

SWISS-MODEL homology models

The ProMod3 engine removes clashes and distortions by energy minimization with the OpenMM library and the CHARMM27 force field. The repository holds 1,067,355 SWISS-MODEL models. Waterhouse 2018

How it is used

  1. Load a structure

    PDBFile with ForceField('amber99sbildn.xml', 'tip3p.xml'), or AmberPrmtopFile.

  2. Create the System

    createSystem with PME, a 1 nm cutoff and HBonds constraints (Eastman 2017).

  3. Pick the dynamics

    A Langevin integrator at 300 K (Eastman 2017), MonteCarloBarostat for pressure.

  4. Run and report

    StateDataReporter for temperature and energy, DCDReporter for the trajectory.

  5. Extend

    Custom forces and integrators, TorchForce models or MLPotential mixed systems.