Code

GPUMD

Molecular dynamics on GPUs with neuroevolution potentials.

openmaterials.ai / codes / GPUMD

GPUMD: trains neuroevolution potentials and runs molecular dynamics on one GPU

A molecular dynamics code written in CUDA for GPUs from the start, with its own machine-learned potential (NEP) trained and run in the package, and heat transport on the fly.

What it is and how it works

The neuroevolution potential

A one-hidden-layer network on a Chebyshev radial and angular descriptor, trained by the SNES evolutionary algorithm in the nep executable. It runs at about 1e7 atom steps per second on one V100 GPU (Fan 2022).

Forces without write conflicts

One thread per atom sums force, virial and heat current from a pairwise force expression, with no write conflicts. One K40 GPU matched LAMMPS on 100 cores (Fan 2017).

Heat transport on the fly

Green-Kubo (compute_hac), HNEMD (compute_hnemd) and NEMD with Langevin heat baths, plus spectral (compute_shc) and modal (compute_hnema) decompositions (Xu 2025).

Ensembles and integrators

NVE, NVT and NPT with Berendsen, Nose-Hoover chain, Bussi-Donadio-Parrinello and Langevin thermostats, MTTK barostats, MSST shock, path-integral MD (Xu 2025).

Two executables, four files

nep trains from nep.in and train.xyz. gpumd runs from run.in and model.xyz, both extended XYZ. Also Tersoff, Stillinger-Weber, EAM and hiphive force constants (Xu 2025).

Python tools

calorine and PyNEP expose NEP as ASE calculators. gpyumd writes inputs and parses outputs. NEP_CPU runs NEP models on CPUs and provides the LAMMPS interface (Xu 2025).

What people do with it

  • 1.5e7NEP3 atom steps per second on one A100 GPUFan 2022
  • about 100CPU cores of LAMMPS matched by one K40, TersoffFan 2017
  • 63 meV/ANEP3 force RMSE on the MgAlCu alloy data setFan 2022

Rotated MoS2 films, through-plane heat

Measured through-plane conductivity 57 mW/m/K and anisotropy ratio near 900. HNEMD in GPUMD showed kappa dropping from 3.7 to 0.16 W/m/K from bulk to rotated MoS2 at 300 K (Kim 2021). Kim 2021

Heat conductivity of liquid water

A NEP fitted to SCAN DFT data, with an HNEMD spectral quantum correction, gives 0.60 W/m/K at 300 K against 0.89 classical, in agreement with NIST data from 275 K to 500 K (Xu 2023). Xu 2023

Source-sink conductance in graphene NEMD

NEMD in GPUMD matches the ballistic AGF conductance of graphene, 12.2 GW/m2/K classical, when Delta T is taken between source and sink. Langevin baths beat Nose-Hoover chains (Li 2019). Li 2019

How it is used

  1. Collect reference data

    Convert DFT outputs to extended XYZ train.xyz with vasp2xyz, cp2k2xyz or similar tools.

  2. Train the NEP

    Set cutoffs, descriptor sizes, loss weights and generations in nep.in. Run nep: nep.txt.

  3. Build the model

    Write model.xyz in extended XYZ with calorine or gpyumd, or by hand.

  4. Run the MD

    In run.in: potential nep.txt, velocity, ensemble, time_step, compute_hnemd or compute_hac.

  5. Analyse the outputs

    Read thermo.out, hac.out and the compute files into Python with calorine or gpyumd.

What GPUMD is, how it works and what it is used for, from the papers listed as sources. Every number links to its paper.Poster pageDownload the poster (PNG, 1920 x 1080)

What GPUMD is

GPUMD runs molecular dynamics on GPUs with many-body and machine-learned potentials. It trains and runs neuroevolution potentials (NEP), and computes thermal transport with the Green-Kubo, homogeneous nonequilibrium (HNEMD) and nonequilibrium (NEMD) methods. It also decomposes the heat current spectrally. On the map it serves the heat current, its autocorrelation, the thermal conductivities derived from them, the NEP fit errors, and the molecular dynamics observables listed below.

In more detail

Many-body forces, virial and heat current on the GPU

