What it simulates
OpenMM runs classical molecular dynamics from Python. You give it a structure, a force field and an integrator. It minimises the energy, then integrates Newton's equations with a Langevin thermostat. Atoms interact through the AMBER or CHARMM force fields, and PME handles long-range electrostatics in periodic boxes.
The recipe wraps this in one helper script. Input is a PDB file with hydrogens and, for a periodic run, a CRYST1 box line. Output is a final PDB, a DCD trajectory and a CSV log of energies.
The key assumption is a fixed-charge force field with rigid bonds to hydrogen. Bonds do not break, and the PDB must already contain every hydrogen.
When to use it
- Short runs of a solvated structure when you want Python control of every step.
- Custom forces and integrators, and GPU speed in a native install.
- Checking a structure with two force fields.
Alternatives: GROMACS is faster for long runs of large biomolecular systems once you have a .tpr. LAMMPS handles non-biomolecular systems and custom pair potentials.
Install it yourself
OpenMM 8.6.1 from conda-forge. A dry run resolved openmm 8.6.1 (Python 3.14 build, 270 MB in total):
conda install -c conda-forge openmm=8.6.1
python -m openmm.testInstallation
The second command lists the platforms OpenMM can use. The minimal Python script follows the steps in the OpenMM user guide, and the helper makes the same calls:
import openmm as mm, openmm.app as app, openmm.unit as u
pdb = app.PDBFile("water.pdb")
ff = app.ForceField("amber14-all.xml", "amber14/tip3p.xml")
system = ff.createSystem(pdb.topology, nonbondedMethod=app.PME,
nonbondedCutoff=0.9*u.nanometer, constraints=app.HBonds)
integ = mm.LangevinMiddleIntegrator(300*u.kelvin, 1/u.picosecond, 2*u.femtosecond)
sim = app.Simulation(pdb.topology, system, integ)
sim.context.setPositions(pdb.positions)
sim.minimizeEnergy()
sim.reporters.append(app.DCDReporter("traj.dcd", 500))
sim.step(5000)