Energies and forces 663
Ulong(r 1 ,...,rN) =
1
V
∑
g∈S
4 π
|g|^2
e−|g|
(^2) / 4 α 2
|S(g)|^2 −
α
√
π
∑
i
qi^2. (B.19)
Eqn. (B.19) is known as theEwald sumfor the long-range part of the Coulomb inter-
action (Ewald, 1921). The second term in eqn. (B.19) is known as theself-interaction
correction since it cancels out thei=jterm, which describes a long-range interac-
tion of a particle with itself. The error that results when the secondreciprocal-space
sum in eqn. (B.15) is extended over all of Fourier space can be compensated for by
multiplying the last term by erfc(gmax/ 2 α).
Although the sum in eqn. (B.19) is more efficient to evaluate than the double sum
in eqn. (B.12), two important technical problems remain. First, the|S(g)|^2 factor in
eqn. (B.19) leads to an interaction betweenallcharged particles. Unfortunately, if a
system contains molecules, then charged particles involved in common bond, bend, or
torsional interactions must not also have a charge–charge interaction, as these are built
into the intramolecular potential energy function. Therefore, these unwanted Coulomb
interactions need to be excluded from the Ewald sum. One way to solve this problem
is to add these unwanted terms with the opposite sign in real space so that they
become new contributions to the intramolecular potential and approximately cancel
their reciprocal-space counterparts. If this is done, eqn. (B.19)becomes
Ulong(r 1 ,...,rN) =
1
V
∑
g∈S
4 π
|g|^2
e−|g|
(^2) / 4 α 2
|S(g)|^2
−
∑
i,j∈intra
qiqjerf(αrij)
rij
−
α
√
π
∑
i
q^2 i, (B.20)
where “intra” denotes the full set of bonded interactions. The second term in eqn.
(B.20) can, therefore, be incorporated into the bonded terms in eqn. (3.11.1). Eqn.
(B.20) is straightforward to implement, but because we are attempting to achieve the
cancellation in real space rather than in Fourier space, the cancellation is imperfect.
Indeed, Procacciet al.(1998) showed that better cancellation is achieved if the ex-
cluded interactions are corrected using a reciprocal-space expression that accounts for
reciprocal-space truncation. In particular, these authors showed that the excluded in-
teractions can be computed more precisely if an additional correction is added, which
is given by
Ucorr(r 1 ,...,rN) =
∑
i,j∈intra
qiqjχ(rij,gmax) +
α
√
π
erfc(gmax/ 2 α)
∑
i
qi^2 , (B.21)
where
χ(r,gmax) =
2
π
∫∞
gmax
dge−g
(^2) / 4 α (^2) sin(gr)
gr
. (B.22)
An important technical point about the form of the Ewald sum is thatit causes
the potential to acquire an explicit volume dependence. Thus, whencalculating the
pressure or performing simulations in theNPTensemble, it becomes necessary to use
the pressure estimators in eqns. (4.6.58) and (5.7.29).