PLUMED: Enhanced Sampling and Free Energy Calculations for Materials Science MD
Molecular dynamics (MD) simulations excel at capturing atomic-scale dynamics, but they face a fundamental limitation: the timescales accessible to brute-force MD (nanoseconds to microseconds) are orders of magnitude shorter than many materials processes of interest—phase transitions, diffusion across grain boundaries, nucleation events, and conformational changes in polymers. PLUMED (Public Library of Unbiased Metadynamics) is an open-source plugin that addresses this challenge by implementing enhanced sampling algorithms and free energy methods directly within popular MD engines, including LAMMPS and GROMACS.
What PLUMED Does
PLUMED acts as a middleware layer between the MD engine and the simulation physics. It intercepts the atomic positions at each timestep, computes user-defined collective variables (CVs)—low-dimensional descriptors that capture the slow degrees of freedom—and applies bias potentials or reweighting schemes to accelerate sampling of rare events. The result is statistically rigorous free energy surfaces (FES) and transition rates that would be inaccessible to unbiased MD.
Key capabilities include:
- Metadynamics and Well-Tempered Metadynamics: Iteratively deposits Gaussian hills along CV trajectories to discourage revisiting already-sampled configurations, driving the system over free energy barriers.
- Umbrella Sampling with WHAM: Applies harmonic restraints along a CV and combines windows via the Weighted Histogram Analysis Method to reconstruct the FES.
- Replica Exchange (REMD) and Parallel Tempering Metadynamics (PTMetaD): Combines temperature ladders with metadynamics for multi-dimensional free energy exploration.
- Funnel Metadynamics: Restricts sampling to a funnel-shaped region, dramatically improving convergence for binding and adsorption problems.
- On-the-fly Probability Enhanced Sampling (OPES): A newer, more robust alternative to metadynamics that targets a well-defined target distribution and converges more reliably.
Collective Variables for Materials Problems
The power of PLUMED lies in its extensive CV library, which covers both geometric and order-parameter-based descriptors:
| CV Type | Materials Application |
|---|---|
| Coordination numbers | Crystallization, dissolution, surface reconstruction |
| Steinhardt Q6 order parameter | Distinguishing liquid, FCC, BCC, HCP phases |
| Torsion angles / dihedral sums | Polymer chain conformations, grain boundary structure |
| Path CVs (s, z) | Diffusion pathways, dislocation motion |
| Deep-LDA / machine-learned CVs | Complex phase transitions without prior knowledge |
| RMSD from reference | Defect migration, amorphization tracking |
For example, to study the nucleation of an FCC crystal from a supercooled melt, one would define a CV based on the average Steinhardt Q6 parameter across all atoms. PLUMED then biases this CV with metadynamics, allowing the system to cross the nucleation barrier and map the full free energy landscape from liquid to crystalline nucleus.
Integration with LAMMPS and GROMACS

PLUMED integrates via a patch mechanism. For LAMMPS, the fix plumed command loads the PLUMED library and passes atomic positions and forces at each step:
fix myplumed all plumed plumedfile plumed.dat outfile plumed.out
The plumed.dat input file defines CVs and actions in PLUMED's own scripting language:
# Define coordination number of atom 1 with its neighbors
cn: COORDINATION GROUPA=1 GROUPB=2-500 R_0=2.8
# Well-tempered metadynamics along cn
metad: METAD ARG=cn PACE=500 HEIGHT=1.2 SIGMA=0.05 BIASFACTOR=10 TEMP=1000 FILE=HILLS
# Print CV and bias to file
PRINT ARG=cn,metad.bias FILE=COLVAR STRIDE=100
For GROMACS, the equivalent setup uses gmx mdrun with the -plumed plumed.dat flag after patching the GROMACS source with plumed patch -p.
Free Energy Surface Analysis
After a metadynamics run, the accumulated Gaussian hills stored in the HILLS file are summed to reconstruct the FES. PLUMED provides the sum_hills utility:
plumed sum_hills --hills HILLS --outfile fes.dat --mintozero

The resulting FES reveals the relative stability of different phases or configurations, transition state locations, and free energy barriers. For a grain boundary diffusion study, this might show the activation energy for a vacancy hop as a function of distance from the boundary core—information that is impossible to extract from short unbiased MD runs.
Practical Workflow for Materials Scientists
A typical PLUMED-enhanced materials study follows this workflow:
- Equilibrate the system with standard MD (LAMMPS or GROMACS) to obtain a well-relaxed starting configuration.
- Identify slow CVs using short unbiased runs, OVITO analysis, or domain knowledge (e.g., Q6 for crystallization, coordination number for dissolution).
- Run well-tempered metadynamics with conservative hill heights (0.5–2 kJ/mol) and a bias factor of 10–30, monitoring convergence via the FES evolution.
- Validate convergence by checking that the FES no longer changes significantly between successive deposition intervals.
- Reweight the biased trajectory using
REWEIGHT_METADorREWEIGHT_BIASto recover unbiased ensemble averages of any observable. - Visualize the FES and representative configurations using OVITO or VMD.
Performance and Scalability
PLUMED adds minimal overhead to MD runs—typically 5–15% for simple CVs—because CV computation is parallelized across MPI ranks. More complex CVs (e.g., machine-learned descriptors using PyTorch via pytorch_model) can increase overhead to 30–50%, but the sampling acceleration more than compensates. PLUMED also supports GPU-accelerated CV computation through its interface with LAMMPS's Kokkos backend.

Getting Started
PLUMED is freely available at https://www.plumed.org under the LGPL license. The project maintains an extensive Masterclass tutorial series covering metadynamics, OPES, and machine-learned CVs. The PLUMED-NEST repository hosts over 1,000 community-contributed input files from published studies, providing ready-to-adapt templates for common materials problems.
For practitioners already using LAMMPS or GROMACS, adding PLUMED to the workflow requires only recompiling the MD engine with the PLUMED patch and writing a plumed.dat input file—a modest investment that unlocks access to free energy landscapes that would otherwise require months of unbiased simulation time.
Further Reading
- PLUMED Official Documentation
- PLUMED-NEST: Community Input Files
- Tribello et al., Comput. Phys. Commun. 185, 604–613 (2014) — original PLUMED 2 paper
- Invernizzi & Parrinello, J. Phys. Chem. Lett. 11, 2731–2736 (2020) — OPES method
- PLUMED Masterclass Tutorials