32
Supporting Information for Manuscript “Staggered Mesh Ewald: An extension of the Smooth Particle-Mesh Ewald method adding great versatility” David S. Cerutti ,, Robert E. Duke ,, Thomas A. Darden , and Terry P. Lybrand June 9, 2009 Center for Structural Biology, Department of Chemistry, Vanderbilt University 5142 Medical Research Building III, 465 21st Avenue South, Nashville, TN 37232-8725 Department of Chemistry, University of North Carolina Campus Box 3290, Chapel Hill, NC 27599-0001 Laboratory of Structural Biology, National Institute of Environmental Health Science Research Triangle Park, 12 Davis Drive, Chapel Hill, NC 27709-5900 Open Eye Scientific Software 9 Bisbee Court, Suite D, Santa Fe, NM 87508-1338 To whom correspondence should be addressed. Phone: (615) 936-3569. Fax: (615) 936-2211. Email: [email protected] 1

Supporting Information for Manuscript “Staggered Mesh

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Supporting Information for Manuscript “Staggered Mesh

Supporting Information for Manuscript “Staggered Mesh Ewald: An

extension of the Smooth Particle-Mesh Ewald method adding great

versatility”

David S. Cerutti †,∗, Robert E. Duke ⊕,♦, Thomas A. Darden , and Terry P. Lybrand †

June 9, 2009

† Center for Structural Biology, Department of Chemistry, Vanderbilt University 5142 Medical

Research Building III, 465 21st Avenue South, Nashville, TN 37232-8725

⊕ Department of Chemistry, University of North Carolina

Campus Box 3290, Chapel Hill, NC 27599-0001

♦ Laboratory of Structural Biology, National Institute of Environmental Health Science

Research Triangle Park, 12 Davis Drive, Chapel Hill, NC 27709-5900

Open Eye Scientific Software

9 Bisbee Court, Suite D, Santa Fe, NM 87508-1338

∗ To whom correspondence should be addressed. Phone: (615) 936-3569. Fax: (615) 936-2211.

Email: [email protected]

1

Page 2: Supporting Information for Manuscript “Staggered Mesh

1 A simple metric for the accuracy of Ewald mesh methods

The text of the manuscript focuses heavily on the merits of different approaches to computing Ewald

sums. In order to fully appreciate the advantages of each method, it is important to understand the

relationships between the various parameters. In defining these relationships, we can make an important

point about how the overall accuracy of an Ewald calculation can be limited by either the direct space or

reciprocal space part of the calculation. Moreover, in Ewald mesh methods, the relationships between

Lcut, Dtol, and µ imply a tradeoff between the accuracy of the direct and reciprocal space parts of

the calculation. To clarify these relationships, we will first show how the reciprocal space calculation

computes the interactions of a set of Gaussian charges, distributed so as to resemble the system of

interest, which the direct space calculation then modifies to recover the interactions of charges in the

actual system of interest. We will then examine the way in which Lcut and Dtol determine σ, the spread

of the Gaussian charges.

In a typical Ewald calculation (regular or mesh-based), the smoothed charge density is computed

by smearing a system of point charges (or otherwise highly localized charges) into spherical Gaussians

of the form:

ρ (r) =q

(2πσ2)3/2exp

(−|r− r0|22σ2

)

(S.1)

where q is the magnitude of the original point charge, r is a position in space, r0 is the center of the

Gaussian charge and the location of the actual point charge, and σ defines the width of the Gaussian.

The interaction of two Gaussian charges i and j separated by a distance of rij, similar to the expressions

in Equation 1 of the main text, is:

u (|rij |) = erf(β|rij |)/|rij | (S.2)

where erf is the error function. In these expressions, the “Ewald coefficient” β is closely related to σ:

β =1

2σ(S.3)

Assuming for simplicity that the simulation cell is large enough that direct space interactions are only

significant for charges separated by less than half the box length and that no pairwise interactions are

excluded (electrostatic interactions are excluded between bonded atoms in typical molecular mechanics

models), the energy of a periodic system of Gaussian charges is given by:

E(rec) =1

2πV

k 6=0

exp(

−π2k2/β2)

k2S (k)S (−k) (S.4)

2

Page 3: Supporting Information for Manuscript “Staggered Mesh

where V is the unit cell volume, k is the frequency vector in reciprocal space and S(k) is the structure

factor, a complex exponential. (Note that k = 0 is omitted, removing from consideration any net charge

the system may possess.) Operationally, E(rec) is computed in reciprocal space, using the summation

above. However, E(rec) can also be written in terms of quantities in real space:

E(rec) =1

2

(

Q · Φ(rec))

dV =1

2

Q ·(

Q ⋆ θ(rec))

dV (S.5)

where ⋆ represents a convolution. The integrals can be computed as sums of Q ·Φ(rec) over all reciprocal

space mesh points. We will describe the “reciprocal space pair potential” θ(rec) in more detail later,

but for the present discussion we emphasize that the form of θ(rec) reflects the infinite lattice of the

system’s periodic images and, at short range, has a form very much like Equation S.2.

In contrast to the reciprocal space sum, the direct space energy of the system is given by:

E(dir) =1

2

N∑

i,j 6=i

qiqjerfc (β|ri − rj|)|ri − rj |

(S.6)

Here, erfc(|r|) = 1− erf(|r|) is the complementary error function. Equation S.6 describes the difference

between the interaction of two point charges qi and qj and the interaction of two Gaussian charges

located at the same positions as qi and qj with width σ and charges opposite to those of qi and qj.

Equations S.5 and S.6 show how the direct space sum modifies the reciprocal space sum to recover the

interactions of a periodic system of point charges from the potential computed for a similar system of

smeared charges.

In principle, the Gaussian charges spread throughout all space, but the density of each charge

spread beyond about eight σ is so small that it cannot contribute to the electrostatic potential in even

double-precision floating-point arithmetic; this is the range at which two Gaussian charges interact as

if they were point charges and it is absolutely unnecessary to evaluate the direct space interactions.

While it would be feasible to compute the direct space force due to all interactions up to eight σ,

the accuracy of other parts of the model and practical limitations on computational resources make it

desirable to omit direct space interactions more aggressively. This is the rationale behind the direct

sum tolerance Dtol, related to σ by:

Dtol =erfc

(

Lcut

)

Lcut(S.7)

Simply put, σ is chosen as the maximum possible Gaussian width such that the interaction energy of

two Gaussian charges placed Lcut from one another and the interaction energy of two point charges at

the same positions differ by no more than a factor of Dtol.

3

Page 4: Supporting Information for Manuscript “Staggered Mesh

In summary, omission of interactions is the source of error in the direct space part of an Ewald

calculation. Improved accuracy can be obtained by lowering Dtol, but with the same value of Lcut this

implies a narrower Gaussian spread for the smoothed charge density. Because the fundamental source

of error in the reciprocal space part of an Ewald mesh calculation is the fact that the pair potentials

due to narrow Gaussians do not map precisely to the mesh, this implies a tradeoff between accuracy

in the direct and reciprocal space parts of the calculation. We can therefore rate the performance of

an Ewald mesh method in terms of the necessary ratio of σ to µ needed achieve a particular accuracy

of forces in the reciprocal space part of the calculation. This is done for our new method, as well as

for SPME with different orders of interpolation, in the Results.

2 An analysis of why Staggered Mesh Ewald obtains accurate forces

and precise estimates of the energy and virial

In the Results, we showed that Staggered Mesh Ewald (StME) offers significant enhancements in

accuracy over the original Smooth Particle Mesh Ewald (SPME) method for a variety of simulation

cell geometries and a range of values for µ, Dtol, Lcut, and interpolation order. While Chen and co-

