Professional Documents
Culture Documents
Ewald Summation For Coulomb Interactions in A Periodic Supercell
Ewald Summation For Coulomb Interactions in A Periodic Supercell
Contents
1 Problem Statement 1
6 Implementation Issues 7
This document gives a simple and self-contained description of the Classical Ewald method [1, 2].
The derivation here reflects the our thoughts when trying to understand and “internalize” the
method. We hope that it will be useful for others who also want to understand the basic idea of
Ewald summation.
1 Problem Statement
Consider N ions in vacuum, at locations r1 , r2 , r3 , ..., rN , and possessing point charges q1 , q2 , q3 , ..., qN ,
respectively. The total Coulomb interaction energy is
1 � qi qj
E= (1)
4πε0 |rij |
(i,j)
where rij = rj − ri , ε0 = 8.854 × 10−12 C2 N−1 m−2 is vacuum permittivity (or electric constant),
and the sum is over all ionic pairs (i, j) (there are N (N − 1)/2 pairs in total).
Now suppose the ions are subjected to periodic boundary conditions (PBC), which are described
by three repeat vectors c1 , c2 , c3 (forming a supercell). This means that whenever there is an
1
ion qi at location ri , there are also ions with charge qi at ri + n1 c1 + n2 c2 + n3 c3 , where n1 ,
n2 , n3 are arbitrary integers. To simplify our notation, we will write an arbitrary repeat vector,
n1 c1 +n2 c2 +n3 c3 , as n L, where L represents the characteristic length of the supercell. For example,
it is easy to picture a supercell with a cubic-shape. In this case, we can choose L = |c1 | = |c2 | = |c3 |
and vectors n form a simple cubic lattice (n1 , n2 , n3 ). The total Coulomb interaction energy for
these ions under PBC has to include the interactions between periodic images,
1 �� qi qj
E= (2)
4πε0 n |rij + n L|
(i,j)
The sum over all pairs can be rewritten into sums over all ions, with a factor 1/2 to cancel the
double-counting.
N N
1 1 � � �� qi qj
E= (3)
4πε0 2 n |rij + n L|
i=1 j=1
where the symbol is introduce to exclude the term j = i, if and only if n = 0. The infinite sum in
�
Eq. (3) not only converges very slowly but also is conditionally convergent, meaning that the result
depends on the order of the summation. The Ewald method evaluates E by transforming it into
summations that converges not only rapidly but also absolutely. The final expression of energy in
the Ewald method is given by Eq. (39). In the following we describe how and why we arrive at such
an expression.
To gain more physical insight, we consider the electrical potential field generated by the ions.
The potential field generated by an ion with charge qi at location ri is
1 qi
φi (r) = (4)
4πε0 |r − ri |
The potential field generated by all N ions together with their periodic images under PBC is
N
1 �� qj
φ(r) = (5)
4πε0 n |r − rj + nL|
j=1
We can define φ[i] (r) as the potential field generated by all the ions plus their images, excluding
ion i,
N
1 � �� qj
φ[i] (r) ≡ φ(r) − φi (r) = (6)
4πε0 n |r − rj + nL|
j=1
Again, the � symbol means that the term j = i is excluded, if and only if n = 0. Comparing Eqs.(3)
and (6), we see that
N
1 �
E= qi φ[i] (ri ) (7)
2
i=1
2
We can consider a more general problem, in which the charge distribution for each ion is not
necessarily a delta function, but could spread out in space. The potential field generated by this
charge distribution is the solution of the Poisson’s equation
ρi (r)
∇2 φi (r) = − (9)
ε0
and can be written as
�
1 ρi (r� ) 3 �
φi (r) = d r (10)
4πε0 |r − r� |
The total Coulomb interaction energy can be written as,
N N ��
1 1 � � �� ρi (r)ρj (r� ) 3 3 �
E= d rd r (11)
4πε0 2 n |r − r� + nL|
i=1 j=1
and the potential field generated by all ions excluding ion i becomes
N �
1 � �� ρj (r� )
φ[i] (r) = d3 r� (12)
4πε0 n |r − r� + nL|
j=1
When the charge densities are described by Eq. (8), Eqs. (11) and (12) reduce to Eqs.(3) and (6).
Corresponding to the splitting of charge, the potential field φi (r) can also be split into two terms,
φi (r) = φSi (r) + φL (r)
� i �
qi δ(r − r� ) − Gσ (r − r� ) 3 �
φSi (r) = d r
4πε0 |r − r� |
�
qi Gσ (r − r� ) 3 �
φi (r) =
L
d r (16)
4πε0 |r − r� |
3
The potential field generated by all ions excluding ion i can be split in a similar way,
For reasons that will become clear later, we further split the energy E by adding and subtracting
a self-interaction term,
N N N
1� 1� 1�
E= qi φS[i] (ri ) + qi φL (ri ) − i (ri ) ≡ E + E − E
qi φL S L self
(19)
2 2 2
i=1 i=1 i=1
where
N
1�
E S
≡ qi φS[i] (ri ) (20)
2
i=1
�N
1
EL ≡ qi φL (ri ) (21)
2
i=1
�N
1
E self ≡ i (ri )
qi φL (22)
2
i=1
Gσ (r)
∇2 φσ (r) = − (23)
ε0
By symmetry, we know that φσ (r) only depends on the magnitude r = |r|. In spherical coordinates,
the Poisson’s equation becomes,
1 ∂2 Gσ (r)
[r φσ (r)] = −
r ∂ r2 ε0
∂ 2 r Gσ (r)
2
[r φσ (r)] = −
∂r ε0
� ∞
∂ r Gσ (r) σ2
[r φσ (r)] = dr = Gσ (r)
∂r r ε0 ε0
� � � �
σ2 r σ2 1 π r
r φσ (r) = Gσ (r) dr = σ erf √
ε0 0 ε0 (2πσ 2 )3/2 2 2σ
� �
1 r
φσ (r) = erf √ (24)
4πε0 r 2σ
4
�z 2
where erf(z) ≡ √2
π
e−t dt. Therefore,
0
� �
1 qi |r − ri |
φSi (r) = erfc √
4πε0 |r − ri | 2σ
� �
1 qi |r − ri |
i (r) =
φL erf √ (25)
4πε0 |r − ri | 2σ
where erfc(z) ≡ 1 − erf(z). Because limz→∞ erf(z) = 1, we know that φL i (r) is a long-range non-
singular potential and φSi (r) is a short-range singular potential. (In comparison, the Coulomb
potential of a point charge is both long-ranged and singular.) Given this result, we also have
N � �
1 � �� qj |r − rj + nL|
φS[i] (r) = erfc √ (26)
4πε0 n |r − rj + nL| 2 σ
j=1
as well as the short-range part of the total Coulomb interaction energy (first term in Eq. (18))
N N N � �
1� 1 1 � � �� qi qj |ri − rj + nL|
S
E ≡ qi φS[i] (ri ) = erfc √ (27)
2 4πε0 2 n |ri − rj + nL| 2σ
i=1 i=1 j=1
This is similar to the total Coulomb interaction energy E, except for the erfc term that truncates
the potential function at large distances. Due to the erfc truncation, E S can be directly computed
from a sum in real space. Now that we have the analytic expression for the long-range potential,
we can easily obtain the self energy term,
2
lim erf(z) = √ z
z→0 π
�
qi 2 1
i (ri ) =
φL
4πε0 π σ
N
1 1 � 2
E self = √ qi (28)
4πε0 2πσ
i=1
computed by a sum in real space. The basic idea of the Ewald sum is to transform it into a sum
in the reciprocal space, given that this potential is no longer singular [1].
By not excluding the contribution from any ion, φL (r) is the potential field generated by a
periodic array of ions. Because the total charge density field
N
��
ρL (r) = i (r + nL)
ρL (29)
n i=1
is a periodic function, so is φL (r). Hence it makes sense to Fourier transform φL (r) to the reciprocal
space. Let φ̂L (k) and ρ̂L (k) be the Fourier transform of φL (r) and ρL (r), respectively.
�
φ̂L (k) = φL (r) e−ik·r d3 r
�V
ρ̂ (k) =
L
ρL (r) e−ik·r d3 r
V
5
The integral is over the volume V of the supercell. The inverse Fourier transform is
1 � L
φL (r) = φ̂ (k) eik·r
V
k
1 �
ρL (r) = ρ̂L (k) eik·r
V
k
The summation is over the reciprocal lattice of the lattice defined by the translation vectors c1 ,
c2 , c3 . The potential field and the charge distribution are related to each other by the Poisson’s
equation
ρL (r)
∇2 φL (r) = − (30)
ε0
which can be transformed into reciprocal space to give
ρ̂L (k)
k 2 φ̂L (k) = (31)
ε0
Hence our strategy of computing E L is the following. First, we obtain the Fourier transform of
the charge density. Dividing the result by k 2 we obtain the Fourier transform of the long range
potential. The long-range potential in real space is then obtained by inverse Fourier transform,
which finally gives rise to E L . This is described by the following expressions.
N
��
ρ (r) =
L
qj Gσ (r − rj + nL)
n j=1
� �
N
ρ̂ (k) =
L
qj Gσ (r − rj + nL) e−ik·r d3 r
V j=1
N
� �
= qj Gσ (r − rj ) e−ik·r d3 r
j=1 R3
N
� 2 k 2 /2
= qj e−ik·rj e−σ (32)
j=1
�
where k = |k| and R3 means integration over the entire 3-dimensional space. In the above deriva-
tion, we have used the fact that k is a reciprocal vector and exp(−ik · nL) = 1. Notice that
−σ 2 k 2 /2
i (k) = qj e
ρ̂L (33)
N
�
ρ̂L (k) = i (k)
ρ̂L (34)
i=1
6
Now applying inverse Fourier transform, we get
1 � L
φL (r) = φ̂ (k) eik·r
V
k�=0
N
1 � � qj ik·(r−rj ) −σ2 k2 /2
= e e (36)
V ε0 k2
k�=0 j=1
�N
The contribution to the k = 0 term is zero if the supercell is charge neutral, i.e. i=1 qi = 0. The
long-range interaction energy is
N
1�
E L
= qi φL (ri )
2
i=1
N N
1 � � � qi qj ik·(ri −rj ) −σ2 k2 /2
= e e
2V ε0 k2
k�=0 i=1 j=1
For convenience, let us define the structure factor S(k) of the charge distribution
N
�
S(k) ≡ qi eik·ri (37)
i=1
1 � e−σ k /2
2 2
E = L
|S(k)|2 (38)
2V ε0 k2
k�=0
Combining Eqs. (27), (28), (38), the total Coulomb interaction energy can be finally written as,
E = E S + E L − E self
N N � �
1 1 � � �� qi qj |ri − rj + nL|
= erfc √
4πε0 2 n |ri − rj + nL| 2σ
i=1 j=1
N
1 � e−σ k /2 1 � 2
2 2
1
+ 2
|S(k)| − √ qi (39)
2V ε0 k2 4πε0 2πσ
k�=0 i=1
The summation for E S is short-ranged in real space (truncated by the erfc function) and the
2 2
summation for E L is short-ranged in reciprocal space (truncated by e−σ k /2 ).
6 Implementation Issues
In Molecular Dynamics (MD) simulations, we need to compute not only the interaction energy E,
but also the forces on the ions due to this interaction. The force on ion j is
∂E ∂E S ∂E L
fj ≡ − =− − ≡ fjS + fjL (40)
∂ rj ∂ rj ∂ rj
7
√
The short-range force fjS is essentially the force due to the pair potential φ(r) = erfc[r/( 2 σ)]/r
and can be computed directly from a sum in real space. The long-range force fjL can be computed
by first computing the derivative of the structural factor,
∂S(k)
= i k qj eik·rj (41)
∂ rj
and then follow the chain rule,
� �
1 � e−σ k /2
2 2
∗ ∂S(k)
fjL = S (k) + c.c. (42)
2V ε0 k2 ∂ rj
k�=0
8
The long-range potential can be integrated analytically to give
1 −ik·ri −η k2
i (k) =
ϕ̂L e e (48)
ε0 k 2
With η = σ 2 /2, this expression is connected to the expression of E L discussed in Section 5. The
next step is to convert ϕ̂Si (k) to real space. We do so by inverse Fourier transform.
1 � S
ϕSi (r) = ϕ̂i (k) eik·r
V
k
�
1 � η ik·(r−ri ) −k2 t
= e e dt
V ε0 0
k
� η�
1 2
= eik·(r−ri ) e−k t dt
V ε0 0
k
Notice that the summation above is simply the inverse Fourier transform of a Gaussian distribution
(identifying t with σ 2 /2). Hence,
�
1 � η e−|r−ri +nL| /(4t)
2
ϕi (r) =
S
dt
ε0 n 0 (4π t)3/2
� �
1 � 1 |r − ri |
= erfc √
4πε0 n |r − ri | 2 η
� �
1 � 1 |r − ri |
= erfc √ (49)
4πε0 n |r − ri | 2σ
This expression is connected to the expression of E S discussed in Section 4. The above is a “stan-
dard” derivation of Ewald summation in many papers and books. It makes use of the “magical”
split of 1/k 2 into two integrals, given in Eq. (47). This approach may be mathematically appeal-
ing to some readers but may look like “black-magic” to others who are looking for more physical
intuition.
9
Notice that as long as |z − zi | > 0, ϕ̃i (κ, z) decays exponentially fast in the 2-d reciprocal space.
In this case, the summation over reciprocal space will be absolutely convergent. However, the sum
becomes conditionally convergent when |z − zi | = 0. In practice, the decay rate becomes very slow
even if |z − zi | is non-zero but very small.
To construct absolutely convergent sums, we take a similar approach as in Appendix A and use
the following identity.1
� ∞
e−κ|z−zi | 1 2 2 2
=√ e−κ t −|z−zi |/(4t ) dt (54)
2κ π 0
Again, we can split ϕ̃i (κ, z) into a short-range part and a long-range part.
�� η � ∞ �
1 −iκ·ρi 2 2 2
ϕ̃i (κ, z) = ϕ̃i (κ, z) + ϕ̃i (κ, z) = √
S L
e + e−κ t −|z−zi |/(4t ) dt (55)
πε0 0 η
� η
1
e−iκ·ρi
2 2 2
ϕ̃Si (κ, z) = √ e−κ t −|z−zi |/(4t ) dt
πε0
�0 ∞
1
e−iκ·ρi
2 2 2
i (κ, z) = √
ϕ̃L e−κ t −|z−zi |/(4t ) dt
πε0 η
|z − zi |
= − − ϕ̃Si (0, z)
2 ε0
� �
η −|z−zi |2 /(4η 2 ) |z − zi | |z − zi |
= −√ e − erf (58)
πε0 2ε0 2η
The next step is to convert ϕ̃Si (κ, z) to real space. We do so by inverse Fourier transform.
1 � S
ϕSi (r) = ϕ̃ (κ, z) eiκ·ρ
A κ i
1 �� η
eiκ·(ρ−ρi ) e−κ t −|z−zi |/(4t ) dt
2 2 2
= √
A πε0 0
k
� η �� �
1 iκ·(ρ−ρi ) −κ2 t2 2
= √ e e e−|z−zi |/(4t ) dt
A πε0 0
k
1
This identity is related to the one used in Appendix A due to the following inverse Fourier transform identity.
� � � ∞
2 2 2 1 2 2 2 1 2 2 2 2
F −1 2 t e−(κ +kz )t = 2 t e−(κ +kz )t eikz z dz = √ e−κ t −z /(4t ) (53)
2π −∞ π
10
Notice that the summation in the bracket is simply the inverse Fourier transform of a 2-dimensional
Gaussian distribution (identifying t with σ 2 /2). Hence,
�
1 � η e−|ρ−ρi +mL| /(4t ) −|z−zi |/(4t2 )
2 2
ϕi (r) = √
S
e dt
πε0 m 0 4π t2
�
1 � η e−|r−ri +mL| /(4t )
2 2
= √ dt
πε0 m 0 4π t2
� �
1 1 � 1 |r − ri |
= √ √ erfc √
πε0 4 π n |r − ri | 2 η
� �
1 � 1 |r − ri |
= erfc √ (59)
4πε0 n |r − ri | 2σ
In the last step, we have used the correspondence η = σ 2 /2. Eq. (59) is identical Eq. (49), meaning
that physically the charge distribution are split in the same way in 3D and 2D Ewald summation.
In 3D Ewald sum, the k = 0 term represent a constant potential field in 3D space and can be
set to zero (without introducing any measurable effect.) In 2D Ewald sum, however, the κ = 0
term represent a constant potential field in 2D plane but its value can depend on z, as in Eq. (58).
So more care must be taken to evaluate the κ = 0 term in 2D Ewald sum [4, 5].
where tL is lattice repeat vectors along the z-axis. tx = 0, ty = 0, tz = 0, ±1, ±2, · · · . The
1-dimensional Fourier transform of ϕi (r) is
qi
ϕi (ρ, kz ) = K0 (ρ̄|kz |) e−ikz zi (61)
2πε0
�
where ρ = (x, y), ρ̄ = (x − xi )2 + (y − yi )2 , K0 is the modified Bessel function of the second
kind.2 Notice that in the limit of κ → 0,
qi
ϕ̃i (ρ, kz ) = − ln ρ̄ (62)
2πε0
Notice that as long as |z − zi | > 0, ϕ̃i (ρ, kz ) decays exponentially fast with kz . In this case, the
summation over reciprocal space will be absolutely convergent.3 However, the summand blows up
when ρ̄ = 0. In practice, the decay rate becomes very slow even if ρ̄ is non-zero but very small.
To construct absolutely convergent sums, we first try a similar approach as in Appendix A and
use the following identity.
� ∞ �� η � ∞ �
1 −kz2 t2 −ρ̄2 /(4t2 ) 1 −kz2 t2 −ρ̄2 /(4t2 )
K0 (ρ̄|kz |) = e dt = + e dt (63)
0 t 0 η t
2 (1) (1)
Kα (x) = π2 iα+1 Hα (ix). Hα = Jα (x) + iYα (x) is the Hankel function. Jα (x) is Bessel function of the first
kind. Yα (x) is Bessel function
� of the second kind.
3
For large x, Kα (x) → 2πx e−x .
11
However, I am not able (yet) to find an analytic expression for the partial integral,
� η
1 −kz2 t2 −ρ̄2 /(4t2 )
e dt (64)
0 t
This means difficulty in extending the above approach to construct a 1-dimensional Ewald sum.
To make progress, we split ϕi (r) into a short-range and a long-range part in a different way,
ϕi (r) = ϕSi (r) + ϕL
i (r) (65)
where
qi � 1
i (r) =
ϕL � (66)
4πε0 t |r − ri + tL|2 + σ 2
where σ is a constant “smoothing-out” parameter. The analytic structure of ϕL i (r) is very similar
to that of ϕi (r). For example, its 1-dimensional Fourier transform is,
qi
ϕLi (ρ, kz ) = K0 (ρ̄σ |kz |) e−ikz zi (67)
2πε0
�
where ρ̄σ = ρ̄2 + σ 2 . For any σ > 0, ρ̄σ always stays positive and K0 (ρ̄σ |kz |) is both finite at
small kz and rapidly decaying at large kz . The short-range potential is simply
� �
q i
� 1 1
ϕSi (r) = −� (68)
4πε0 t |r − ri + tL| |r − ri + tL|2 + σ 2
It is easy to show that the summand ∝ 1/|tL|3 for large t. Hence the summation is absolutely con-
vergent. The convergence speed is not as fast as that in 2D and 3D Ewald summation (exponential
convergence). This is due to the difficulty in obtaining the analytic solution for the 1-dimensional
Fourier transform of the potential field of Gaussian charge distributions. The smooth charge distri-
bution chosen here is not optimal in the sense that the real space sum converges only polynomially
fast. But the simplicity of the expressions is the advantage of this approach. The speed of conver-
gence is not a critical issue given the one-dimensionality of the summation.
References
[1] P. P. Ewald, The calculation of optical and electrostatic grid potential, Ann. Phys. (Leipzig)
64, 253 (1921).
[2] S. W. de Leeuw, J. W. Perram and E. R. Smith, Simulation of Electrostatic Systems in Periodic
Boundary Conditions. I. Lattice Sums and Dielectric Constants, Proc. Roy. Soc. Lond. A 373,
27-56 (1980); ibid. Simulations of Electrostatic Systems in Periodic Boundary Conditions. II.
Equivalence of Boundary Conditions, Proc. Roy. Soc. Lond. A 373, 57-66 (1980).
[3] T. Darden, D. York and L. Pedersen, Particle mesh Ewald: An N · log(N ) method for Ewald
sums in large systems, J. Chem. Phys. 98, 10089 (1993).
[4] F. E. Harris, Ewald Summations in Systems with Two-Dimensional Periodicity, Int. J. Quan-
tum Chem. 68, 385 (1998).
[5] I.-C. Yeh and M. L. Berkowitz, Ewald summation for systems with slab geometry, J. Chem.
Phys. 111, 3155 (1999).
12