liminfo

LAMMPS Reference

Free reference guide: LAMMPS Reference

26 results

About LAMMPS Reference

The LAMMPS Reference is a searchable cheat sheet for LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator), the open-source molecular dynamics engine developed by Sandia National Laboratories. It covers the essential system setup commands including unit systems (metal for eV/angstrom/ps, real for kcal-mol/angstrom/fs, lj for dimensionless Lennard-Jones), atom styles (atomic for metals, charge for ionic systems, full for organic molecules with bonds and charges), boundary conditions (periodic, fixed, shrink-wrap), lattice types (fcc, bcc, sc, hcp, diamond, custom), region/box creation, and data file reading.

The potentials section documents the most commonly used interatomic force fields: pair_style lj/cut for Lennard-Jones with epsilon/sigma parameters and cutoff distance, pair_style eam/alloy for embedded atom method metal simulations, pair_style tersoff for covalent materials (Si, C, Ge) with three-body interactions, pair_style reaxff for reactive simulations of bond formation/breaking in combustion and corrosion, and pair_style lj/cut/coul/long with kspace_style pppm for long-range electrostatics in ionic and polar systems.

The fix commands section covers statistical ensembles: fix nve for microcanonical (constant N, V, E), fix nvt with Nose-Hoover thermostat for canonical ensemble (temperature control with damping parameter), fix npt for isothermal-isobaric simulations (isotropic and anisotropic pressure), and fix langevin for stochastic temperature control. Additional commands include fix deform for mechanical property calculations via tensile/compression strain, energy minimization (minimize with CG method), velocity initialization from Boltzmann distributions, and output configuration via dump (trajectory), thermo (thermodynamic properties), and compute (RDF, stress/atom, temperature).

Key Features

  • Unit system reference: metal (eV, angstrom, ps), real (kcal/mol, angstrom, fs), lj (dimensionless), and SI with conversion context
  • Atom style selection guide: atomic for metals, charge for ionic, full for organic molecules, molecular for bonded systems
  • Complete potential setup: Lennard-Jones (lj/cut), EAM (eam/alloy), Tersoff, ReaxFF reactive force field, and Coulomb long-range (PPPM)
  • Statistical ensemble fix commands: NVE (microcanonical), NVT (Nose-Hoover), NPT (isothermal-isobaric), and Langevin thermostat
  • Mechanical simulation: fix deform for strain-rate deformation, minimize for energy relaxation with conjugate gradient method
  • System construction: lattice (fcc, bcc, hcp, diamond, custom), region, create_box, create_atoms, read_data, group, and replicate
  • Trajectory and thermodynamic output: dump custom fields (id, type, x, y, z, vx, vy, vz), thermo_style, and compute definitions
  • Velocity initialization from Maxwell-Boltzmann distribution with random seeds and linear momentum zeroing

Frequently Asked Questions

What is LAMMPS and what types of simulations can it perform?

LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) is an open-source molecular dynamics code from Sandia National Laboratories. It can simulate atomic, polymeric, biological, metallic, granular, and coarse-grained systems. Common applications include metal deformation, nanoparticle interactions, polymer dynamics, protein folding, catalysis, and materials failure. LAMMPS runs on single processors or massively parallel HPC clusters using MPI.

How do I choose the right unit system in LAMMPS?

The most common unit systems are: "metal" (eV for energy, angstroms for distance, picoseconds for time, Kelvin for temperature) used for metallic and solid-state simulations; "real" (kcal/mol, angstroms, femtoseconds) used for biological and organic molecular simulations; "lj" (dimensionless Lennard-Jones reduced units) used for fundamental physics studies. The unit system must be set before any other commands as it affects how all numerical values are interpreted. Use "units metal" for EAM potentials and "units real" for CHARMM/AMBER force fields.

What is the difference between pair_style lj/cut, eam/alloy, tersoff, and reaxff?

lj/cut is a simple Lennard-Jones 12-6 potential for van der Waals interactions with epsilon and sigma parameters. eam/alloy is the embedded atom method for metallic bonding, using tabulated potential files (e.g., Cu_Zhou.eam.alloy). tersoff handles directional covalent bonds with three-body angular terms, suitable for Si, C, SiC, and Ge. reaxff is a reactive force field that can model bond formation and breaking during chemical reactions, used for combustion, oxidation, and catalysis simulations. Each requires its own pair_coeff format and potential parameter files.

How do I set up an NVT simulation at 300K in LAMMPS?

Use "fix 1 all nvt temp 300.0 300.0 0.1" where the first 300.0 is the starting temperature, the second 300.0 is the target temperature, and 0.1 is the Nose-Hoover thermostat damping parameter in time units (0.1 ps for metal units, 100 fs for real units). Before running, assign initial velocities with "velocity all create 300.0 12345" (300K Boltzmann distribution, seed 12345) and set the timestep (e.g., "timestep 0.001" = 1 fs in metal units). Then "run 100000" executes 100,000 steps = 100 ps.

What is the difference between NVE, NVT, and NPT ensembles?

fix nve maintains constant number of atoms (N), volume (V), and total energy (E) with no thermostat or barostat. fix nvt adds a Nose-Hoover thermostat to control temperature while keeping volume constant, suitable for equilibration and production runs at fixed cell size. fix npt controls both temperature and pressure, allowing the simulation box to change size, essential for calculating equilibrium density, thermal expansion, and phase transitions. For stochastic temperature control, fix langevin combined with fix nve provides an alternative NVT approach.

How do I perform energy minimization before running MD?

Use "min_style cg" to select conjugate gradient method, then "minimize 1.0e-6 1.0e-8 10000 100000" where 1.0e-6 is the energy tolerance, 1.0e-8 is the force tolerance, 10000 is maximum iterations, and 100000 is maximum force/energy evaluations. Minimization relaxes the atomic structure to a local energy minimum, removing overlaps and high-energy configurations. Always minimize before MD to avoid instabilities. For complex systems, you may need multiple minimize calls or the "min_style fire" (FIRE algorithm) method.

How do I output trajectory and thermodynamic data?

For trajectories: "dump 1 all custom 100 dump.lammpstrj id type x y z vx vy vz" writes atom positions and velocities every 100 steps. For thermodynamics: "thermo 100" sets output frequency, and "thermo_style custom step temp pe ke etotal press vol" selects which properties to print. Use "compute" to define additional quantities like RDF ("compute myrdf all rdf 100 1 1"), per-atom stress ("compute mystress all stress/atom NULL"), or custom temperature calculations for subgroups.

How do I simulate mechanical deformation (tensile test) in LAMMPS?

Use "fix 1 all deform 1 x erate 0.001 remap x" to apply a constant engineering strain rate of 0.001/ps in the x-direction. Combine with fix nvt or fix npt (controlling y and z but not x) to maintain temperature during deformation. Output stress-strain data via "compute mystress all pressure thermo_temp" and "thermo_style custom step lx ly lz pxx pyy pzz". The strain rate should be chosen carefully; typical MD rates (10^8 to 10^10 /s) are much higher than experimental rates due to simulation timescale limitations.