Appendix B Evaluation of energies and forces
In any Monte Carlo or molecular dynamics calculation of a many-body system, the
most time-consuming step is the evaluation of energies and, when needed, forces. In
this appendix, we will discuss the efficient evaluation of energies and forces for simple
nonpolarizable force fields under periodic boundary conditions.
Let us begin by considering a system described by a typical nonpolarizable force
field as in eqn. (3.11.1). The bonding and bending terms are straightforward and
computationally inexpensive to evaluate; in Fig. 8.8, for instance, weillustrated a
scheme for calculating a dihedral angle for use in the torsional term. (One could also
simply calculate the angle between the planes defined by atoms 1, 2, and 3 and atoms
2, 3, and 4.) By far, the most expensive part of the calculation is theevaluation of the
nonbonded (nb) forces and energies given by the Lennard-Jonesand Coulomb terms:
Unb(r 1 ,...,rN) =
∑
i>j∈nb
{
4 ǫij
[(
σij
rij
) 12
−
(
σij
rij
) 6 ]
+
qiqj
rij
}
. (B.1)
As written, the evaluation of these energies and their associated forces requiresO(N^2 )
operations, a calculation that quickly becomes intractable asNbecomes very large.
Simulations of even small proteins in solution typically require at least 1 04 to 10^5
atoms, while simulations in materials science, such as crack formationand propagation,
can involve up to 10^9 atoms. Many interesting physical and chemical processes such as
these require long time scales to be accessed, and in order to reachthese time scales, a
very large number of energy and force evaluations is needed. Suchcalculations would
clearly not be possible if the quadratic scaling could not be ameliorated. The goal,
therefore, is to evaluate the terms in eqn. (B.1) withO(N), or at worst,O(NlnN),
scaling.
The first thing we see about eqn. (B.1) is that the Lennard-Jones and Coulomb
terms have substantially different length scales. The former is relatively short range
and could possibly be truncated as a means of improving the scaling, but this is
not true of the Coulomb interaction, which is very long range and would, therefore,
suffer from severe truncation artifacts (see, for example, Patraet al.(2003)). Let us
begin, therefore, by examining the Coulomb term more closely. In order to reduce
the computational overhead of the long-range Coulomb interaction, we only need to
recognize that any function we might characterize as long ranged inreal space becomes
short ranged in reciprocal or Fourier space. Moreover, since we are dealing with a
periodic system, a Fourier representation is entirely appropriate.Therefore, we can
tame the Coulomb interaction by dividing it into a contribution that is short ranged