workers [1] and Hockney and Eastwood [2] have provided analysis of why mesh staggering suppresses

distortions in the interactions of the aliases of particles on a mesh, here we will develop a straightforward

numerical description of the error cancellation specific to the SPME method.

We will first give a detailed description of the SPME reciprocal space calculation, then use this

discussion to illuminate the fundamental source of the errors involving self image forces: the operations

for transmitting information between the particles and the mesh. Next, we will extend the analysis to

cover pair interaction force errors, and then discuss why StME produces precise yet biased estimates

of the energy and virial tensor.

2.1 The Smooth Particle Mesh Ewald Reciprocal Space Calculation

The SPME reciprocal space calculation can be summarized in three steps: mapping charges to the

mesh, convoluting the resulting charge density with the Ewald pair potential to obtain the electro-

static potential, and interpolating forces from the electrostatic potential using the derivatives of the

charge density. We will review these operations using some of the notation provided in the original

4

Page 5: Supporting Information for Manuscript “Staggered Mesh

communication describing the SPME method [3], but our indexing subscripts will differ.

In the first stages of the reciprocal space part of an SPME calculation, a set of point charges is

mapped to a mesh Q using Cardinal B-splines [4]. Assuming that the spline interpolation does not map

charges more than halfway across the mesh (4th order interpolation will map a charge to a region of 4

× 4 × 4 mesh points on a mesh of Ga ×Gb ×Gc points), a system’s ith charge qi makes the following

contribution to the mesh-based charge density Q:

Q (ra, rb, rc) = qiMn (ua − ra)Mn (ub − rb)Mn (uc − rc) (S.8)

Here, ra, rb, and rc are integers denoting points on the mesh in its a b and c dimensions and Mn is

an nth order B-spline. The values ua, ub, and uc are the “mesh bin coordinates” of qi as described

in Figure 1 of the main text, closely related to the bin displacements ξa, ξb, and ξc. Throughout this

discussion, ra, rb, and rc will be used to describe a mesh point in real space, whereas ka, kb, and kc

will be used to describe mesh points in reciprocal space.

The electrostatic potential Φ due to charge density on a periodic mesh can easily be obtained by

computing the fourier transform of the charge density F(Q), dividing by the magnitude of the frequency

vector in reciprocal space, and then computing the inverse fourier transform:

Φ = F−1

[ F (Q)

4πε0k2

]

(S.9)

Above, ε0 is the vacuum permittivity and k2 = k2a + k2

b + k2c is the squared magnitude of the reciprocal

space frequency vector k. However, the goal of the reciprocal space calculation is not the electrostatic

potential of the system of point charges but rather the potential of a system of Gaussian (smoothed)

charges. In the limit of an infinitely fine mesh, this smoothed charge density could be obtained by

convoluting Q with a Gaussian of width σ, which is determined by Lcut and Dtol as discussed in

Equations S.1 and S.7. By the convolution theorem, the convolution of functions f and g can also be

done using fourier transforms:

f ⋆ g = F−1 [F (f) · F (g)] (S.10)

The convolution could therefore be done as part of the electrostatic potential computation:

Φ = F−1

[F (Q) · F (ρ)

4πε0k2

]

(S.11)

Above, ρ is the Gaussian smoothing function described in Equation S.1. In the original SPME pre-

sentation [3], the normalization by the vacuum permittivity, division by k2, and multiplication by the

5

Page 6: Supporting Information for Manuscript “Staggered Mesh

transformed Gaussian smoothing function are all folded into the real-valued mesh C. In order to com-

pute the potential for a mesh that is not infinitely fine, however, the splining operations used to create

Q must be taken into account. This is also done in reciprocal space using the squared magnitudes of

Euler exponential splines packed into another real-valued mesh B. Together, B and C define what is

termed the “reciprocal space pair potential” θ(rec) = F−1(B · C). The reciprocal space electrostatic

potential Φ(rec) is therefore computed by:

Φ(rec) = F−1 [F (Q) · B · C] = Q ⋆ θ(rec) (S.12)

where ⋆ denotes a convolution.

As with any Poisson calculation, the reciprocal space energy of the system Erec is then given by

the potential energy of the charge density Q in the electrostatic potential Φ(rec):

E(rec) =1

2

(

Q · Φ(rec))

dV (S.13)

where the integration runs over the unit cell volume V (a sum of Q · Φ(rec) over all mesh points) and

the factor of 1/2 appears because all interactions are inherently double-counted in the mesh-based

calculation. Note that, in practice, E(rec) is computed by Equation S.4, but we use the form above in

our discussion of how StME obtains accurate forces and precise values of E(rec).

The force on the ith charge is given by differentiating E(rec) with respect to the position of the ith

charge:

∂E(rec)

∂ri=

∂ri

(

Q · Φ(rec))

dV =

∫(

∂Q

∂riΦ(rec)

)

dV +

(

∂Φ(rec)

∂rα,iQ

)

dV (S.14)

The derivative of a convolution of two functions is equal to the convolution of either function with the

derivative of the other. Because the function B · C has no dependence on the positions of particles,

neither does θ(rec), which implies that Φ(rec) has zero derivative with respect to the positions of particles

and so the second term on the right hand side of Equation S.14 is zero. The force on the ith charge

therefore depends only on the derivative of Q with respect to the position of each charge, given by the

derivatives of the B-splines originally used to map qi to Q:

∂E(rec)

∂ra,i= qi

Ga∑

ga=0

Gb∑

gb=0

Gc∑

gc=0

[

dMn (ua − ga)

duaMn (ub − gb)Mn (uc − gc) Φ(rec) (ga, gb, gc)

]

∂E(rec)

∂rb,i= qi

Ga∑

ga=0

Gb∑

gb=0

Gc∑

gc=0

[

Mn (ua − ga)dMn (ub − gb)

dubMn (uc − gc) Φ(rec) (ga, gb, gc)

]

6

Page 7: Supporting Information for Manuscript “Staggered Mesh

∂E(rec)

∂rc,i= qi

Ga∑

ga=0

Gb∑

gb=0

Gc∑

gc=0

[

Mn (ua − ga)Mn (ub − gb)dMn (uc − gc)

ducΦ(rec) (ga, gb, gc)

]

(S.15)

Above, we have switched from integrals over the volume to sums over all mesh points to emphasize

how the forces are obtained in practice. The three box dimensions are denoted a, b, and c, while ga,

gb, and gc are restricted to integers. As in Figure 1 of the main text, ua, ub, and uc are the mesh bin

coordinates, which can take on any real value between 0 and the number of mesh points Ga, Gb, or Gc.

This discussion holds if the bin vectors va, vb, and vc are non-orthogonal, but modifications must be

made in such a case so as to ultimately obtain forces in the x, y, and z directions.

2.2 Origin of the self image forces

The origin of the sinusoidal form for the self image forces F(si) can be traced to Φ(rec) and the form of

the B-splines themselves. As we show this, we will also develop expressions to explain the apparent in-

dependence of the three components of F(si) and present ways for rapidly ascertaining an approximation

to correct the self image forces in simulations of diffuse plasmas.

An nth order B-spline may be defined by the recursion:

Mn (u) =u

n− 1Mn−1 (u) +

n− u

n− 1Mn−1 (u− 1) (S.16)

The recursion is terminated by defining M2(u) = 1 − |u − 1| for 0 ≤ u ≤ 2 and M2(u) = 0 otherwise.

The derivative of an nth order B-spline is then:

d

duMn (u) = Mn−1 (u) −Mn−1 (u− 1) (S.17)

A 4th order B-spline is plotted in Figure S1, along with its derivative. The shape of the B-spline

derivative appears to give an indication of the origin of the self image force F(si). However, it is

important to note that to calculate the force on a particle in any particular direction the derivative of

