# Molecular Simulation/Periodic Boundary Conditions

A schematic representation of periodic boundary conditions. The unit cell of the system is in the center cell (pink). The potential energy of the system includes interactions between this center cell and its periodic images.
A schematic representation of the non-bonded interactions treated by the minimum image convention.
Liquids like water can be simulated using Periodic Boundary Conditions (PBC). A unit cell of the liquid is replicated periodically.
Molecular dynamics simulation of hexane in a periodic 30 Å × 30 Å × 30 Å simulation cell. Hydrogen atoms are omitted for clarity.

Macroscopic systems are extremely large and are, therefore, expensive to compute by molecular simulations. For instance, one gram of water has about 3 x 1022 molecules, a number too large to be calculated, even on computers. Fortunately, periodic boundary conditions enable us to mimic an infinite system by treating a relatively small part of a system to achieve a reasonable representation of the infinite system. The particles of this small subsystem are controlled by a set of boundary conditions called a unit cell (e.g., a three-dimensional box). During the simulation, particles are free to move in the central (original) cell; therefore, their periodic images of the adjacent cells move in an identical way. This means any particle that crosses one boundary of the cell, will reappear on the opposite side.

## Non-Bonded Interactions Under Periodic Boundary Conditions

A particle in a periodic cell has non-bonded interactions with the other particles both in the original cell, and also in the surrounding cells (the periodic images of the original cell). The non-bonded potential energy (${\displaystyle {\mathcal {V}}^{NB}}$) can be written as:

${\displaystyle {\mathcal {V}}^{NB}=\sum \limits _{s}^{}{\sum \limits _{i>j}^{}{v_{ij}^{NB}({r_{ij,s}})}}}$

${\displaystyle v_{ij}^{NB}({r_{ij,s}})=4{\varepsilon _{ij}}\left[{{{\left({\frac {\sigma _{ij}}{r_{ij,s}}}\right)}^{12}}-{{\left({\frac {\sigma _{ij}}{r_{ij,s}}}\right)}^{6}}}\right]+{\frac {{q_{i}}{q_{j}}}{r_{ij,s}}}}$

where ${\displaystyle {r_{ij,s}}=\left|{{{\rm {r}}_{i}}-{{\rm {r}}_{j}}+s}\right|}$, and ${\displaystyle {s}}$ is a tranlational vector to different cell images. For a periodic cubic cell of length ${\displaystyle {L}}$, ${\displaystyle {\mathcal {s}}}$ becomes

${\displaystyle s=\left[{\begin{array}{l}{n_{x}}L\\{n_{y}}L\\{n_{z}}L\end{array}}\right]}$

where ${\displaystyle {n_{x}}}$, ${\displaystyle {n_{y}}}$, and ${\displaystyle {n_{z}}}$ are vectors of integers. The number of possible translational vectors, ${\displaystyle {s}}$, are infinite. This will lead us to an infinite number of non-bonded interactions. Thus, we need to perform some approximations to deal with this problem.

The first term of the ${\displaystyle v_{ij}^{NB}({r_{ij,s}})}$ is the Lennard-Jones potential. This potential has an attractive component (${\displaystyle {C_{6}}{r^{-6}}}$) for London dispersion, which is a short range interaction. Accordingly, if the distance between interacting particles increases (i.e., r > 10 Å), the interaction becomes very week. Thus, the interactions can be truncated for distances greater than 10 A. However, the potential will lose its continuity because of the unexpected truncation. This problem can be fixed by employing a switching function, which will smoothly scale down van der Waals interactions to zero at the cutoff distance. For faster computation, pair lists are designed to search for particles that could be inside the cutoff area within a specified range (${\displaystyle r_{pairlistdist}}$ is ~2 Å larger than ${\displaystyle r_{cutoff}}$), and, during the simulation, lists are updated.

The second term of the ${\displaystyle v_{ij}^{NB}({r_{ij,s}})}$ represents the long rang (${\displaystyle {r^{-1}}}$) electrostatic potential, which cannot be truncated the same way as the Lennard-Jones potential. However, the particle mesh Ewald method could be used for treating the long range interaction part.

## Minimum Image Convention

The periodic boundary conditions use the minimum image convention to calculate distances between particles in the system. Let us consider that we have four particles (${\displaystyle i}$, ${\displaystyle j}$, ${\displaystyle k}$, and ${\displaystyle l}$) in a cubic box of length ${\displaystyle L}$. Then, the potential interactions will be calculated between the particle (${\displaystyle i}$) and the nearest periodic images of the other particles (${\displaystyle j}$, ${\displaystyle k}$, and ${\displaystyle l}$). The minimum image convention was first used by Metropolis and coworkers.[1]

## Periodic Boundary Conditions with NAMD

NAMD software requires three cell basis vectors to provide the periodic cell its size and shape: cellBasisVector1, cellBasisVector2, and cellBasisVector3. Each vector is perpendicular to the other two. The coordinates of the center of the periodic cell can be specified by the “cellOrigin” command. In addition, the “wrapAll on” command is usually used to ensure that any particle that crosses the boundary of the original cell will be imaged back into the cell.

## References

1. Metropolis, N.; Rosenbluth, A. W.; Rosenbluth, M. N.; Teller, A. H; Teller, E. J (1953). "Equation of State Calculations by Fast Computing Machines". The Journal of Chemical Physics 21: 1078-1092.