# Your first simulation: DHFR **You will learn:** how to run an NVT molecular-dynamics simulation of [dihydrofolate reductase](https://en.wikipedia.org/wiki/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:** - ACEMD installed (see [Installation](../installation.md)). - An NVIDIA GPU with CUDA-capable drivers, or any GPU with OpenCL. - The benchmark files: {download}`acemd_benchmarks.zip <../acemd_benchmarks.zip>`. ## Step 1 — Unpack the benchmark files Extract the archive and switch into the directory matching your force field: ::::{tab-set} :::{tab-item} CHARMM ```bash 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`. ::: :::{tab-item} AMBER ```bash 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 ::::{tab-set} :::{tab-item} CHARMM ```{code-block} yaml :caption: 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. ::: :::{tab-item} AMBER ```{code-block} yaml :caption: 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](../reference/input-options.md) for the full list. The default time step is 4 fs, which auto-enables hydrogen-mass repartitioning and bond constraints — see [Integrator and constraints](../explanation/integrator-and-constraints.md) for why. ## Step 3 — Start the simulation From inside the directory: ```bash acemd ``` By default ACEMD runs on GPU device 0. To pick a different device, or to use multiple GPUs, see [Select GPU devices](../how-to/select-gpu-devices.md). 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: ```text 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](https://software.acellera.com/moleculekit/howto/wrap-trajectories.html)). - `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 {py:func}`~acemd.acemd.acemd` function takes a directory (the equivalent of `cd`-ing there) and any input-file option as a lowercase keyword: ```python 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: ```python acemd("/tmp/acemd_benchmarks/dhfr_charmm", run="2ns") ``` CLI flags pass through with the same lowercased name: ```python acemd("/tmp/acemd_benchmarks/dhfr_charmm", device=[0, 1], run="2ns") ``` ## Where to go next - Run a [hybrid NNP/MM simulation](../how-to/run-an-nnp-mm-simulation.md) on a small molecule of interest. - Apply [positional restraints](../how-to/use-positional-restraints.md) during equilibration. - Browse the full list of [input options](../reference/input-options.md).