the nth order B-spline will be sampled at n points. For any bin displacement ξ ∈ [0, 1], the B-spline

and its derivative will be sampled at points ξ, ξ + 1, ..., ξ + n− 1 and B-splines have the properties:

n−1∑

p=0

Mn (ξ + p) = 1

n−1∑

p=0

d

duMn (ξ + p) = 0 (S.18)

7

Page 8: Supporting Information for Manuscript “Staggered Mesh

Therefore, the B-spline derivative itself cannot give rise to F(si); the form of Φ(rec) used in the inter-

polation must also be considered. For instance, if Φ(rec) is constant across the mesh points used to

interpolate forces for some charge qi, which it is in the limit of highly smoothed charges and a very fine

mesh, F(si) would be zero.

We therefore modified the PMEMD code to intercept and print the electrostatic potential Φ(rec)

at the end of the reciprocal space calculation. For a test case, we returned to simple ion experiments

in the 64A cubic “test cell” described at the beginning of the Results. We placed a single +1e ion

at various points along the x axis (the ion’s y and z coordinates were both zero). Figure S2 shows

how displacing the particle from a mesh grid point, that is giving it a nonzero ξ in one or more mesh

dimensions, leads to asymmetry in the charge mesh Q. This asymmetry is unavoidable, but comparing

Figures S2 and S3 confirms that an asymmetry in Q does not lead to significant asymmetry in the

resulting electrostatic potential if the mesh spacing µ is sufficiently small. (In Figure 10 of the main

text, this distance was shown to be about (2/3)σ, and σ for this example σ is roughly 1.4A.) Even if µ

is roughly equal to σ, however, averaging results from two meshes staggered by 0.5µ along the x-axis

can lead to a smoother “effective potential” which offers another clue as to StME’s ability to reduce

F(si). It is also important to note that the overall shape of the electrostatic potential in Figures S2

and S3 is roughly the same whether µ = 0.667A or µ = 1.333A. Essentially, the self image force F(si)

appears to be a consequence of large changes in the value of Φ(rec) between adjacent mesh points.

Figures S2 and S3 add to our understanding of the origin of the self image forces, but they do not

fully explain why the errors obtained from two meshes staggered by 0.5µ would cancel to the extent

that they do. It is also not immediately clear why using only one additional mesh staggered in all

three dimensions at once gives results as good or better than using up to three additional meshes, each

staggered along a different dimension.

To answer these questions, we broke down Φ(rec) into contributions from each mesh point of Q.

This was done by modifying the PMEMD code to form a hypothetical charge mesh which was zero

everywhere except for a value of +1e at (0, 0, 0), and then intercepting the resulting Φ(rec). Formally,

the electrostatic potential obtained in this manner is simply θ(rec). While it is not exactly a spherically

symmetric potential, Figure S4 shows that (in the case of this cubic unit cell) θ(rec)(ga, gb, gc) is practi-

cally a single-valued function of r = |gaµa + gbµb + gcµc| for r less than the radius of some sphere that

can be enclosed by the simulation cell.

8

Page 9: Supporting Information for Manuscript “Staggered Mesh

While it is important to note that θ(rec) has a dependence on the unit cell size at long range, at

short range it depends strongly on the mesh spacing µ. Figure S4 shows θ(rec) for µ = 1.333A as

well as µ = 0.667A. The plot for µ = 0.667A is very close to the converged form of θ(rec) in the limit

of very small mesh spacing (in this unit cell, θ(rec) for µ = 0.333A has a value of 117 kcal/mol-e at

ga = gb = gc = 0). The short-range dependence of θ(rec) on µ is crucial for reproducing the correct

electrostatic potential Φ(rec). As can be seen in Figures S2 and S3, a fine mesh with µ = 0.667A and

a coarse mesh with µ = 1.333A produce roughly the same shape and magnitude of Φ(rec) near the

location of a charged particle. Inspection of Figure S4 shows that as µ increases it drives up the values

of θ(rec) for small values of r. The effect is to over-emphasize the effect that a mesh point in Q has

on the nearby points of Φ(rec) and reduce its contributions to points further away. Recalling that the

value of θ(rec)(0, 0, 0) for an extremely fine mesh in this unit cell is approximately 117 kcal/mol-e and

assuming that (for an extremely fine mesh) θ(rec) is roughly constant nearby, a mesh with µ = 1.333A

will compute Φ(rec)(ga, gb, gc) by over-emphasizing the contributions of the charge at Q(ga, gb, gc) by

20% and over-emphasizing the contributions of the charge on the six nearest neighbor mesh points

by 8%. Physically, this is necessary because the charge of the particle is being mapped to the mesh

according to Equation S.8, which is independent of the mesh spacing. As µ increases, θ(rec) must

compensate for charges being spread out over larger regions of space.

Knowledge of θ(rec) is very helpful for understanding how StME achieves higher accuracy in forces

because it allows us to decompose Φ(rec) into contributions from individual points in the mesh Q. The

electrostatic potential at any point can be therefore be computed as a summation over θ(rec) weighted

by Q. Formally, this is simply a restatement of the convolution Q ⋆ θ(rec):

Φ(rec) (ga, gb, gc) =

Ga∑

ma=0

Gb∑

mb=0

Gc∑

mc=0

[

Q (ma,mb,mc) · θ(rec)(

g′a, g′b, g

′c

)

]

(S.19)

where g′α = gα − gα if 0 ≤ gα − mα < Gα and g′α = gα − mα + Gα otherwise, for α ∈ a, b, c. In

other words, Φ(rec) can be constructed from Q by summing the contributions from charges at all mesh

points with θ(rec) as the tabulated pair potential. To evaluate Φ(rec) at all points in this manner would

require O(G2aG

2bG

2c) operations, but again Ewald mesh methods make use of Fast Fourier Transforms

to accomplish the convolution in O(GaGbGclog(GaGbGc)) operations. When evaluating the self image

forces and pair interaction force errors, Q is sparse and we are only interested in Φ(rec) at a small

number of mesh points, so it is convenient to keep a table of θ(rec) and track the way each point of Q

9

Page 10: Supporting Information for Manuscript “Staggered Mesh

contributes to Φ(rec).

Figure S5 shows that the form of F(si) can indeed be recovered by computing Φ(rec) for a single +1e

ion mapped to the mesh Q via B-splines and then applying Equation S.15. We can therefore define

F(si) generally as:

Φ(si) (ga, gb, gc) =n−1∑

ma=0

n−1∑

mb=0

n−1∑

mc=0

[

Q (ma,mb,mc) · θ(rec)(

g′a, g′b, g

′c

)

]

F(si)a =

n−1∑

ga=0

n−1∑

gb=0

n−1∑

gc=0

[

dMn (ξa + ga)

dξaMn (ξb + gb)Mn (ξc + gc)Φ(si) (ga, gb, gc)

]

F(si)b =

n−1∑

ga=0

n−1∑

gb=0

n−1∑

gc=0

[

Mn (ξa + ga)dMn (ξb + gb)

dξbMn (ξc + gc)Φ(si) (ga, gb, gc)

]

F(si)c =

n−1∑

gc=0

n−1∑

gb=0

n−1∑

gc=0

[

Mn (ξa + ga)Mn (ξb + gb)dMn (ξc + gc)

dξcΦ(si) (ga, gb, gc)

]

(S.20)

where g′a, g′b, and g′c are defined as before. Above, we have assumed that the charged particle’s mesh

bin coordinates are (n− 1+ ξa, n− 1+ ξb, n− 1+ ξc) so that the summations could run from 0 to n− 1

and to emphasize the fact that F(si) is a function of the bin displacements ξa, ξb, and ξc.