GPUMD evaluates many-body potentials through an explicit pairwise force expression. Each atom is one CUDA thread, which accumulates its own force, virial and heat current in a single loop, so no atomic operations are needed (Fan 2017). In the 2017 benchmark on silicon with up to 2,744,000 atoms the speed saturates above 1e5 atoms. Single-precision Stillinger-Weber reached 25 ns per day for 1e6 atoms with a 2 fs step on a Tesla K40, and the double-precision Tersoff speed equalled LAMMPS on about 100 Xeon X5670 cores (Fan 2017). The 2025 release holds about 85,000 lines of CUDA C++ and has been adapted to HIP (Xu 2025).

The neuroevolution potential

NEP is a feed-forward network with one hidden layer on a descriptor whose radial functions are linear combinations of Chebyshev basis functions and whose angular terms add four- and five-body contributions as in the atomic cluster expansion (Fan 2022). The separable natural evolution strategy (SNES) fits the parameters to a loss of energy, force and virial RMSEs with L1 and L2 penalties. On the carbon test set, NEP (4.2 A) reaches 42 meV/atom, 690 meV/A and 160 meV/atom for energy, force and virial at 3,600 atom steps per ms on one V100, against 290 for DP (se2) and 280 for REANN (3 A) (Fan 2022). NEP89, a foundation model for nearly the whole periodic table, ships with GPUMD 4.0 (Xu 2025).

Heat transport methods

GPUMD has three built-in routes. Equilibrium MD uses the Green-Kubo relation on the heat current autocorrelation (compute_hac), HNEMD applies a homogeneous driving force (compute_hnemd), and NEMD uses heat source and sink thermostats (ensemble heat_lan and others). Conductivity and conductance decompose spectrally (compute_shc) and by mode (compute_hnema) (Xu 2025). In the 2022 example, five HNEMD runs of 2 ns each gave 5.1 +/- 0.1 W/(m K) for amorphous carbon at 3.0 g/cm3 and 300 K (Fan 2022). Li 2019 used GPUMD to show that NEMD should report the conductance from the source-sink temperature difference and should use Langevin thermostats (Li 2019).

Files and Python tools

Compilation produces two executables, nep and gpumd (Xu 2025). nep reads nep.in and train.xyz and writes the potential file nep.txt and the loss history in loss.out. gpumd reads run.in and model.xyz and writes thermo.out, hac.out and the other compute outputs (Fan 2022). calorine offers ASE calculators, input and output functions for GPUMD files, and relaxation, phonon and elastic calculations. gpyumd prepares inputs and parses outputs. PyNEP adds descriptor analysis and farthest-point sampling for training sets. NEP_CPU runs the same models on CPUs and inside LAMMPS. The nep-data repository collects published training sets (Xu 2025).

What it computes on the map

13 quantities, drawn by tier with the data flow between them. Dashed boxes are intermediate quantities. Select one for its formula and the other codes that compute it.

Open the full mapShare this submap
Embed this submap
<iframe src="https://openmaterials.ai/m/c56731602651/8000000001fa020700000000000008?embed=1" title="GPUMD on the OpenMaterials map" width="100%" height="480" loading="lazy" style="border:1px solid #EBEBEB;border-radius:6px"></iframe>

Each quantity with the interface the representation records.

  • HeatCurrentrun.in: compute_hac <step1> <step2> <Nc> (writes hac.out, J(t) implicit)
  • HeatCurrentACFrun.in: compute_hac <Ns> <Nc> <out_steps> → hac.out
  • InterfaceConductance[transport_model=nemd]run.in: ensemble heat_lan <T> <T_coup> <delta_T> <label_source> <label_sink> + compute 0 <sample_interval> <output_interval> temperature → compute.out
  • MeanSquaredDisplacementrun.in: compute_msd <Nc> <output_interval> → msd.out
  • Potentialnep.txt (default) | EAM/Tersoff/SW potential file referenced from run.in
  • PotentialEnergyFitErrornep, prediction 1 added to the training nep.in, held-out set as train.xyz: energy_train.out, RMSE of column 1 (predicted) vs column 2 (reference), eV/atomev_per_atom
  • PotentialForceFitErrornep, prediction 1 added to the training nep.in, held-out set as train.xyz: force_train.out, RMSE over the 3 pairs (columns 1-3 predicted vs 4-6 reference) of every row, eV/AeV_per_A
  • PotentialUncertaintyExceedance[method=committee_force_spread]run.in: one potential line per committee member (the first drives the MD), then active <check_interval> 0 0 0 <sigma>; fraction of the active.out rows written by this run whose column 2 exceeds sigmadimensionless
  • PotentialVirialFitErrornep, prediction 1 added to the training nep.in, held-out set as train.xyz: virial_train.out, RMSE over the 6 pairs (columns 1-6 predicted vs 7-12 reference), skipping rows whose reference is -1e6 (structure without a virial or stress label), eV/atomev_per_atom
  • ThermalConductivity[transport_model=green_kubo]hac.out (columns kappa_xx, kappa_yy, kappa_zz vs t)
  • ThermalConductivity[transport_model=hnemd]kappa.out (columns kappa_xx, kappa_xy, ..., kappa_zz vs t)
  • Trajectoryrun.in: dump_position <interval>
  • VelocityAutocorrelationrun.in: compute_dos <Nc> <Nw> <max_omega> → mvac.out + dos.out

