Lesson 2.1 · 12 min

Units in MD

Atoms are tiny and fast, so MD codes use special units: ångströms, femtoseconds, kcal/mol. Different codes pick different ones, which makes unit mix-ups one of the most common bugs. Reduced units avoid the problem entirely.

The idea

In SI units, an atom is 10−10 m across, vibrates every 10−14 s, and has an interaction energy of 10−21 J. Numbers like that are awkward, so MD codes use units that fit atoms.

Each code chooses its own. LAMMPS units real uses Å, fs and kcal/mol. units metal uses Å, ps and eV. GROMACS uses nm, ps and kJ/mol. Copy a parameter from one world to the other without converting it, and your forces are off by 4.184 or your distances by 10. The code will not complain. It will simply simulate the wrong system.

Reduced units sidestep all of this. For a Lennard-Jones system we set σ = ε = m = 1 and measure everything relative to them. Then argon, krypton and xenon all become the same simulation. Only at the end do we convert back with each gas's own σ, ε and m. This idea is called the law of corresponding states.

Key idea. Write down the unit of every input before you run. In your own code, use reduced units and convert only when you report results.

The algorithm

Converting a reduced-unit simulation to a real substance:

  1. Look up σ (Å), ε/kB (K) and m (g/mol) for your substance.
  2. Compute the time unit τ = σ√(m/ε). For argon this is about 2.16 ps.
  3. Multiply each reduced result by its unit:
    • T = T*·(ε/kB)
    • t = t*·τ
    • ρ = ρ*·m/σ³
    • P = P*·ε/σ³
    • E = E*·ε
sigma, eps_K, mass = 3.405, 119.8, 39.948      # argon
tau = sigma*1e-10 * sqrt(mass*amu / (eps_K*kB))
T_real  = T_star * eps_K                       # kelvin
dt_real = dt_star * tau                        # seconds

Unit check before every run: list each input (cutoff, ε, σ, charges, Δt, temperature) next to the unit your code expects. Most "my simulation explodes" questions end here.