The fact that Equation S.20 leads to a sinusoidal form for F(si) as a function of the bin displacements

is well established by Figure 2 of the main text and S5 in this supplement. From Figure S3, it is obvious

that if some ξ leads to an asymmetric charge distribution, the corresponding ξ + 1/2 in a staggered

mesh will lead to a charge distribution with roughly the opposite asymmetry. When the opposing

asymmetries in each resulting potential Φ(rec) are weighted by the corresponding B-spline derivatives,

the self image forces roughly cancel (as has been noted, the cancellation is not perfect, but higher

frequency terms for the Fourier sine series approximation to Equation S.20 can be determined by

explicity computing F(si) for different values of ξ).

Equations S.8, S.19, and S.20 can also be used to show why the components of F(si) appear to be

independent. For example, differentiating Equation S.20 with respect to ξb gives the dependence of

F(si)a as the particle is moved along the mesh dimension b:

∂F(si)a

∂ξb=

n−1∑

ga=0

n−1∑

gb=0

n−1∑

gc=0

[

dMn (ξa + ga)

dξa

dMn (ξb + gb)

dξbMn (ξc + gc)Φ(si) (ga, gb, gc)

]

(S.21)

Technically, the magnitude of F(si)a , as well as its dependence on ξb or ξc, is dependent on the whether

θ(rec) changes rapidly between two consecutive mesh points. However, each component of F(si) can be

10

Page 11: Supporting Information for Manuscript “Staggered Mesh

restated as a sum of a function H that is approximately even (even with respect to the center of the

distribution of the charge qi on the mesh Q) multiplied by a B-spline derivative, which is odd:

H (ga) =

n−1∑

gb=0

n−1∑

gc=0

[

Mn (ξb + gb)Mn (ξc + gc) Φ(si) (ga, gb, gc)]

F(si)a =

n−1∑

ga

[

H (ga)dMn (ξa + ga)

dξa

]

(Figures S2 and S1 illustrate these even and odd functions, respectively.) Similar expressions hold for

F(si)b and F

(si)c . The product of an even function and an odd function is an odd function, and integrating

an odd function over symmetric limits will give a result of zero (Equation S.20 can be thought of as

integration by the rectangle rule). Again, F(si) is nonzero if Φ(si) is not exactly an even function with

respect to the center of the distribution of charge qi on the mesh. This reasoning can be extended to

estimate the size of ∂F(si)a /∂ξb relative to F

(si)a :

∂H (ga)

∂ξb=

n−1∑

gb=0

n−1∑

gc=0

[

dMn (ξb + gb)

dξbMn (ξc + gc)Φ(si) (ga, gb, gc)

]

∂F(si)a

∂ξb=

n−1∑

ga

[

∂H (ga)

∂ξb

dMn (ξa + ga)

dξa

]

Note that ∂H (ga) /∂ξb is also an even function because the B-spline derivative applies in the b di-

mension. However, ∂H (ga) /∂ξb will be much smaller than H (ga), because ∂H (ga) /∂ξb itself can be

thought of as the integral of the product of a function that is approximately even and a function that is

odd. Therefore, F(si)a can be expected to be much larger than ∂F

(si)a /∂ξb. To test this in the case of our

cubic unit cell, we maximized F(si)x by setting ξx to 0.25 and then sampled ξy ∈ [0, 1] and ξz ∈ [0, 1] to

see the effect on F(si)x for µ = 1.333A. We found that bin displacements in y and/or z influence F

(si)x by

at most 0.5% . Thus, even at a fairly coarse mesh spacing, each component of F(si) is almost exclusively

determined by the distribution of the B-spline mapped charge along the same direction and negligibly

dependent on the distribution of charge in the other two directions. This confirms our observation

from Figure 2 of the main text, that the three components of F(si) can be treated independently. We

also confirmed that the components of F(si) have forms like Equation 2 of the main text if the charged

particle is perturbed in all three dimensions by the same bin displacement simultaneously (data not

shown).

Equation S.20 is still applicable in the case of non-cubic and non-orthorhombic unit cells, but it is

important to note that the shape of θ(rec) can be very different. Figure S6 shows θ(rec) for the case of

11

Page 12: Supporting Information for Manuscript “Staggered Mesh

a triclinic cell with equal side lengths, like the unit cell for the COX-2 test case. When the unit cell

angles change, θ(rec) must compensate not only for charges being mapped over larger regions but also

for the fact that the non-orthogonality of the bin vectors va, vb, and vc will affect the distance between

mesh points. In a cubic unit cell the distance in real space between mesh points (0, 0, 0) and (1, 1,

1) is the same as the distance between mesh points (0, 0, 0) and (1, 1, -1). However, in this example

of a triclinic cell the distance between (0, 0, 0) and (1, 1, -1) is nearly twice the distance between (0,

0, 0) and (1, 1, 1). As a result, θ(rec) cannot be thought of as a single-valued function of the distance

between two mesh points, even over very small distances, in non-orthorhombic unit cells. Nonetheless,

Figure S7 shows that F(si) has virtually the same form for the triclinic cell as for the cubic cell. We

also confirmed that ∂F(si)a /∂ξb is negligible even if the bin vectors are non-orthogonal (data not shown).

This corroborates the results in Figure 7 of the main text, providing additional evidence that StME is

just as effective in non-orthorhombic unit cells as cubic ones.

In summary, with regard to the self image forces, staggering the mesh by (1/2)(va + vb + vc) is

equivalent to staggering the mesh along one dimension at a time. In either case, the effect is to remove

all error associated with the lowest frequency term of a Fourier sine series approximation to F(si). One

or more coefficients for the series can be obtained by computing θ(rec) and then evaluating Equation

S.20. From the results in Figure 2 of the main text, eliminating the lowest frequency term reduces the

error in the force on an isolated charge by roughly 90%, roughly the same factor of improvement that

our proposed StME method can bring to the computed reciprocal space forces in a condensed-phase

system.

2.3 Origin of the pair interaction force errors

While erroneous self image forces can be removed from an SPME calculation, Figures 3 and 4 of the

main text showed that there are other, more significant, sources of error to address. Although we did

not develop an approximate formula for the complicated pair interaction force errors observed in the

Results, we can use the formalism developed for the self image forces to write an exact expression for

the force F(rec)ji exerted on a particle i with charge qi located at ri by another charged particle j with

charge qj located at rj . However, whereas any nonzero value of F(si) could be identified as an error,

F(rec)ji has some degree of error mixed with the correct interaction force between the two particles.

When discussing the self image forces for SPME with nth order interpolation, it was convenient to

12

Page 13: Supporting Information for Manuscript “Staggered Mesh

write expressions such as Equation S.20 in terms of the bin displacements ξa, ξb, and ξc. A weighted

sum of the reciprocal space pair potential θ(rec) (weighted by the distribution of the charged particle on

the mesh Q) was used to construct Φ(si), and a weighted sum of Φ(si) (weighted by the derivatives of the

distribution of the charged particle on the mesh Q) was then used to accumulate F(si). Computing the

self image force for nth order interpolation therefore required a sum over n3 points in θ(rec) to obtain

the potential at each of n3 points in Φ(si), a total of n6 interactions.

A similar procedure can be applied to compute F(rec)ji , but because F

(rec)ji depends on the positions

of two particles we will initially phrase the pair interaction force in terms of the mesh bin coordinates

of both particles. In order to compute the force of particle j on particle i, we must compute the charge

meshes Qi and Qj due to charges qi and qj, respectively, then compute the electrostatic potential

Φ(rec)j from Qj, and finally compute the sum over Φ

(rec)j weighted by the derivatives of Qi in each mesh

dimension.

Φ(rec)j (ga, gb, gc) = qj

Ga∑

ma=0

Gb∑

