Computational-chemistry-agent-skills lammps-reaxff
Run reactive molecular dynamics simulations in LAMMPS with the ReaxFF potential, including preparing input scripts (pair_style reaxff + fix qeq/reaxff), mapping LAMMPS atom types to elements via pair_coeff, choosing ensembles (NVE/NVT/NPT), and adding common ReaxFF diagnostics such as species analysis. Use when the user wants LAMMPS+ReaxFF workflows or needs a working, annotated `input.lammps` template.
install
source · Clone the upstream repo
git clone https://github.com/jinzhezenggroup/computational-chemistry-agent-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jinzhezenggroup/computational-chemistry-agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/molecular-dynamics/lammps-reaxff" ~/.claude/skills/jinzhezenggroup-computational-chemistry-agent-skills-lammps-reaxff && rm -rf "$T"
manifest:
molecular-dynamics/lammps-reaxff/SKILL.mdsource content
LAMMPS + ReaxFF
Use this skill when the user wants to run molecular dynamics in LAMMPS with a ReaxFF force field, prepare or explain an
input.lammps file, and set up charge equilibration (QEq) correctly.
Agent responsibilities
- Confirm the ReaxFF force field file (e.g.
). Do not guess which file is appropriate.ffield.reax.*- If the user does not have a force field yet, point them to known sources (e.g. LAMMPS
at https://github.com/lammps/lammps/tree/develop/potentials).potentials/ffield.reax.*
- If the user does not have a force field yet, point them to known sources (e.g. LAMMPS
- Confirm the structure/data file (e.g.
) and the atom type → element mapping needed bydata.system
.pair_coeff - Ensure the input includes charge handling:
- Use a charge-capable atom style, such as
oratom_style charge
, and ensure charges are initialized either from the data file (with a charge column compatible with the chosenatom_style full
) or via explicit commands (e.g.atom_style
or equal-style variables). Do not rely onset
as a substitute for a real charge field used by ReaxFF/QEq.fix property/atom q - Add one charge equilibration fix, typically
, unless the user explicitly requests otherwise.fix qeq/reaxff
- Use a charge-capable atom style, such as
- Write the LAMMPS input script yourself; keep examples readable and annotated.
- When possible, validate command availability against LAMMPS docs or local
output before execution.lmp -h - Report clearly which command was run, which files were used, and where outputs were written.
Minimum information to collect
Ask only for what is missing:
- LAMMPS data file path (or structure + how to generate a data file)
- ReaxFF force field file path (
)ffield.reax... - Atom types present and their element mapping (for
)pair_coeff * * ffield ... - Ensemble (NVE / NVT / NPT)
- Temperature, pressure (if NPT), timestep, run length
- Execution mode: online provisioning vs user-specified LAMMPS binary
Execution mode
Online mode (only if internet access + uv
is available)
uvUse:
uvx --from 'lammps[mpi]' lmp -in input.lammps
Notes:
- If you see
, you likely installed an MPI-linkederror while loading shared libraries: libmpi.so...
without MPI runtime libraries. Preferlmp
(bundles MPI runtime), or load/install MPICH/OpenMPI via system packages/conda/HPC module.uvx --from 'lammps[mpi]' ...
Offline mode (common / HPC)
Do not invent the executable. Ask which command should be used, e.g.:
lmp -in input.lammpsmpirun -np 32 lmp_mpi -in input.lammpssrun lmp -in input.lammps
Example: annotated NVT input (ReaxFF + QEq)
See also
assets/input.reaxff.nvt.lammps.
# --------- user knobs --------- variable NSTEPS equal 200000 variable THERMO equal 200 variable DUMP equal 1000 variable TEMP equal 300.0 variable TAU_T equal 100.0 # Timestep (fs for units real). For high-T / reactive runs, 0.1 fs is often safer. variable DT equal 0.25 # QEq parameters variable QEQ_EVERY equal 1 variable QEQ_TOL equal 1.0e-6 variable QEQ_CUTLO equal 0.0 variable QEQ_CUTHI equal 10.0 units real boundary p p p atom_style charge read_data data.system neighbor 2.0 bin neigh_modify every 1 delay 0 check yes # ReaxFF potential pair_style reaxff NULL pair_coeff * * ffield.reax C H O # Charge equilibration (required for most ReaxFF parameterizations) fix fqeq all qeq/reaxff ${QEQ_EVERY} ${QEQ_CUTLO} ${QEQ_CUTHI} ${QEQ_TOL} reaxff # (`reaxff` here means QEq parameters are extracted from the ReaxFF force field file.) # Thermo and trajectory thermo_style custom step temp pe ke etotal press vol density thermo ${THERMO} dump 1 all custom ${DUMP} traj.lammpstrj id type q x y z # Dynamics velocity all create ${TEMP} 12345 mom yes rot yes dist gaussian fix fnvt all nvt temp ${TEMP} ${TEMP} ${TAU_T} timestep ${DT} run ${NSTEPS}
Notes on the example
is a common choice for ReaxFF (time in fs). Many published ReaxFF workflows useunits real
, but the correct choice depends on the parameterization and your conventions.real- Timestep:
may be fine for moderate temperatures, but for high-temperature ReaxFF (especially with H present) it is common to reduce to0.25 fs
(or even0.1 fs
if needed). A quick sanity check is a short NVE segment to verify total-energy drift before running long NVT/NPT.0.05 fs
is used because ReaxFF and QEq require per-atom charges.atom_style charge
uses default ReaxFF control settings. If you have a ReaxFF control file, replacepair_style reaxff NULL
with its filename.NULL
:pair_coeff * * ffield.reax C H O- The trailing symbols define the element mapping for LAMMPS atom types (type 1->C, type 2->H, type 3->O in this example). Adjust to match your data file.
uses QEq parameters extracted from the ReaxFF force field file.fix qeq/reaxff ... reaxff
Sanity checks (recommended before long runs)
- Short NVE stability check (no thermostat/barostat)
- Run 1–5 ps NVE and check that
drift is reasonable (and that the run does not blow up).etotal
Example (
units real):
reset_timestep 0 unfix fnvt fix fnve all nve # high-T ReaxFF often needs a smaller timestep # (common choices: 0.1 fs; if needed 0.05 fs) timestep 0.1 run 2000
- If it blows up: reduce timestep (e.g. 0.25 fs → 0.1 fs → 0.05 fs), check the initial geometry, and ensure QEq converges.
- QEq convergence
- If QEq hits max iterations often, consider better initial charges, looser timestep, or
(see LAMMPSmaxiter
).fix qeq/reaxff
Optional: species analysis
If the user wants reaction product tracking, add
fix reaxff/species (see references/reaxff-workflow.md). This writes time series counts of detected molecular species using bond-order cutoffs.
Output checklist
After a run, report at least:
- executed command
- input script path
- data file path
- ffield path and element mapping used
- whether QEq was enabled and with which settings
- main log path (
)log.lammps - trajectory/species output paths (if any)
References
- pair_style reaxff: https://docs.lammps.org/pair_reaxff.html
- fix qeq/reaxff: https://docs.lammps.org/fix_qeq_reaxff.html
- fix reaxff/species: https://docs.lammps.org/fix_reaxff_species.html