Your first simulation: DHFR#

You will learn: how to run an NVT molecular-dynamics simulation of dihydrofolate reductase (DHFR) — a small globular protein widely used as an MD benchmark — from prepared force-field files, both from the command line and from Python. The same system is shown with CHARMM and AMBER topologies side-by-side; pick whichever your build pipeline produces.

Prerequisites:

Step 1 — Unpack the benchmark files#

Extract the archive and switch into the directory matching your force field:

unzip acemd_benchmarks.zip -d /tmp/
cd /tmp/acemd_benchmarks/dhfr_charmm

The directory contains a PSF topology (dhfr.psf), a .prm parameter file, a starting PDB, and an input.yaml.

unzip acemd_benchmarks.zip -d /tmp/
cd /tmp/acemd_benchmarks/dhfr_amber

The directory contains a PRMTOP topology (dhfr.prmtop) — which carries both topology and parameters — a starting PDB, and an input.yaml.

Step 2 — Inspect the input file#

input.yaml#
parameters: dhfr.prm
structure: dhfr.psf
coordinates: dhfr.pdb
boxsize: [62.23, 62.23, 62.23]
thermostat: true
run: 28ns
  • structure / parameters — CHARMM topology + force-field parameters.

  • coordinates — starting positions (the topology has no coordinates).

  • boxsize — orthogonal box, 62.23 Å on a side.

  • thermostat: true — turn on the Langevin thermostat at the default 298.15 K.

  • run: 28ns — total simulation time. Time units (fs, ps, ns, us) or a raw integer step count are both accepted.

input.yaml#
structure: dhfr.prmtop
coordinates: dhfr.pdb
boxsize: [62.23, 62.23, 62.23]
thermostat: true
run: 28ns
  • structure — PRMTOP carries both topology and parameters, so there’s no separate parameters line.

  • coordinates — starting positions.

  • boxsize — orthogonal box, 62.23 Å on a side.

  • thermostat: true — turn on the Langevin thermostat at the default 298.15 K.

  • run: 28ns — total simulation time.

Everything else is left at the default — see Input options for the full list.

The default time step is 4 fs, which auto-enables hydrogen-mass repartitioning and bond constraints — see Integrator and constraints for why.

Step 3 — Start the simulation#

From inside the directory:

acemd

By default ACEMD runs on GPU device 0. To pick a different device, or to use multiple GPUs, see Select GPU devices.

While the run progresses ACEMD streams a log to stdout and writes the same values to output.csv. Trajectory frames go to output.xtc, and a binary checkpoint is written to restart.chk every trajectoryperiod steps so you can resume on the same hardware.

Step 4 — Inspect the output#

After the run completes the directory contains the original input files plus:

output.coor  output.csv   output.vel   output.xsc   output.xtc   restart.chk
  • output.coor, output.vel, output.xsc — final positions, velocities, and box from the last frame.

  • output.xtc — trajectory frames (unwrapped — atoms can drift outside the initial box; see How to wrap a trajectory).

  • output.csv — energies, temperature, pressure, and timings per logged step.

  • restart.chk — checkpoint for resuming with restart: true.

Step 5 — Run it from Python instead#

ACEMD 4.0 introduced a Python API. The acemd() function takes a directory (the equivalent of cd-ing there) and any input-file option as a lowercase keyword:

from acemd import acemd

acemd("/tmp/acemd_benchmarks/dhfr_charmm")  # or .../dhfr_amber

Keyword arguments override the on-disk input.yaml — useful for running a sweep without editing files:

acemd("/tmp/acemd_benchmarks/dhfr_charmm", run="2ns")

CLI flags pass through with the same lowercased name:

acemd("/tmp/acemd_benchmarks/dhfr_charmm", device=[0, 1], run="2ns")

Where to go next#