mb=0

Gc∑

mc=0

[

Mn (uj,a −ma)Mn (uj,b −mb)Mn (uj,c −mc) · θ(rec)(

g′a, g′b, g

′c

)

]

F(rec)ji,a = qi

Ga∑

ga=0

Gb∑

gb=0

Gc∑

gc=0

[

dMn (ui,a − ga)

dui,aMn (ui,b − gb)Mn (ui,c − gc)Φ

(rec)j (ga, gb, gc)

]

(S.22)

Similar expressions apply for F(rec)ji,b and F

(rec)ji,c . Above, ui = (ui,a, ui,b, ui,c) are the mesh bin coordinates

of particle i as described in Figure 1 of the main text. (The non-integer parts of ui and uj are the

bin displacements used to compute F(si) in the previous section.) The products of B-splines and their

derivatives are written, rather than Qj or ∂Qi/∂ri, to emphasize the fact that F(rec)ji is a function of

six variables. Although we have used sums over all mesh points, the values of B-splines and B-spline

derivatives will be zero at all but n3 points of ∂Qi/∂ri and n3 points of Φ(rec)j , so the calculation again

involves n6 interactions.

To demonstrate that the pair interaction forces can be obtained from Equation S.22, we placed

particle i with a +1e charge at the origin of the test cell (which lies on a mesh point) and used θ(rec)

obtained with µ = 1.333A to compute F(rec)ji,a as particle j with -1e charge was moved along the x axis.

(Note that, in this discussion, the mesh dimensions will be referred to as a, b, and c even though in

the cubic test cell they could also be called x, y, and z.) To separate the error in Equation S.22 from

the correct force between the two particles, an accurate reference is needed; we therefore recomputed

F(rec)ji,a using θ(rec) obtained with µ = 0.333A , a very fine mesh. The resulting errors, plotted in Figure

13

Page 14: Supporting Information for Manuscript “Staggered Mesh

S8, are identical to those in Panel B of Figure 5 of the main text (the same experiment, performed

with the sander SPME routines). Furthermore, computing the errors after staggering the coarse mesh

by (1/2)(va + vb + vc) (shifting the particles by µ/2 in x, y, and z relative to the mesh) produces the

same error cancellation as seen previously.

In developing the StME method, we noted that error cancellation was optimized by using only one

additional mesh, staggered by (1/2)(va +vb +vc). In contrast, using three additional meshes staggered

by (1/2)va, (1/2)vb, or (1/2)vc did not produce as good a result, even for individual components of

F(rec)ji (see Panel A of Figure 5 in the main text). For cancelling self image forces, we found that stag-

gering the mesh along one dimension at a time is equivalent to staggering it along all three dimensions

at once. The question of why it is better to stagger in all three dimensions simultaneously can therefore

be examined with Equation S.22.

In Figure 5 of the main text, the error in F(rec)ji,a is high when particle j is located 2.0A from particle

i (a separation of 1.5µ on the 1.333A mesh). The case of two particles having 1.5µ separation along one

mesh dimension and no separation along the other dimensions is a good starting point for investigating

the pair interaction force errors. This particular case is also a good example of the cancellation that

can be obtained with different mesh staggering strategies (again, compare panels A and B in Figure 5

of the main text).

Equation S.22 expresses F(rec)ji as a function of the mesh bin coordinates of each particle, but

it could also be expressed as a function of the interparticle vector rji and the bin displacement of

the first particle, ~ξi = (ξi,a, ξi,b, ξi,c). The true force between two particles F(true)ji (rji) is mixed with

errors dependent on ~ξi. As shown in Figure S9, each component α ∈ a, b, c of F(rec)ji (ξi, rji) can be

approximated by the first few terms of a Fourier sine series in ξα for a fixed interparticle vector rji and

fixed values of the other two components of ~ξi:

F(rec)ji,α

(

~ξi, rji

)

≃ F(true)ji (rji) + qiqj

∞∑

p=0

[

Z(p)α (rji) sin

(

2pπξα + ω(p)α (rji)

)]

+ Lα (ξγ 6=α, ξλ6=α) (S.23)

where L is a function of the other two components of ~ξi. We found that the sine series coefficients Z(p)α ,

as well as the phase angles ω(p)α , have a very slight dependence on the other two components of ξi, but

the above approximation seems to be effective.

Figure S9 shows that the sine series in Equation S.23 is dominated by its lowest frequency term, but

removing this lowest frequency term by staggering the mesh (1/2)va does not lead to a good estimate

14

Page 15: Supporting Information for Manuscript “Staggered Mesh

of F(rec)ji,a . This can help to explain why staggering the mesh in all three dimensions at once is superior

to staggering it in one dimension at a time. As shown in Figure S9, the function L in Equation S.23 can

also be approximated by a pair of Fourier sine series in which the lowest frequency terms are dominant:

Lα (ξγ 6=α, ξλ6=α) ≃∞∑

p=0

[

X(p)γ (rji) sin

(

2pπξγ + η(p)γ

)]

+

∞∑

p′=0

[

X(p′)λ (rji) sin

(

2p′πξλ + η(p′)λ

)]

(S.24)

In general, each component of F(rec)ji (~ξi, rji) can therefore be approximated by three Fourier sine series

in ξa, ξb, and ξc.

The self image forces can be thought of as a special case of the pair interaction force errors for rji = 0.

When all three components of rji are zero, we found that any component of the self image force can

be approximated as a function of its bin displacement along the same direction without consideration

to bin displacements in other dimensions. This stands in contrast to ∂F(rec)ji,a (~ξi, rji)/∂ξi,b, which we

find to depend nearly as strongly on ξi,b or ξi,c as it does on ξi,a in the case of rji = (1.5µ, 0.0, 0.0).

Explaining the contrast also explains why staggering the mesh in only one dimension will be adequate

for cancelling F(si) but not for cancelling errors in F(rec)ji . In the case of the self image forces, we found

∂F(si)a /∂ξb to be very small in proportion to F

(si)a —at most 0.5% of F

(si)a for this 1.333A mesh. The

same reasoning can be used to determine ∂F(rec)ji,a (~ξi, rji)/∂ξb in the case that rji,b is zero but rji,a is

not:

H (ga) =

n−1∑

gb=0

n−1∑

gc=0

[

Mn (ξi,b − gb)Mn (ξi,c − gc)Φ(rec)j (ga, gb, gc)

]

F(rec)ji,a

(

~ξi, rji

)

= qi

n−1∑

ga=0

[

dMn (ξi,a − ga)

dξi,aH (ga)

]

∂F(rec)ji,a

(

~ξi, rji

)

∂ξi,b= qi

n−1∑

ga=0

[

dMn (ξi,a − ga)

dξi,a

∂H (ga)

∂ξi,b

]

Above, a change of coordinates was made to place particle i at mesh bin coordinates (ξi,a + n −

1, ξi,b + n− 1, ξi,c + n− 1) and thus express F(rec)ji,a as a function of ~ξi and rji. Φ

(rec)j is assumed to have

been computed accordingly. By the symmetry arguments applied in the previous section, we can expect

∂H (ga) /∂ξi,b to be zero in the limit of a very fine mesh, and much smaller than H (ga) for even a coarse

mesh. Likewise, ∂F(rec)ji,a /∂ξi,b will be much smaller than F

(rec)ji,a . However, for a +1e charge, F

(si)a on the

1.333A mesh was no larger than 0.14 kcal/mol-A. In the case of ±1e charges with rji = (1.5µ, 0.0, 0.0),

F(rec)ji,a is nearly 16 kcal/mol-A; even 0.5% of F

(rec)ji,a would be roughly 0.08 kcal/mol-A, which is on the

15

