Cell lists
From Wikipedia, the free encyclopedia
Cell lists (also sometimes referred to as cell linked-lists) is a data structure in molecular dynamics simulations to find all atom pairs within a given cut-off distance of each other. These pairs are needed to compute the short-range non-bonded interactions in a system, such as Van der Waals forces or the short-range part of the electrostatic interaction when using Ewald summation.

Cell lists work by subdividing the simulation domain into cells with an edge length greater than or equal to the cut-off radius of the interaction to be computed. The particles are sorted into these cells and the interactions are computed between particles in the same or neighbouring cells.
In its most basic form, the non-bonded interactions for a cut-off distance are computed as follows:
- for all neighbouring cell pairs do
- for all do
- for all do
- if then
- Compute the interaction between and .
- end if
- end for
- for all do
- end for
- for all do
- end for
Since the cell length is at least in all dimensions, no particles within of each other can be missed.
Given a simulation with particles with a homogeneous particle density, the number of cells is proportional to and inversely proportional to the cut-off radius (i.e. if increases, so does the number of cells). The average number of particles per cell therefore does not depend on the total number of particles. The cost of interacting two cells is in . The number of cell pairs is proportional to the number of cells which is again proportional to the number of particles . The total cost of finding all pairwise distances within a given cut-off is in , which is significantly better than computing the pairwise distances naively.
Periodic boundary conditions
In most simulations, periodic boundary conditions are used to avoid imposing artificial boundary conditions. Using cell lists, these boundaries can be implemented in two ways.
Ghost cells

In the ghost cells approach, the simulation box is wrapped in an additional layer of cells. These cells contain periodically wrapped copies of the corresponding simulation cells inside the domain.
Although the data—and usually also the computational cost—is doubled for interactions over the periodic boundary, this approach has the advantage of being straightforward to implement and very easy to parallelize, since cells will only interact with their geographical neighbours.
Periodic wrapping
Instead of creating ghost cells, cell pairs that interact over a periodic boundary can also use a periodic correction vector . This vector, which can be stored or computed for every cell pair , contains the correction which needs to be applied to "wrap" one cell around the domain to neighbour the other. The pairwise distance between two particles and is then computed as
- .
This approach, although more efficient than using ghost cells, is less straightforward to implement (the cell pairs need to be identified over the periodic boundaries and the vector needs to be computed/stored).