Lesson 1.2 · 12 min

Atoms and forces: the Lennard-Jones potential

Two neutral atoms still feel each other: a gentle pull when they are near, a hard push when they overlap. One simple curve captures both.

The idea

Argon atoms have no charge, yet argon still turns into a liquid when it is cold enough. Something must hold the atoms together.

When two atoms are far apart, they hardly notice each other. A bit closer, the electron clouds of each atom shift slightly and create tiny, fluctuating dipoles that attract each other. This is the van der Waals (dispersion) pull. If they come too close, the electron clouds overlap and a very strong repulsion pushes them apart.

The Lennard-Jones potential puts all of this into one curve V(r), the energy of the pair at distance r. It has just two numbers:

The bottom of the well, at r ≈ 1.12σ, is where the push and pull balance and the force is zero. Atoms in a liquid or solid jiggle around this distance.

Key idea. The force is the slope of the energy curve. Downhill to the left of the minimum means push, uphill to the right means pull. An MD code only needs this one rule, applied to every pair of atoms.

The algorithm

To get the force on every atom, add up the Lennard-Jones force from every other atom:

  1. Set all forces to zero.
  2. Loop over every pair i < j, so each pair is counted once.
  3. Find the distance vector d = ri − rj and its length r.
  4. If r is larger than the cutoff (usually 2.5σ), skip the pair. The force there is almost zero.
  5. Compute the force size F(r) and add F·d/r to atom i.
  6. Subtract the same amount from atom j. Newton's third law: equal and opposite.
forces = zeros(N, 3)
for i in range(N):
    for j in range(i + 1, N):
        d = pos[i] - pos[j]
        r = length(d)
        if r < r_cut:
            f = F(r) * d / r      # vector along the line between the atoms
            forces[i] += f
            forces[j] -= f

This double loop costs about N²/2 pair checks. That is fine for a few hundred atoms. Lesson 2.6 shows how neighbour lists make it much faster.