Page 16: Supporting Information for Manuscript “Staggered Mesh

order of what we see for the plots of La(ξb, ξc, rji) in Figure S9. If F(true)ji is large, even proportionately

small mixed partial derivatives can influence the mesh-based estimates and contribute significantly to

the overall error. Therefore, while it is acceptable to compute the components of F(si) independently,

it is not acceptable to compute errors in components of F(rec)ji independently.

Even when one or more components of rji are nonzero, the mesh-based estimate of any component

of the force exerted on particle i by particle j can be approximated as a function of a perturbation to

the bin displacement ∆~ξ = (∆ξ,∆ξ,∆ξ):

F(rec)ji,α

(

~ξi + ∆~ξ, rji

)

≃ F(true)ji (rji) +

∞∑

p=0

[

D(p)α

(

~ξi, rji

)

sin(

2pπ∆ξ + ψ(p)(

~ξi, rji

))]

(S.25)

Several examples for different ~ξi and rji are shown in Figure S10. Once again, staggering the mesh

by (1/2)(va,vb,vc) eliminates oscillations in the estimates of F(rec)ji due to the first term of this series,

bringing the results much closer to F(true)ji .

In principle, it is possible to compute coefficients for such a sine series and apply the corrections

in direct space between pairs of interacting particles within a distance of a few Angstroms. However,

the coefficients D(p)α and the phase angles ψ(p)(~ξi) are all dependent on rji and so a large table and

many lookups would be required to correct each pairwise interaction, which would probably be more

expensive than convoluting a finer charge density mesh in the reciprocal space calculation or performing

a second reciprocal space calculation with another coarse mesh.

2.4 Origin of the biased reciprocal space energy estimates

Clues to the origin of the biased estimates of the reciprocal space electrostatic energy E(rec) in StME

calculations are evident in Figure S3. By Equation S.13, the reciprocal space energy is the potential

energy of the charge mesh Q placed in the electrostatic potential Φ(rec). Because there are several

reciprocal space electrostatic potentials in Figure S3, we will refer to the potential computed on the

fine, 0.667A mesh as Φ(fine) and call the potentials computed from each coarse, 1.333A mesh Φ(O,coarse)

and Φ(S,coarse). For clarity, all of these potentials are shown superimposed on one another in Figure

S11.

Although the average of Φ(O,coarse) and Φ(S,coarse) appears smooth and very close to Φ(fine), the

energies due to Φ(O,coarse) and Φ(S,coarse) are computed separately with the two corresponding coarse

charge meshes. To compute the self energy of a charge E(si), Φ(O,coarse) and Φ(S,coarse) will be sampled

16

Page 17: Supporting Information for Manuscript “Staggered Mesh

over a larger region than Φ(fine), as shown in Figure S11.

By Equation S.13, E(si) can be related to θ(rec):

E(si) = qn−1∑

ga=0

n−1∑

gb=0

n−1∑

gc=0

[

Mn (ξa + ga)Mn (ξb + gb)Mn (ξc + gc)Φ(si) (ga, gb, gc)]

(S.26)

Above, Φ(si) is as defined in Equation S.20 and we have again assumed the particle’s mesh bin coordi-

nates to be (ξa + n− 1, ξb + n− 1, ξc +n− 1). Naturally, taking the derivatives of E(si) with respect to

ξa, ξb, and ξc gives F(si). E(si) might thus be approximated by the first few terms of a Fourier cosine

series:

E(si) ≃∑

α∈a,b,c

∞∑

p=0

Y (p)α q2cos (2pπξα)

(S.27)

Note that E(si) depends on the value of ξ in all three mesh dimensions. For µa = µb = µc in an

orthorhombic unit cell, Y(p)1 = Y

(p)2 = Y

(p)3 . We found this approximate formula to work well in

practice (data not shown).

Although it may at first appear that inaccuracy in E(si) leads to the inflated values of E(rec),

averaging E(si) for the entire range of bin displacments and comparing results obtained with µ =

1.333A and µ = 0.667A suggests that inaccuracy in E(si) actually decreases the reciprocal space energy.

Assuming that all particles of the simulation sample bin displacements ξa, ξb, and ξc uniformly, we

can evaluate Equation S.26 to obtain 〈E(si)〉 for charges in our test cell, where the brackets denote an

average. Computing this for µ = 1.333A and µ = 0.667A (along with the appropriate θ(rec) in each

case) shows that 〈E(si)〉 is 116.0112 kcal/mol-e2 for µ = 1.333A and 116.0124 kcal/mol-e2 for µ =

0.6667A. The difference of 1.2×10−3 kcal/mol-e2 is very slight, but added up over thousands of charges

in a system it could impart a bias the overall energy downwards by a few kcal/mol if the coarser 1.333A

mesh spacing is used.

The interaction energy of two particles i and j with charges qi and qj and mesh bin coordinates ui

and uj is:

E(rec)ji = qi

Ga∑

ga=0

Gb∑

gb=0

Gc∑

gc=0

[

Mn (ui,a − ga)Mn (ui,b − gb)Mn (ui,c − gc) Φ(rec)j (ga, gb, gc)

]

(S.28)

where Φ(rec)j is computed as in Equation S.22. An important point can be made by contrasting Equa-

tions S.28 and S.22: while E(rec)ji will be equal to E

(rec)ij , F

(rec)ji is not guaranteed to be equal to −F

(rec)ij .

Because the SPME reciprocal space calculation imparts self image forces on charges and does not ap-

ply equal and opposite forces to pairs of interacting charges, the algorithm does not obey Newton’s

17

Page 18: Supporting Information for Manuscript “Staggered Mesh

Second and Third Laws except in the limit of an extremely fine mesh. However, because of the form

of Equation S.28, the SPME reciprocal space calculation does conserve energy very well provided that

the mesh spacing µ (and, thereby, the reciprocal space pair potential θ(rec)) does not change.

To determine the source of the upward bias in E(rec) produced by coarse meshes, we applied Equation

S.28 to evaluate the interaction energy of many pairs of +1e charges for different interparticle vectors

and bin displacements of the first particle with a coarse 1.333A mesh and compared them to the results

computed using a very fine mesh. Results are plotted in Figure S12 in terms of the average error in the

interaction energy of two charges as a function of the interparticle distance, 〈E(err)ji (r)〉. Like the error

in 〈E(si)〉, 〈E(err)ji (r)〉 tends to be negative for interparticle distances up to 3A on the 1.333A mesh.

This result explains the upward bias in E(rec) produced by coarse meshes: particles of opposite charge

tend to be located very close to one another in simulations, either because they are bonded as part of a

dipole or because the nonbonded electrostatic energy of the system is minimized by placing them close

together. Oppositely charged particles interacting by a negatively biased pairwise interaction potential

will tend to drive the reported energies upwards.

In the SPME procedure, a correction term E(corr) is added to remove the components of E(rec) due

to interactions of bonded atoms (which must be excluded) and the self energy E(si):

E(corr) = −1

2

(i,j)∈bonds

qiqjerf (β|ri − rj|)|ri − rj|

− β√π

N∑

i=1

q2i (S.29)

We cannot directly compare the results of this analytic expression to the results of Equations S.26

and S.28 because θ(rec) is a pair potential for infinite lattices of interacting charges whereas Equation

S.29 applies only to interactions in the primary unit cell. However, we can point out that Equation

S.29 does not take into account the discretization of the mesh. Only in the case of an infinitely fine

mesh, when Equations S.26 and S.28 would both produce constant energies for all values of ξa, ξb,

and ξc, would the mesh produce values that can be exactly corrected by the analytic terms in E(corr).

Any inaccuracies in E(si) or in E(rec)ji due to a coarse mesh spacing will therefore remain after applying

Equation S.29.