Releases on record

Versions on record for this code, with the license read from the release itself.

VersionReleasedLicense
3.9.52024-08-18GPL-3.0-or-later

References

The code

The papers that describe the code; cite them when you use it.

  1. Z. Fan, W. Chen, V. Vierimaa et al., Efficient molecular dynamics simulations with many-body potentials on graphics processing units, Computer Physics Communications, 2017. doi.org/10.1016/j.cpc.2017.05.003
  2. Z. Fan, Y. Wang, P. Ying et al., GPUMD: A package for constructing accurate machine-learned potentials and performing highly efficient atomistic simulations, The Journal of Chemical Physics, 2022. doi.org/10.1063/5.0106617
  3. K. Xu, H. Bu, S. Pan et al., GPUMD 4.0: A high‐performance molecular dynamics package for versatile materials simulations with machine‐learned potentials, Materials Genome Engineering Advances, 2025. doi.org/10.1002/mgea.70028

Methods and inputs it builds on

The methods the code implements and the inputs it relies on, as published.

  1. Z. Fan, L. F. C. Pereira, H. Q. Wang et al., Force and heat current formulas for many-body potentials in molecular dynamics simulations with applications to thermal conductivity calculations, Physical Review B, 2015. doi.org/10.1103/PhysRevB.92.094301
  2. Z. Fan, H. Dong, A. Harju et al., Homogeneous nonequilibrium molecular dynamics method for heat transport and spectral decomposition with many-body potentials, Physical Review B, 2019. doi.org/10.1103/PhysRevB.99.064308
  3. Z. Fan, Z. Zeng, C. Zhang et al., Neuroevolution machine learning potentials: Combining high accuracy and low cost in atomistic simulations and application to heat transport, Physical Review B, 2021. doi.org/10.1103/PhysRevB.104.104309
  4. T. Liang, K. Xu, E. Lindgren et al., NEP89: universal neuroevolution potential for inorganic and organic materials across 89 elements, Nature Computational Science, 2026. doi.org/10.1038/s43588-026-01009-6

Applications

Highly cited studies that cite the code, with a few picked by hand.

  1. H. Dong, Z. Fan, L. Shi et al., Equivalence of the equilibrium and the nonequilibrium molecular dynamics methods for thermal conductivity calculations: From bulk to nanowire silicon, Physical Review B, 2018. doi.org/10.1103/PhysRevB.97.094305
  2. Z. Li, S. Xiong, C. Sievers et al., Influence of thermostatting on nonequilibrium molecular dynamics simulations of heat conduction in solids, The Journal of Chemical Physics, 2019. doi.org/10.1063/1.5132543
  3. X. Gu, Z. Fan, H. Bao et al., Revisiting phonon-phonon scattering in single-layer graphene, Physical Review B, 2019. doi.org/10.1103/PhysRevB.100.064306
  4. S. E. Kim, F. Mujid, A. Rai et al., Extremely anisotropic van der Waals thermal conductors, Nature, 2021. doi.org/10.1038/s41586-021-03867-8
  5. K. Xu, Y. Hao, T. Liang et al., Accurate prediction of heat conductivity of water by a neuroevolution potential, The Journal of Chemical Physics, 2023. doi.org/10.1063/5.0147039
  6. K. Song, R. Zhao, J. Liu et al., General-purpose machine-learned potential for 16 elemental metals and their alloys, Nature Communications, 2024. doi.org/10.1038/s41467-024-54554-x

How to cite

Z. Fan, W. Chen, V. Vierimaa, A. Harju, Efficient molecular dynamics simulations with many-body potentials on graphics processing units, Comput. Phys. Commun. 218, 10 (2017)

doi.org/10.1016/j.cpc.2017.05.003