While the smoothness of the hypothetical average of Φ(O,coarse) and Φ(S,coarse) does not help StME

to obtain an accurate estimate of E(rec), it appears to be closely related to the reason that the bias is

consistent and therefore removable. Staggering the mesh by (1/2)(va,vb,vc) will eliminate errors in

E(si) due to odd numbered terms of each Fourier cosine series in Equation S.27. Integrating Equation

18

Page 19: Supporting Information for Manuscript “Staggered Mesh

S.25 would also imply a Fourier cosine series approximation for the error in the interaction energy of

two particles. However, the overall bias on the energies obtained from each coarse mesh would still be

reflected in E(rec) even though averaging the results of two staggered meshes would give a more precise

estimate.

2.5 Origin of the biased reciprocal space virial tensor estimates

While Equation S.13 is a valid way to compute the reciprocal space contribution to the energy, we have

only used it for explanatory purposes. In practice, as was noted in the first section of this supplement,

the reciprocal space energy is summed using Equation S.4 as the product F(Q)·B ·C is being computed.

The reciprocal space contributions to the virial tensor Π(rec) are also summed at this stage, using a

form much like the expression for E(rec) as a function of the structure factors S(k):

Π(rec)αγ =

1

2πV

k 6=0

[

exp(

−π2k2/β2)

k2S (k)S (−k) ×

(

δαγ − 21 + π2k2/β2

k2kαkγ

)

]

(S.30)

where k is again the frequency vector in reciprocal space with components ka, kb, and kc, k2 =

|k2a + k2

b + k2c |, δαγ is the Kronecker delta, and α, γ ∈ a, b, c. In practice, the energy computation

described in Equation S.4 is performed by evaluating Equation S.31:

E(rec) =∑

k 6=0

[

|Q (k) |2 ·B (k) · C (k)]

(S.31)

where we have used Q in place of F(Q) to make it clear that k is an argument of the transformed

charge density mesh. Likewise, the reciprocal space virial computation is obtained by:

Π(rec)αγ =

k 6=0

[

Ωα,γ (k) |Q (k) |2 · B (k) · C (k)]

(S.32)

where

Ωα,γ (k) =

(

δαγ − 21 + π2k2/β2

k2kαkγ

)

Ωα,γ (k) is guaranteed to be negative as k is at least 1 and β, the Ewald coefficient defined in Equation

S.3, is real. This explains why elements of the virial trace would be underestimated: because the

reciprocal space potential energy tends to be biased positively, this implies a negative bias will emerge

from the sum in Equation S.32. The presence of the Kronecker delta implies that Ωα,γ (k) will be

more negative for off-diagonal elements of the virial tensor: if a coarse mesh introduces noise into the

structure factors S(k), the off-diagonal elements will therefore be more sensitive to the noise, as we

noted in the Results.

19

Page 20: Supporting Information for Manuscript “Staggered Mesh

Figure S1: A 4th order B-spline and its derivative. An nth order B-spline Mn(u), defined in

Equation S.16, is nonzero for 0 ≤ u ≤ n. The B-spline is n − 2 times continuously differentiable (see

Equation S.17). In the limit of very high order n, a B-spline converges to a Gaussian. The sinusoidal

shape of the self image error in SPME calculations is also apparent in the B-spline derivative, which

determines the derivative of the charge density mesh. However, the interaction of the B-spline derivative

with the electrostatic potential Φ(rec) obtained in the reciprocal space calculation is what ultimately

gives rise to the self image errors.

20

Page 21: Supporting Information for Manuscript “Staggered Mesh

Figure S2: Origins of the self image force in the process of computing the potential on a

coarse mesh. When a charge q+ is mapped onto the mesh using B-splines, the resulting charge mesh

Q will be asymmetric unless q+ lies exactly on a mesh point (or exactly in between two mesh points).

The simulation setup for these plots follows Figure 2 of the main text; µ is 1.333A. In each panel, the

B-spline used for charge mapping is plotted as a plain black line, the “effective” electrostatic potential

is plotted by a line with open circles, and the B-spline derivative used to interpolate forces is plotted

as a line with filled circles. Vertical dashed lines show the location of the charge q+ and the relevant

mesh points. Because the charge q+ is also spread in the y and z directions (in both examples, q+ is

situated at y = 0, z = 0), the “effective” electrostatic potential is obtained for a point x0 by averaging

the electrostatic potential at all mesh points (x = x0, y, z) weighted by the fraction of q+ spread to each

point. The force on q+ is given by summing the product of the B-spline derivative and the effective

potential at all values of x (or, each value of x where the B-spline derivative is nonzero). In the left

hand panel, the charge density mesh is symmetric, leading to a symmetric effective potential and thus

zero net force on the charge q+. In the right hand panel, the charge density and effective potential are

asymmetric; the B-spline derivative will also be sampled asymmetrically and the resulting self image

force on q+ will push it in the +x direction (note that displacing q+ by 0.25µ off a mesh point creates

the strongest possible self image force, as shown in Figure 2 of the main text).

21

Page 22: Supporting Information for Manuscript “Staggered Mesh

Figure S3: Methods for resolving the self image forces. Here, the format follows Figure S2. In

standard SPME, the method for reducing the self image forces and other errors to an acceptable level

is to make the mesh grid more dense (or increase the degree of charge smoothing). In the example on

the left, a mesh with µ = 0.667A was used rather than µ = 1.333A as in Figure S2. This creates a

much smoother effective potential; the smoother potential combined with the better localized sampling

of that potential in the force interpolation procedure (compare the B-spline derivatives in the left and

right panels) creates almost no self image force. Another means of reducing the self image force is to

use two meshes staggered by half the mesh spacing, as shown on the right (the effective potential and

B-spline derivatives obtained for the “original” mesh are denoted by circles linked by the lines with

short dashes as before, while those obtained from the “staggered” mesh are denoted by squares linked

by lines with long dashes). In this example, the charge has bin displacements of 0.25 and 0.75 in the

two staggered meshes and the errors in each mesh perfectly cancel one another. Note also that, while

the effective potentials from each 1.333A mesh are coarse, the average of the two would be smoother.

22

Page 23: Supporting Information for Manuscript “Staggered Mesh

Figure S4: The reciprocal space pair potential. To facilitate analysis of the way the electrostatic

potential Φ(rec) arises from the charge mapping procedure, and also how Φ(rec) interacts with B-spline

derivatives in the force interpolation process, we computed the electrostatic potential in terms of the

reciprocal space pair potential θ(rec) for this 64A cubic unit cell. θ(rec) is a function of all three mesh

dimensions as well as the unit cell angles, but it is plotted above as a radial function of the distance r

for simplicity. At short distances, θ(rec) is particularly dependent on the mesh spacing µ: large, open

dots and small black dots represent θ(rec) obtained for µ = 1.333A and 0.667A, respectively. Values of

θ(rec) at the origin and its nearest neighbors are labeled A through D, as illustrated on the plot (the

inset figure is drawn with one-point perspective). At small values of r, θ(rec) is somewhat steeper for µ

= 1.333A than for µ = 0.667A, but Figures S2 and S3 show that the electrostatic potential Φ(rec) due

to B-spline mapped charges on either mesh has a similar overall shape and magnitude for both values

of µ. The consequence of a large µ is therefore a coarser, steeper Φ(rec) that must be sampled over a

larger region to interpolate the force on any charged particle.

23

Page 24: Supporting Information for Manuscript “Staggered Mesh

Figure S5: Self image forces recovered using the reciprocal space pair potential. Using θ(rec)

described in Figure S4 and the distribution of charges on the mesh after B-spline interpolation obtains

the same self image forces seen in Figure 2 of the main text. An analytic expression for the self image

forces is given in Equation S.20, but as shown above and in Figure 2 of the main text, the complicated

summation can be approximated by one or two terms of a Fourier sine series given in Equation 2 of

the main text.

24

Page 25: Supporting Information for Manuscript “Staggered Mesh

Figure S6: The reciprocal space pair potential in a non-orthorhombic unit cell. For com-

pleteness, we recomputed the reciprocal space pair potential for a triclinic unit cell. All box lengths

were set to 64A, box angles were set to 109.47, and a mesh of 483 points was used. As in Figure S4,

θ(rec) is plotted as a function of the distance r between two mesh points, but in this case the potential

clearly is not single-valued even at short range. To convey the geometry of this unit cell, a portion

of the mesh is drawn as in Figure S4, this time using orthographic perspective and viewing the mesh

from above. Points A through F on the mesh are labeled on the plot to provide a sense of the shape

of θ(rec).

25

Page 26: Supporting Information for Manuscript “Staggered Mesh

Figure S7: Self image forces obtained in a non-orthorhombic unit cell. The self image force

F(si)a was computed for a 1.333A mesh in a triclinic unit cell like the one used for the COX-2 test case.

F(si)b and F

(si)c are identical to F

(si)a . Changes in θ(rec) (see Figure S6) appear to have compensated for

the changes in the unit cell geometry. The shape and magnitude of F(si) in this triclinic cell are nearly

identical to F(si) for the cubic unit cell (see Figure S5).

26

Page 27: Supporting Information for Manuscript “Staggered Mesh

Figure S8: Pair interaction force errors recovered using the reciprocal space pair potential.

Pair interaction force errors were computed for a pair of ions in the 64A cubic test cell by applying

Equation S.22 and using θ(rec) for a 1.333A mesh as described in Figure S4. The format and protocol

for positioning the two charges follows Panel B of Figure 5 of the main text. To obtain reference forces

and measure the error, we applied Equation S.22 with θ(rec) for a very fine 0.333A mesh. The results

match precisely with the output from sander shown in Panel B of Figure 5 of the main text.

27

Page 28: Supporting Information for Manuscript “Staggered Mesh

Figure S9: Pair interaction forces plotted against bin displacements in three dimensions.

In the top two panels, the force exerted by particle j (charge -1e) on particle i (charge +1e) in the x

direction ( F(rec)ji,x (~ξi, rji) ) is plotted as a function of the bin displacement of particle i in the x direction.

As mesh spacing of 1.333A was used and forces were calculated in the cubic test cell as before. The

panels on the left and right pertain to interparticle vectors rji of (2.0, 0.0, 0.0)A and (1.5, 1.8, 0.9)A,

respectively (the interparticle vectors were held constant over all bin displacements ~ξi). While F(rec)ji,x is

sinusoidal with respect to ξi,x, it is also shifted to varying degrees for different values of ξi,y and ξi,z.

In each plot, the line with open circles shows the case of ξi,y = ξi,z = 0; the plain black lines show the

case of ξi,y = 0.25, ξi,z = 0.50 for each interparticle vector. Equation S.23 approximates the form of

F(rec)ji,x (~ξi, rji) in the two upper plots, though the exact expression is given by Equation S.22. Averaging

F(rec)ji,x for two different values of ξi,x such that |ξi,x1 − ξi,x2| = 1/2 would not obtain reliable estimates

of the true F(rec)ji,x , which we obtained using a mesh with 0.333A spacing and display as a horizontal

dashed line on each plot. The two color plots in the lower half of the figure show the degree to which

any value of ξi,y or ξi,z will shift the value of F(rec)ji,x (~ξi, rji) in the corresponding plot from the upper

half of the figure; the function Lx(ξi,y, ξi,z) in Equation S.24 approximates these color plots.

28

Page 29: Supporting Information for Manuscript “Staggered Mesh

Figure S10: Pair interaction forces plotted as a function of initial bin displacement and

perturbation ∆~ξ. The x component of the force F(rec)ji depends on the interparticle vector rji and

the bin displacement ~ξi of particle i, as shown here for three different vectors rji. If ~ξi is shifted by

the same amount ∆ξ in all three dimensions at once, F(rec)ji,x (ξi + ∆~ξ, rji) can also be approximated

by a Fourier sine series in the displacement along any one component ∆ξ (see Equation S.25). In

each plot, the plain solid line shows F(rec)ji,x (∆~ξ, rji) (for the case of ~ξi = 0) and the plain dotted line

shows F(rec)ji,x (~ξi + ∆~ξ, rji) for some random ~ξi. Also in each plot, the solid line with open squares

shows (1/2)[F(rec)ji,x (∆~ξ, rji) + F

(rec)ji,x (∆~ξ + 1/2, rji)] while the dotted line with open circles shows the

corresponding average for the same ~ξi used to create the plain dotted line. Averaging F(rec)ji,x (ξi+∆~ξ, rji)

for ∆ξ and ∆ξ+1/2, gives consistenly accurate estimates the true value of F(rec)ji,x , which is again plotted

as a horizontal dashed line. 29

Page 30: Supporting Information for Manuscript “Staggered Mesh

Figure S11: Electrostatic potentials computed for a solitary charge and two different mesh

spacings. The effective electrostatic potentials from Figure S3 are superimposed on one another for

comparison. The solid black line shows the potential obtained with µ = 0.667A, while open diamonds

or circles show the potential obtained with µ = 1.333A on either of two staggered meshes. The

hypothetical “average” potential for the two staggered meshes is shown by black crosses. Black arrows

pointed upward show the points of the potential sampled on the 0.667A mesh to obtain the self energy

of the charge, while the two types of arrows pointed downward show the points that will be sampled

on each of the staggered meshes to compute the charge’s self energy. Coarsening the mesh implies

that the energy of any particular charge will be computed as a weighted sum over a larger region of a

coarser reciprocal space potential.

30

Page 31: Supporting Information for Manuscript “Staggered Mesh

Figure S12: Errors in the electrostatic interaction potential obtained with a coarse mesh.

When two charges are mapped to a mesh, the interaction energy between the charges can be computed

by Equation S.28, but this only gives a convergent result in the limit of small µ. It is also dependent on

the alignment of each particle on the mesh as well as the distance between the particles. Equation S.28

was applied to obtain the average error in the interaction energy for thousands of different interparticle

vectors and bin displacements computed with a 1.333A mesh in the cubic test cell. The interaction

energy of two particles with the same interparticle vector computed with a 0.333A mesh was used

as the reference; the plot above shows 〈E(rec)ji (µ = 1.333A)〉 − 〈E(rec)

ji (µ = 0.333A)〉. The variability

of the error (not shown) is much larger than the average error for any value of the distance between

the charges, making the averages difficult to converge. However, the interaction potential is definitely

negatively biased; because pairs of oppositely charged particles will tend to come into close contact in

a simulation, the reciprocal space energy will be biased upwards as shown in Figure 8 of the main text.

31

Page 32: Supporting Information for Manuscript “Staggered Mesh

References

[1] Chen, L.; Langdon, B.; and Birdsall, C.K. Reduction of the grid effects in simulation plasmas. J.

Comput. Phys. 1974 14 200-222.

[2] Hockney, R.W.; and Eastwood, J. In Computer Simulation Using Particles. Taylor and Francis

Group: New York, New York, 1988; pp 260-291.

[3] Essmann U.; Perera, L.; Berkowitz, M.L.; Darden, T.; Lee, H.; Pedersen, L.H. A smooth particle

mesh Ewald method. J. Chem. Phys. 1995 103, 8577-8593.

[4] Schoenberg, I.J. Cardinal Spline Interpolation; Society for Industrial and Applied Mathematics;

Philadelphia, PA, USA, 1973.

32