선정목록으로
The optimal P3M algorithm for computing electrostatic energies in periodic systems
수소연료전지 · (7) MEA(막전극접합체)
기본 정보
- 저자
- DOI
- 10.48550/arxiv.0708.0728
- 저널
- arXiv (Cornell University)
- 발행년도
- 2022
- 발행기관
- Cornell University
- 피인용수
- 0
- 라이선스
- 0
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.48550/arxiv.0708.0728
- 토픽
- Electron and X-Ray Spectroscopy Techniques
- OpenAlex ID
- W6929335980
평가 내용
- 관련도
- 사업분야
- 수소연료전지 · (7) MEA(막전극접합체)
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '수소연료전지 > MEA(막전극접합체)' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
We optimize Hockney and Eastwood's Particle-Particle Particle-Mesh (P3M) algorithm to achieve maximal accuracy in the electrostatic energies (instead of forces) in 3D periodic charged systems. To this end we construct an optimal influence function that minimizes the RMS errors in the energies. As a by-product we derive a new real-space cut-off correction term, give a transparent derivation of the systematic errors in terms of Madelung energies, and provide an accurate analytical estimate for the RMS error of the energies. This error estimate is a useful indicator of the accuracy of the computed energies, and allows an easy and precise determination of the optimal values of the various parameters in the algorithm (Ewald splitting parameter, mesh size and charge assignment order).
본문 85,731자
본문 펼치기
## The optimal P3M algorithm for computing electrostatic energies in periodic systems
V. Ballenegger
_Institut_ _UTINAM,_ _Universit´e_ _de_ _Franche-Comt´e,_ _UMR_ _6213,_
_16,_ _route_ _de_ _Gray,_ _25030_ _Besan¸con_ _cedex_ France _._
J. J. Cerda and O. Lenz
_Frankfurt_ _Inst._ _for_ _Advanced_ _Studies,_
_J.W._ _Goethe_ _-_ _Universit¨at,_ _Frankfurt,_ _Germany_
Ch. Holm
_Frankfurt_ _Inst._ _for_ _Advanced_ _Studies,_
_J.W._ _Goethe_ _-_ _Universit¨at,_ _Frankfurt,_ _Germany_ _and_
_Max-Planck-Institut_ _f¨ur_ _Polymerforschung,_ _Mainz,_ _Germany_
(Dated: October 26, 2018)
## Abstract
We optimize Hockney and Eastwood’s Particle-Particle Particle-Mesh (P3M) algorithm to
achieve maximal accuracy in the electrostatic energies (instead of forces) in 3D periodic charged
systems. To this end we construct an optimal influence function that minimizes the RMS errors
in the energies. As a by-product we derive a new real-space cut-off correction term, give a trans
parent derivation of the systematic errors in terms of Madelung energies, and provide an accurate
analytical estimate for the RMS error of the energies. This error estimate is a useful indicator
of the accuracy of the computed energies, and allows an easy and precise determination of the
optimal values of the various parameters in the algorithm (Ewald splitting parameter, mesh size
and charge assignment order).
1
I. INTRODUCTION
Long range interactions are ubiquitously present in our daily life. The calculation of
these interactions is, however, not an easy task to perform. One needs indeed to resort to
specialized algorithms to overcome the quadratic scaling with the number of particles, as
soon as the simulated system includes more than a few hundred particles, see for example the
review of Arnold and Holm <sup>1</sup> . In Molecular Dynamics simulations, one is mainly interested
in the accuracy of the force computation, since they govern the dynamics of the system. In
contrast, in Monte Carlo (MC) simulations, the concern is to compute accurate energies.
If the potential is of long range ( _e.g._ a Coulomb potential or dipolar interaction), and
one has chosen to use periodic boundary conditions, the computation of both observables
is quite time consuming if one uses the traditional Ewald sum. Since the seminal work
of Hockney and Eastwood <sup>2</sup> it has been common to resort to a faster way of calculating
the reciprocal space sum in the Ewald method with the help of Fast-Fourier-Transforms
(FFTs). These algorithms are called mesh-based Ewald sums, and various variants exist <sup>3</sup> .
They all scale as _N_ log _N_ with the number of charged particles _N_, and the algorithms are
nowadays routinely used in simulations of bio-systems, charged soft matter, plasmas, and
many more areas. The most accurate variant is still the original method of Hockney and
Eastwood, which they called particle-particle-particle-mesh (P3M), and into which various
other improvements like the analytical differentiation used in other variants of the mesh
based Ewald sum <sup>4</sup> can be built in. In addition, an accurate error estimate for P3M exists,
so that one can tune the algorithm to a preset accuracy, thus maximizing the computational
efficiency before doing any simulations <sup>5</sup> .
While in the standard P3M algorithm <sup>2</sup>, the lattice Green function, called the “influence
function”, is optimized to give the best possible accuracy in the forces, the electrostatic
energy is usually calculated with the same force-optimized influence function. However,
there are certainly situations where one needs a high precision of the energies, for instance
in Monte Carlo simulations, and the natural question arises whether one can optimize the
influence function to enhance the accuracy of the P3M energies. The main goal of this paper
is to derive the energy-optimized influence function, and to derive an analytical estimate for
the error in the P3M energies. This error estimate is a valuable indicator of the accuracy
of the calculations and allows a straightforward and precise determination of the optimal
2
values of the various parameters in the algorithm (Ewald splitting parameter, mesh size,
charge assignment order).
The present derivation of the optimal influence function, and the associated error esti
mate, is concise and entirely self-contained. The present paper can thus also serve as a
pedagogical introduction to the main ideas and mathematics of the P3M algorithm.
The paper is organized as follows. In Sec. II, we briefly review the ideas of the standard
Ewald method and provide the most important formulae. In Sec. III, we derive direct
and reciprocal space correction terms which compensate, on average, the effects of cut-off
errors in the standard Ewald method. We interpret the formulae in terms of the direct and
reciprocal space components of the Madelung energies of the ions. In Sec. IV, the calculation
of the reciprocal energy according to the P3M algorithm ( _i.e._ with a fast Fourier transform
and an optimized influence function) is presented. The mathematical analysis of the errors
introduced by the discretization on a grid is performed in Sec. V. This analysis is used in
Sec. VI to derive the energy-optimized influence function and the associated RMS error
estimate. The derivation shows that the P3M energies must be shifted to compensate for
systematic cut-off and aliasing errors in the Madelung energies of the ions. Finally, our
analytical results are tested numerically in Sec. VII.
II. THE EWALD SUM
We consider a system of _N_ particles with charges _qi_ at positions _r_ _i_ in an overall neutral
and (for simplicity) cubic simulation box of length _L_ and volume _V_ = _L_ <sup>3</sup> . If periodic
boundary conditions are applied, the total electrostatic energy of the box is given by
_E_ = <sup><u>1</u></sup>
2
_n_ _∈_ Z <sup>3</sup>
_N_
- <sup>_′_</sup>
_i,j_ =1
_qiqjv_ ( _r_ _ij_ + _n_ _L_ ) _,_ (2.1)
where _v_ ( _r_ ) = 1 _/|_ _r_ _|_ is the Coulomb potential, _r_ _ij_ = _r_ _i −_ _r_ _j_, and _n_ is a vector with integer
components that indexes the periodic images. The prime indicates that the (divergent)
summand for _i_ = _j_ has to be omitted when _n_ = 0.
Because of the slow decay of the Coulomb interaction, the sum in (2.1) is only condition
ally convergent: its value is not well defined unless one specifies the precise way in which
the cluster of simulation boxes is supposed to fill R <sup>3</sup> . Often, one chooses a spherical order
of summation, which is equivalent to the limit of a large, spherically bounded, regular grid
3
of replicas of the simulation box, embedded in vacuum. The simulation box can then be
pictured as the central LEGO brick in a huge ball made up of such bricks. If this “lego ball”
is surrounded by a homogeneous medium with dielectic constant _ϵ_ <sup>_′_</sup> ( _ϵ_ <sup>_′_</sup> = 1 if it’s vacuum)
and if the simulation box has a net dipole moment _M_ = <sup>�</sup> _i_ <sup>_qi_</sup> <sup>_r_</sup> <sup>_i_</sup> <sup>,</sup> <sup>the</sup> <sup>particles</sup> <sup>in</sup> <sup>the</sup> <sup>ball</sup>
will feel a depolarizing field created by charges that appear on the surface of the uniformily
polarized ball. It can be shown that the work done against this depolarizing field when
charging up the system is
<u>2</u> _<u>π</u>_ _<u>M</u>_ <sup>2</sup>
_E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> = (2.2)
(1 + 2 _ϵ_ <sup>_′_</sup> ) _L_ <sup>3</sup>
in the case of a spherical order of summation <sup>6,7</sup> (for other summation orders, see the articles
of Smith <sup>8</sup> and Ballenegger and Hansen <sup>9</sup> ). The energy _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> is contained, even if not easily
seen, in the total electrostatic energy (2.1) (at least when _ϵ_ <sup>_′_</sup> = 1 since such a vacuum
boundary condition was assumed in writing (2.1)). Obviously, the energy _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> vanishes if
we employ metallic boundary conditions defined by _ϵ_ <sup>_′_</sup> = _∞_ .
The fact that _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> depends on the order of summation, and hence on the shape of macro
scopic sample under consideration, is a consequence of the conditional convergence of the
sum (2.1). Due to the energy cost _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup>, the fluctuations of the total dipole moment of the
simulation box (and hence of the considered macroscopic sample) depend on the dielectric
constant _ϵ_ <sup>_′_</sup> and on the shape of the sample. The energy _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> is crucial to ensure, for ex
ample, that the dielectric constant _ϵ_ of the simulated system obtained from the Kirkwood
formula <sup>10</sup>, which relates _ϵ_ to the fluctuations of the total dipole moment, is independent of
the choices made for the sample shape and for the dielectric boundary condition <sup>11,12</sup> .
Ewald’s method to compute the energy (2.1) is based on a decomposition of the Coulomb
potential, _v_ ( _r_ ) = _ψ_ ( _r_ ) + _φ_ ( _r_ ), such that _ψ_ ( _r_ ) contains the short-distance behavior of the
interaction, while _φ_ ( _r_ ) contains the long-distance part of the interaction and is regular at
the origin. The traditional way to perform this splitting is to define
_φ_ ( _r_ ) = erf( _αr_ ) _/r,_ _r_ = _|_ _r_ _|,_ (2.3)
and
_ψ_ ( _r_ ) = _v_ ( _r_ ) _−_ _φ_ ( _r_ ) = erfc( _αr_ ) _/r_ (2.4)
With this choice, _ψ_ ( _r_ ) corresponds to the interaction energy between a unit charge at a
distance _r_ from another unit charge that is screened by a neutralizing Gaussian charge dis
4
tribution whose width is controlled by the Ewald length _α_ <sup>_−_</sup> <sup>1</sup> . Following this decomposition
of the potential, the electrostatic energy can be written in the well-known Ewald form <sup>6,13</sup> :
_E_ = _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> + _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> + _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> (2.5)
where the _real-space_ _energy_ _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> contains the contributions from short-range interac
tions _ψ_ ( _r_ ), _i.e._
_E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> = <sup><u>1</u></sup>
2
_n_ _∈_ Z <sup>3</sup>
_N_
- <sup>_′_</sup>
_i,j_ =1
_qiqjψ_ ( _r_ _ij_ + _n_ _L_ ) _,_ (2.6)
and the _reciprocal space energy E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> contains contributions from long-range interactions _φ_ ( _r_ )
(apart from the contributions that are responsible for the conditional convergence which are
included in the term _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> in (2.5)). The fact that the surface term (or “dipole term”) _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup>
is independent of the Ewald parameter _α_ shows that this contribution is not specific to
the Ewald method, but more generally reflects the problems inherent to the conditional
convergence of the _n_ sum in Eq. (2.1). Contrary to _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> which can be computed easily in
real space thanks to the rapid decay of the _ψ_ interaction, _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> is best computed in Fourier
space, where it can be expressed as <sup>13</sup>
_E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> = _E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup> _−_ _E_ <sup>(</sup> <sup>_s_</sup> <sup>)</sup> (2.7)
where
_E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup> = <u>1</u> 2 _L_ <sup>3</sup>
_k_ _∈_ K
_k_ _̸_ =0
_|ρ_ �( _k_ ) _|_ <sup>2</sup> _φ_ <sup>�</sup> ( _k_ ) (2.8)
_E_ <sup>(</sup> <sup>_s_</sup> <sup>)</sup> = _Q_ <sup>2</sup> _~~√~~_ <sup>_<u>α</u>_</sup> _<u>π</u>_ (2.9)
with
_Q_ <sup>2</sup> =
_N_
_i_ =1
_qi_ <sup>2</sup> <sup>_._</sup> (2.10)
_qi_ <sup>2</sup>
In (2.8), _φ_ <sup>�</sup> ( _k_ ) is the Fourier transform of the reciprocal interaction (2.3),
_φ_ �( _k_ ) = - _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> _φ_ ( _r_ )d _r_ = <sup><u>4</u></sup> _k_ <sup>_<u>π</u>_</sup> <sup>2</sup> <sup>exp(</sup> <sup>_−k_</sup> <sup>2</sup> <sup>_/_</sup> <sup>4</sup> <sup>_α_</sup> <sup>2)</sup> <sup>_,_</sup> (2.11)
and _ρ_ �( _k_ ) is the Fourier transformed charge density
_qi e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_i_</sup> _._ (2.12)
5
_ρ_ �( _k_ ) =
_N_
_i_ =1
The sum in (2.8) is over wave vectors in the discrete set K = _{_ 2 _π_ _n_ _/L_ : _n_ _∈_ Z <sup>3</sup> _}_ . The term
_k_ = 0 is excluded in the sum because of the overall charge neutrality. The self-energy term
_E_ <sup>(</sup> <sup>_s_</sup> <sup>)</sup> compensates for the self-energies (the reciprocal interaction of each particle with itself
<u>12</u> <sup>_q_</sup> _i_ <sup>2</sup> <sup>_φ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>=</sup> <sup>0</sup> <sup>) =</sup> <sup>_q_</sup> _i_ <sup>2</sup> <sup>_α/√π_</sup> <sup>)</sup> <sup>that</sup> <sup>are</sup> <sup>included</sup> <sup>in</sup> <sup>_E_</sup> <sup>(</sup> <sup>_ks_</sup> <sup>).</sup>
The energy (2.1) converges only for systems that are globally neutral. For systems with
a net charge, the sum can be made convergent by adding a homogeneously distributed
background charge which restores neutrality. In that case, an additional contribution <sup>14</sup>
_<u>π</u>_
_E_ <sup>(</sup> <sup>_n_</sup> <sup>)</sup> = _−_
2 _α_ <sup>2</sup> _L_ <sup>3</sup>
_N_
-
_i_ =1
_qi_
�2
(2.13)
must be added to (2.5) to account for the interaction energies of the charges with the
neutralizing background.
The reciprocal energy _E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>, defined by the Ewald formula (2.7), is the starting point of
mesh-based Ewald sums, which are methods to compute efficiently that energy in many
particle systems. Notice that (2.7) can also be written in an alternative form in terms of a
pair potential and a Madelung self-energy, see Appendix A. The inverse length _α_ tunes the
relative weight of the real space _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> and the reciprocal space _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> contributions to the energy,
but the final result is independent of _α_ . In practice, _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> and _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> can be computed using
cut-offs, because the sum over _n_ in (2.6) and the sum over _k_ in (2.8) converge exponentially
fast. Typically, one chooses _α_ large enough to employ the minimum image convention <sup>15</sup> in
Eq. (2.6).
At given real and reciprocal space cut-offs _r_ cut and _k_ cut, there exists actually an _optimal_ _α_
such that the accuracy of the approximated Ewald sum is as high as possible. This optimal
value can be determined with the help of the estimates for the cut-off errors derived by
Kolafa and Perram <sup>16</sup>, by demanding that the real and reciprocal space contributions to the
error are equal. Kolafa and Perram’s root-mean-square error estimates are
∆ _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _≃_ _Q_ <sup>2</sup>
~~�~~ _<u>rc</u>_ _<u>e</u>_ <sup>_−α_</sup> <sup>2</sup> <sup>_r_</sup> <sup>2</sup>
2 _L_ <sup>3</sup> ( _αr_ cut
(2.14)
( _αr_ cut) <sup>2</sup>
cut
and
∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> _≃_ _Q_ <sup>2</sup> _α_ <sup>_<u>e−</u>_</sup> <sup>(</sup> <sup>_πk_</sup> <sup>cut</sup> <sup>_/αL_</sup> <sup>)2</sup>
_._ (2.15)
_π_ <sup>2</sup> _k_ cut <sup>3</sup> <sup>_/_</sup> <sup>2</sup>
cut
These error estimates make explicit the exponential dependence of the error on the real and
reciprocal space cut-offs.
6
Formula (2.15) is actually valid only when a correction term (given by Eq. (3.8) below)
is added, to compensate the systematic error that affects the reciprocal energies when the
sum over wave vectors in (2.8) is truncated. The origin of this correction term is explained
in detail in Sec. III. A similar term must also be introduced in the P3M algorithm when
one computes the electrostatic energy. Similarly, the direct-space energy (2.6) also contains
a systematic error when the pair-wise interaction is truncated at the cut-off distance _r_ cut.
The derivation in the next section will also provide a correction term for this effect.
To summarize, the final Ewald formula for the total electrostatic energy reads
_E_ = _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> [eq _._ (2.6)]
+ _E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup> [eq _._ (2.8)]
_−_ _E_ <sup>(</sup> <sup>_s_</sup> <sup>)</sup> [eq _._ (2.9)]
+ _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> [eq _._ (2.2)]
+ _E_ <sup>(</sup> <sup>_n_</sup> <sup>)</sup> [eq _._ (2.13)]
(2.16)
Furthermore, when the sums in _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> and _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> are evaluated numerically using cut-offs, an
additional correction term _E_ cut, defined in Eq. (3.13) below, must be added to the truncated
energy, as shown in the next section.
III. CORRECTION TERM FOR TRUNCATED EWALD SUMS
If we consider electroneutral systems where the charged particles are located at random,
we expect the electrostatic energy to vanish on average, because there is an equal probability
to find a positive or negative charge at any relative distance _r_ . However, when periodic
boundary conditions (PBC) are applied, the average energy of random systems does not
vanish, because each charge interacts with its own periodic images (and with the uniform
neutralizing background provided by the other charges).
Since this interaction energy _E_ img of an ion with its periodic images and with the neu
tralizing background does not depend on the position of the ion in the simulation box, it
plays the role of a “self-energy”. We will refer to _E_ img as the Madelung (self-)energy of an
ion, to avoid confusion with the self-energy 2 <sup><u>1</u></sup> <sup>_q_</sup> <sup>2</sup> <sup>_φ_</sup> <sup>(0) already defined in the Ewald method as</sup>
the reciprocal interaction of a particle with itself.
We denote by angular brackets the average over the positions of the _N_ charged particles:
7
<u>1</u>
_⟨· · ·⟩_ =
_V_ <sup>_N_</sup>
_V_ <sup>_N_</sup> <sup>_· · ·_</sup> <sup>d</sup> <sup>_r_</sup> <sup>1</sup> <sup>_..._</sup> <sup>d</sup> <sup>_r_</sup> <sup>_N_</sup> <sup>_._</sup> (3.1)
A. Madelung energy
The Madelung energy of an ion takes the form _E_ img = <sup><u>1</u></sup> 2 <sup>_q_</sup> <sup>2</sup> <sup>_ζ_</sup> <sup>, where</sup> <sup>_ζ_</sup> <sup>is a purely numerical</sup>
factor in units of 1 _/L_ that depends only on the size and shape of the simulation box.
Let us calculate the average electrostatic energy of random charged systems in PBC,
to find the value of _ζ_ and derive a correction term for cut-off errors in truncated Ewald
sums (some results derived here will be used in Sec. VI A). On the one hand, the average
Coulomb energy of the random systems is by definition _Q_ <sup>2</sup> _ζ/_ 2, while on the other hand, it
and a reciprocal space
can be calculated as the sum of a direct space contribution
- _E_ <sup>(</sup> <sup>_r_</sup> <sup>)�</sup>
contribution
- _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
- _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
<u>1</u> =
2 _L_ <sup>3</sup>
_i,j_
<u>1</u> =
2 _L_ <sup>3</sup>
. The average reciprocal energy is, using (2.9) and (2.8),
_qiqj_
- _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_i−_</sup> <sup>_r_</sup> <sup>_j_</sup> <sup>)��</sup> _φ_ ( _k_ ) _−_ _Q_ <sup>2</sup> <sup>_<u>α</u>_</sup> (3.2)
_~~√~~_ _<u>π</u>_ _._
_k_ _∈_ K
_k_ _̸_ =0
Since _⟨_ exp( _−i_ _k_ _·_ _r_ _j_ ) _⟩_ = _δ_ _k_ _,_ 0, all terms with _j̸_ = _i_ vanish (this is due to the fact that the
Ewald pair potential averages to zero, see Appendix A). By contrast, “self” terms ( _i_ = _j_ )
remain and lead to
- <u>1</u>
_L_ <sup>3</sup>
= <sup>_<u>Q</u>_</sup> 2 <sup>2</sup> <sup>_ζ_</sup> <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_,_</sup> (3.3)
_k_ _∈_ K
_k_ _̸_ =0
_φ_ �( _k_ ) _−_ <sup><u>2</u></sup> <sup>_<u>α</u>_</sup>
_~~√~~_ _<u>π</u>_
- _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
= <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
where the second equality defines _ζ_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> . The average real-space energy of a single ion of
charge _qi_ in periodic random systems is
_n_ _∈_ Z <sup>3</sup>
_n_ =0 _̸_
R <sup>3</sup> <sup>_ψ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) d3</sup> <sup>_r_</sup>
- _Ei_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
- _<u>i</u>_
= <sup>_<u>q</u>_</sup> <sup>2</sup>
2
��
(3.4)
_ψ_ ( _n_ _L_ ) _−_ <sup><u>1</u></sup>
_L_ <sup>3</sup>
where the first term is the sum of the direct interactions of the ion with all its periodic
images, while the second term corresponds to its interaction with the uniform background
charge density _−qi/L_ <sup>3</sup> provided by the other particles in the system. Since
R <sup>3</sup> <sup>_ψ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) d3</sup> <sup>_r_</sup> <sup>= 4</sup> <sup>_π_</sup>
- _∞_
_∞_ _r_ <sup>2</sup> _ψ_ ( _αr_ ) d _r_ = <sup>_<u>π</u>_</sup>
0 _α_
<sup>_<u>π</u>_</sup> (3.5)
_α_ <sup>2</sup> <sup>_,_</sup>
8
we can write the average _total_ real-space energy as
��
_n_ _∈_ Z <sup>3</sup>
_n_ =0 _̸_
= <sup>_<u>Q</u>_</sup> 2 <sup>2</sup> <sup>_ζ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_,_</sup> (3.6)
_<u>π</u>_
_ψ_ ( _n_ _L_ ) _−_
_α_ <sup>2</sup> _L_ <sup>3</sup>
- _E_ <sup>(</sup> <sup>_r_</sup> <sup>)�</sup>
= <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
which defines _ζ_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> . The second term in _ζ_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> is, not surprisingly, identical to the energy _E_ <sup>(</sup> <sup>_n_</sup> <sup>)</sup>
may also be obtained by splitting
defined in (2.13). Notice that the above result for
- _E_ <sup>(</sup> <sup>_r_</sup> <sup>)�</sup>
(2.6) into self ( _i_ = _j_ ) and interaction terms, and using for the latter <sup>�</sup> _j̸_ = _i_ <sup>_qj_</sup> <sup>=</sup> <sup>_−qi_</sup> <sup>which</sup>
follows from the electro-neutrality condition. The expression of the factor _ζ_ = _ζ_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> + _ζ_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> is
therefore
_k_ _∈_ K
_k_ _̸_ =0
_<u>π</u>_
_ψ_ ( _n_ _L_ ) _−_
_α_ <sup>2</sup> _L_ <sup>3</sup>
+
- <u>1</u>
_L_ <sup>3</sup>
_φ_ �( _k_ ) _−_ <sup><u>2</u></sup> <sup>_<u>α</u>_</sup>
_~~√~~_ _<u>π</u>_
_._ (3.7)
_ζ_ =
��
_n_ _∈_ Z <sup>3</sup>
_n_ =0 _̸_
Eq. (3.7) can be computed for a number of different box geometries <sup>17</sup> . For a cubic
simulation box of size _L_, it yields <sup>18,19</sup>
_ζ_ _≃−_ 2 _._ 837297479480619610825442578061 _/L._
The above calculation shows that, when a charged system is simulated using PBC, the
electrostatic energy (2.1) contains an additional contribution _Q_ <sup>2</sup> _ζ/_ 2. The existence of this
Madelung self-energy can be made more apparent in the Ewald formula for _E_, as shown in
Appendix A.
B. Madelung cut-off error correction terms
The Ewald sums (2.6) and (2.8) are necessarily truncated when evaluated in a simula
tion. These truncations introduce systematic cut-off errors in the total energy, because the
Madelung self-energies of the ions are then not fully accounted for. This systematic error is
typically of the same order of magnitude, or even larger, than the fluctuating error, due to
the use of cut-offs, in the Ewald pair interaction energy <sup>16,20</sup> . Note, that no similar systematic
error affects the electrostatic forces, because the Madelung energy does not depend on the
position of the ion.
Fortunately, it is easy to suppress the systematic bias in the computed energies. We
simply have to add the cut-off correction
cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>=</sup> <sup>_<u>Q</u>_</sup> <sup>2</sup>
2 _L_
_E_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
<sup>_<u>Q</u>_</sup> <sup>2</sup>
2 _L_ <sup>3</sup>
_k_ _∈_ K
_k>k_ cut
_φ_ �( _k_ ) (3.8)
9
to the computed _k_ -space energies, which Kolafa and Perram termed the _diagonal_ _correc-_
_tion_ <sup>16</sup> . The value of _E_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>does</sup> <sup>not</sup> <sup>depend</sup> <sup>on</sup> <sup>the</sup> <sup>configuration</sup> <sup>and</sup> <sup>may</sup> <sup>thus</sup> <sup>be</sup> <sup>computed</sup>
in advance using a sufficiently large second cut-off _k_ cut <sup>_′_</sup> <sup>_>_</sup> <sup>_k_</sup> <sup>_>_</sup> <sup>_k_</sup> <sup>cut.</sup> <sup>Using</sup> <sup>definition</sup> <sup>(3.3)</sup>
of _ζ_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup>, we can rewrite (3.8) as
cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>=</sup> <sup>_<u>Q</u>_</sup> <sup>2</sup>
_E_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
2
- _ζ_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> _−_ _ζ_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
(3.9)
where
cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>=</sup> <sup><u>1</u></sup>
_L_ <sup>3</sup>
_φ_ �( _k_ ) _−_ <sup><u>2</u></sup> <sup>_<u>α</u>_</sup> (3.10)
_~~√~~_ _<u>π</u>_ _._
_ζ_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
_L_ <sup>3</sup>
_k_ _∈_ K
_k_ _̸_ =0 _, k<k_ cut
Similarly, if the real-space energies are computed using a cut-off _r_ cut _<_ _L/_ 2 (minimum
image convention), we see from Eqs. (3.4), (3.5), and (3.6), that the _r_ -space cut-off correction
cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>=</sup> <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
_E_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
<sup>2</sup> cut <sup>)</sup> (3.11)
2 <sup>(</sup> <sup>_ζ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_ζ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
where
cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>=</sup> <sup>_−_</sup> <sup><u>4</u></sup> <sup>_<u>π</u>_</sup>
_L_ <sup>3</sup>
_ζ_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
_L_ <sup>3</sup>
- _r_ cut
_r_ <sup>2</sup> _ψ_ ( _r_ )d _r_
0
<sup>_<u>r</u>_</sup> <sup><u>cut</u></sup>
_α_ <sup>_~~√~~_</sup> _<u>π</u>_ <sup>_e−α_</sup> <sup>2</sup> <sup>_r_</sup> <sup>2</sup>
cut <sup>2</sup> _−_ erf( _αr_ cut)
- <sup>�</sup>
(3.12)
= _−_ <sup><u>2</u></sup> <sup>_<u>π</u>_</sup>
_L_ <sup>3</sup>
_r_ <sup>2</sup>
cut <sup>2</sup> <sup>_−_</sup> <sup>_<u>r</u>_</sup> <sup><u>cut</u></sup>
_α_ <sup>_~~√~~_</sup>
_r_ <sup>2</sup>
<u>1</u>
cut <sup>2</sup> <sup>_−_</sup>
2 _α_ <sup>2</sup>
must be applied to the direct space energies. It is natural that the correction terms _E_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
must be applied to the direct space energies. It is natural that the correction terms _E_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
and _E_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>are made up of the exact Madelung energies, minus the average Madelung energies</sup>
and _E_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
of the ions as obtained from a calculation with direct and reciprocal space cut-offs _r_ cut and
_k_ cut.
Adding (3.9) to (3.11) and using (3.7), the two cut-off corrections can be combined into
a single expression
cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_ζ_</sup> cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
cut
_E_ cut = _E_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>+</sup> <sup>_E_</sup> cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>=</sup> <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
_._ (3.13)
- _ζ −_ _ζ_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
All of these terms can easily be precomputed numerically before the start of a simulation.
Correcting the systematic cut-off errors in the energies with the term _E_ cut does improve
significantly the accuracy of the results, especially when working with small cut-offs. In
numerical tests, however, the direct space cut-off correction _E_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>has</sup> <sup>been</sup> <sup>found</sup> <sup>to</sup> <sup>be</sup>
mostly negligible compared to the reciprocal space correction _E_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>for all practical purposes.</sup>
10
IV. MESH-BASED EWALD SUM
The idea of particle-mesh algorithms is to speed up the calculation of the reciprocal
energy _E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup> with the help of a Fast-Fourier-Transform (FFT). To use a FFT, the charge
density must be assigned to points on a regular grid. There are several ways of discretizing
the charge density on a grid, and to get the electrostatic energy from the Fourier transformed
grid. We will use the P3M method of Hockney and Eastwood (but with the standard Ewald
reciprocal interaction (2.3)), because this method surpasses in efficiency the other variants
of mesh based Ewald sums (PME, SPME) <sup>3</sup> .
For simplicity, we assume the number of grid points _M_ to be identical in all three direc
tions. Let _h_ = _L/M_ be the spacing between two adjacent grid points. We denote by M the
set of all grid points: M = _{_ _m_ _h_ : _m_ _∈_ Z <sup>3</sup> and 0 _≤_ _mx,y,z_ _< M_ _}_ .
The mesh based calculation of the reciprocal energy is made in the following steps:
A. Assign charges to grid points
The charge density _ρ_ M( _r_ ) at a grid point _r_ is computed via the equation
_ρ_ M( _r_ ) =
_U_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _ρ_ ( _r_ <sup>_′_</sup> )d _r_ <sup>_′_</sup> _,_ _r_ _∈_ M _,_ (4.1)
where _U_ ( _r_ ) = _h_ <sup>_−_</sup> <sup>3</sup> _W_ ( _r_ ) with _W_ the charge assignment function (the factor _h_ <sup>_−_</sup> <sup>3</sup> ensures
merely that _ρ_ M( _r_ ) has the dimensions of a density). A charge assignement function is clas
sified according to its order _P_, _i.e._ between how many grid points per coordinate direction
each charge is distributed. Typically, one chooses a cardinal B-spline for _W_, which is a
piece-wise polynomial function of weight one. The order _P_ gives the number of sections in
the function. In P3M, we only need the Fourier transform of the cardinal B-splines, which
are
<u>sin(</u> _<u>kyh/</u>_ <u>2)</u>
_kyh/_ 2
<u>sin(</u> _<u>kzh/</u>_ <u>2)</u>
_kzh/_ 2
- _P_
_._ (4.2)
_W_ - <sup>(</sup> <sup>_P_</sup> <sup>)</sup> ( _k_ ) = _h_ <sup>3</sup>
- <u>sin(</u> _<u>kxh/</u>_ <u>2)</u>
_kxh/_ 2
Notice that _ρ_ M( _r_ ) = _h_ <sup>_−_</sup> <sup>3 �</sup> _i_ <sup>_qi W_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_−_</sup> <sup>_r_</sup> <sup>_i_</sup> <sup>),</sup> <sup>apart</sup> <sup>at</sup> <sup>the</sup> <sup>boundaries</sup> <sup>where</sup> <sup>the</sup> <sup>periodicity</sup>
has to be properly taken into account.
11
B. Fourier transform the charge grid
Compute the finite Fourier transform of the mesh-based charge density (using the FFT
algorithm)
_ρ_ �M( _k_ ) = _h_ <sup>3 �</sup>
_r_ _∈_ M
_ρ_ M( _r_ ) _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> = FFT _{ρ_ M _},_ _k_ _∈_ M <sup>�</sup> _._ (4.3)
Here _k_ is a wave vector in the reciprocal mesh M <sup>�</sup> = _{_ 2 _π_ _n_ _/L_ : _n_ _∈_ Z <sup>3</sup> _, |nx,y,z| < M/_ 2 _}_ .
We stress that _ρ_ �M( _k_ ) differs from _ρ_ �( _k_ ) for _k_ _∈_ M <sup>�</sup>, because sampling of the charge density
on a grid introduces errors (see Sec. V).
C. Solve Poisson equation (in Fourier space)
The mesh-based electrostatic potential ΦM is given by the Poisson equation, which re
duces to a simple multiplication in k-space:
Φ�M( _k_ ) = _ρ_ �M( _k_ ) _φ_ �( _k_ ) _,_ _k_ _∈_ M <sup>�</sup> _,_ (4.4)
with _φ_ <sup>�</sup> ( _k_ ) the Fourier transformed reciprocal interaction (2.11). However, instead of using
_φ_ �( _k_ ) in the above equation, it is better to introduce an “influence” function _G_ �( _k_ ). We
replace therefore Eq. (4.4) by
Φ�M( _k_ ) = _ρ_ �M( _k_ ) _G_ �( _k_ ) _,_ _k_ _∈_ M <sup>�</sup> _._ (4.5)
where _G_ <sup>�</sup> ( _k_ ) is determined by the condition that it leads to the smallest possible errors in
the computed energies (on average for uncorrelated random charge distributions). _G_ <sup>�</sup> ( _k_ ) will
be determined later (see Eq. (6.21)); it can be computed once and for all at the beginning
of a simulation since it depends only on the mesh size and the charge assignment function.
_G_ �( _k_ ) plays basically the same role as the reciprocal interaction _φ_ �( _k_ ), except that it is tuned
to minimize a well defined error functional in _ρ_ �M( _k_ ). We stress that _G_ <sup>�</sup> ( _k_ ) is defined only
for _k_ _∈_ M <sup>�</sup> (we dropped the subscript M on the influence function to alleviate the notation).
The idea of optimizing _G_ <sup>�</sup> ( _k_ ), which is a key-point of the P3M algorithm, ensures that the
mesh based calculation of the reciprocal energy gives the best possible results <sup>2</sup>
12
D. Get total reciprocal electrostatic energy
Expression (2.8) is approximated on the mesh by
<sup>(</sup> <sup>_ks_</sup> <sup>)</sup> <u>1</u>
P3M <sup>=</sup>
2 _L_ <sup>3</sup>
_E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M
_|ρ_ �M( _k_ ) _|_ <sup>2 �</sup> _G_ ( _k_ ) _._ (4.6)
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
The total reciprocal energy follows from subtracting the self-energies from the above quan
tity: _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>=</sup> <sup>_E_</sup> P3M <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M <sup>(</sup> <sup>_ks_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_E_</sup> <sup>(</sup> <sup>_s_</sup> <sup>).</sup>
E. Electrostatic energy of individual charges (optional)
If the reciprocal energy of each individual particle is needed (and not only their sum as
in step 4), the potential mesh must be transformed back to real space via an inverse FFT,
_i.e._
ΦM( _r_ _m_ ) = <sup><u>1</u></sup>
_L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_φ_ �M( _k_ ) _e_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_m_</sup> = FFT <sup>_−_</sup> <sup>1</sup> _{φ_ �M _}._ (4.7)
The mesh-based potential is then mapped back to the particle positions using the same
charge assignment function:
Φ( _r_ ) :=
_r_ _m∈_ Mp
_W_ ( _r_ _−_ _r_ _m_ )ΦM( _r_ _m_ ) _._ (4.8)
In this equation, Mp = _{_ _m_ _h_ : _m_ _∈_ Z <sup>3</sup> _}_ is the mesh extended by periodicity to all space,
and ΦM( _r_ ) is assumed to be periodic (with period _L_ ). The interpretation of Eq. (4.8) is
the following: due to the discretization each particle is replaced by several “sub-particles”
which are located at the surrounding mesh points and carry the fraction _W_ ( _r_ _−_ _r_ _m_ ) of the
charge of the original particle. The potential at the position of the original particle is given
by the sum of the charge fraction times the potential at each mesh points. The reciprocal
electrostatic energy of the _i_ <sup>th</sup> particle is then _qi_ Φ( _r_ _i_ ) _/_ 2, and the total reciprocal energy
(including self-energies) is the sum
_i_
<sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M <sup>=</sup> <sup><u>1</u></sup>
2
_E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M
2
_V_
_ρ_ ( _r_ )Φ( _r_ )d _r_ = <sup><u>1</u></sup>
2
_qi_ Φ( _r_ _i_ ) _._ (4.9)
This formula gives the same result for the total energy as Eq. (4.6). A mathematical proof
of the equivalence is given in Appendix C.
13
V. ANALYSIS OF DISCRETIZATION ERRORS
If the fast Fourier transform has the benefit of speed, it has the drawback of introducing
errors in the _k_ -space spectrum of the charge density: _ρ_ �M( _k_ ) differs from the true Fourier
transform (2.12)(times a trivial factor _U_ <sup>�</sup> ( _k_ )) because of the discretization on a finite grid.
The difference is two-fold. Firstly, _ρ_ �( _k_ ) is defined for any vector in the full k-space K,
whereas _ρ_ �M( _k_ ) is defined only for _k_ _∈_ M <sup>�</sup>, _i.e._ in the first Brillouin zone. This is a first
natural consequence of discretization: if the grid spacing is _h_, it necessarily introduces a
cut-off _|kx,y,z|_ _<_ _π/h_ in _k_ -space. Secondly, the act of sampling the charge density at grid
points, which is mathematically embodied in Eq. (4.3) by the presence of a discrete Fourier
transform instead of a continuous FT, introduces _aliasing_ errors. While a continuous FT
would simply transform the convolution Eq. (4.1) into
FT _{ρ_ M _}_ ( _k_ ) = _U_ <sup>�</sup> ( _k_ ) _ρ_ �( _k_ ) _,_ _k_ _∈_ K _,_ (5.1)
the finite Fourier transform results in (see proof in Appendix B)
_ρ_ �M( _k_ ) = FFT _{ρ_ M _}_ ( _k_ ) =
_m_ _∈_ Z <sup>3</sup>
_U_ �( _k_ + _m_ _kg_ ) _ρ_ �( _k_ + _m_ _kg_ ) _,_ _k_ _∈_ M <sup>�</sup> _,_ (5.2)
where _kg_ = 2 _π/h_ . The sum over _m_ shows that spurious contributions from high frequencies
of the full spectrum _U_ <sup>�</sup> ( _k_ ) _ρ_ �( _k_ ) are introduced into the first Brillouin zone M <sup>�</sup> . These unwanted
copies of the other Brillouin zones into the first one are known as aliasing errors <sup>2</sup> .
To avoid aliasing errors, the spectrum needs to be entirely contained within the first
Brillouin zone. Since _ρ_ �( _k_ ) may contain arbitrary high frequencies, this can only be achieved
by choosing _U_ ( _k_ ) to be a low-pass filter satisfying _U_ <sup>�</sup> ( _k_ ) = 0 for _k_ _∈_ K _\_ M <sup>�</sup> . But the
charge assignment function would then have a compact support in _k_ -space, and hence an
infinite support in _r_ -space. This is not acceptable, as it would require the grid to have an
infinite extension. The need to keep the charge assignment function local in _r_ -space means
that _U_ <sup>�</sup> ( _k_ ) cannot be a perfect low pass filter. Aliasing errors are therefore unavoidable,
and the impact of these errors must be minimized, by choosing a good compromise for the
charge assignment function and optimizing the influence function. The influence function
can indeed compensate partially for the aliasing errors, because the spectrum of _U_ <sup>�</sup> ( _k_ ) is
known exactly at all frequencies.
The error in reciprocal energy, for a given configuration _ρ_ ( _r_ ) of the charges, is defined by
14
the difference
∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> = _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_E_</sup> <sup>(</sup> <sup>_k_</sup> <sup>)</sup> (5.3)
where _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> is the exact reciprocal energy (see (2.8) and (2.9)). The above analysis of dis
cretization errors results in the explicit formula for this error
∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> = <u>1</u> 2 _L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
_|ρ_ �M( _k_ ) _|_ <sup>2 �</sup> _G_ ( _k_ ) _−_ <u>1</u> 2 _L_ <sup>3</sup>
_k_ _∈_ K
_k_ _̸_ =0
_|ρ_ �( _k_ ) _|_ <sup>2</sup> _φ_ <sup>�</sup> ( _k_ ) _,_ (5.4)
where _ρ_ �M( _k_ ) is given by (5.2). The error ∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> is due to the finite resolution _h_ offered by the
mesh. The finiteness of _h_ introduces the cut-off _π/h_ in _k_ -space ( _k_ _∈_ M <sup>�</sup> ) and causes aliasing
errors ( _ρ_ �M( _k_ ) _̸_ = _ρ_ �( _k_ ) _U_ <sup>�</sup> ( _k_ )) that cannot be entirely eliminated by the charge assignment
function.
VI. OPTIMIZATION OF THE P3M ALGORITHM
We derive in this section the influence function _G_ <sup>�</sup> ( _k_ ) that minimizes the error (5.4) on
average for uncorrelated systems, and give a formula for the associated RMS errors. The
average over random systems is denoted by angular brackets, as in Sec. III.
Notice that the assumption of the absence of correlations is never satisfied in practice
(even for uniform systems because negative charges tend to cluster around positive charges
and vice-versa). The error estimate proves however to predict quite accurately the error in
real systems with correlations, notably in liquids where the pair distribution function _g_ ( _r_ )
decays rapidly to one.
A. Shift in the energies to avoid systematic errors
= 0, because
The P3M energies (4.6) contain in general systematic errors, _i.e._
�∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
the Madelung energies of the ions obtained in the mesh calculation contain cut-off and
aliasing errors. The average error
_−_
- _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
=
(6.1)
_K_ =
�∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
- _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
is a constant that must be _subtracted_ from the P3M energies, to ensure that the energies
are right on average. The corrected P3M energies are thus obtained by applying a constant
15
shift to the original P3M energies:
P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> _,_ corr <sup>=</sup> <sup>_E_</sup> P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
_E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K,_</sup> (6.2)
where the constant _K_ depends on the various P3M parameters like mesh size, charge as
signment order (CAO) and Ewald splitting parameter.
_−_
- _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
,
Let us determine analytically the constant (6.1). Writing it as _K_ =
- _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
we can use the result (3.3) for
- _E_ <sup>(</sup> <sup>_k_</sup> <sup>)�</sup> : it is nothing but _Q_ <sup>2</sup> _ζ_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> _/_ 2, _i.e._ the _k_ -space Madelung
can be calculated in the same way as (3.2).
energies of the ions. The other term
Using (4.6), (5.2) and (2.9), we find
- _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
- <u>1</u>
_L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
_G_ �( _k_ )
_m_ _∈_ Z <sup>3</sup>
= <sup>_<u>Q</u>_</sup> <sup>2</sup> P3M <sup>_,_</sup> (6.3)
2 <sup>_ζ_</sup> <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
- _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
= <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
_U_ - <sup>2</sup> ( _k_ + _kg_ _m_ ) _−_ <sup><u>2</u></sup> <sup>_<u>α</u>_</sup>
_~~√~~_ _<u>π</u>_
which defines _ζ_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>.</sup> <sup>The</sup> <sup>result</sup> <sup>(6.3)</sup> <sup>can</sup> <sup>be</sup> <sup>interpreted</sup> <sup>as</sup> <sup>the</sup> <sup>average</sup> <sup>_k_</sup> <sup>-space</sup> <sup>Madelung</sup>
energies of the ions _as_ _obtained_ _from_ _the_ _mesh_ _calculation_, _i.e._ including cut-off and aliasing
errors. The explicit expression of the correction constant (6.1) is thus
_K_ = <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
��
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
_G_ �( _k_ )
_m_ _∈_ Z <sup>3</sup>
- _ζ_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_ζ_</sup> <sup>(</sup> <sup>_k_</sup> <sup>)�</sup>
= <sup>_<u>Q</u>_</sup> <sup>2</sup>
2 _L_ <sup>3</sup>
_U_ - <sup>2</sup> ( _k_ + _kg_ _m_ ) _−_
_k_ _∈_ K
_k_ _̸_ =0
_φ_ �( _k_ ) (6.4)
In the last sum in (6.4), the terms with _|kx,y,z|_ _>_ _π/h_ are equivalent to the _k_ -space cut
off correction defined in (3.8). These terms compensate for the fact that the Madelung
energies of the ions are underestimated in the mesh calculation because of the cut-off _π/h_
introduced by the finite size of the mesh. The remaining terms in (6.4) compensate, on
average, the aliasing errors that affect the Madelung energies of the ions obtained from the
mesh calculation.
Notice that the two correction terms _E_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>and</sup> <sup>_−K_</sup> <sup>can be combined together in the simple</sup>
expression
P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_ζ_</sup> cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
cut
P3M <sup>cut</sup> <sup>=</sup> <sup>_E_</sup> cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
2
_E_ P3M <sup>cut</sup>
cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup> <sup>=</sup> <sup>_<u>Q</u>_</sup> <sup>2</sup>
(6.5)
- _ζ −_ _ζ_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
where _ζ_ is defined by (3.7) and _ζ_ cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
P3M <sup>cut</sup> <sup>has</sup> <sup>the</sup> <sup>same</sup>
cut <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>is</sup> <sup>given</sup> <sup>in</sup> <sup>(3.12).</sup> <sup>We</sup> <sup>stress</sup> <sup>that</sup> <sup>_E_</sup> P3M <sup>cut</sup>
structure as the correction term (3.13) for truncated Ewald sums. The difference lies in the
replacement of _ζ_ cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
cut <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>by the quantity</sup> <sup>_ζ_</sup> P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>defined in (6.3), which accounts for both the cut-off</sup>
and aliasing errors that affect the reciprocal energies computed on the mesh.
16
In summary, the final formula for computing the total electrostatic energy with the P3M
algorithm is
_E_ _≈_ _E_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> [eq _._ (2.6)]
+ _E_ P3M <sup>(</sup> <sup>_ks_</sup> <sup>)</sup> [eq _._ (4.6)]
_−_ _E_ <sup>(</sup> <sup>_s_</sup> <sup>)</sup> [eq _._ (2.9)]
+ _E_ <sup>(</sup> <sup>_d_</sup> <sup>)</sup> [eq _._ (2.2)]
+ _E_ <sup>(</sup> <sup>_n_</sup> <sup>)</sup> [eq _._ (2.13)]
(6.6)
+ _E_ P3M <sup>cut</sup> [eq _._ (6.5)]
The correction term _E_ P3M <sup>cut</sup> <sup>is necessary to compensate on average for systematic errors in the</sup>
mesh calculation. It can be computed once for all before the start of a simulation, since it
depends only on the size of the simulation box, the size of a mesh cell, the charge assignment
function and the influence function.
B. RMS error estimate for energy
The result (5.4) is an exact measure of the error in the P3M energies for a given configu
ration _ρ_ ( _r_ ) of the particles. Let us average this expression over all possible positions of the
particles to get a useful overall measure of the accuracy of the algorithm. The RMS error
of the corrected P3M energies is, by definition,
(6.7)
(∆ _E_ RMS <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>)2</sup> <sup>:=</sup>
�( _E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> _,_ corr <sup>_−_</sup> <sup>_E_</sup> <sup>(</sup> <sup>_k_</sup> <sup>))2�</sup>
=
(∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> _−_ _K_ ) <sup>2�</sup>
where we used (5.3) and (6.2). We can isolate in ∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup> “interaction” terms ( _i̸_ = _j_ ) from self
terms ( _i_ = _j_ ):
self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup>
(∆ _E_ RMS <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>)2</sup> <sup>=</sup>
��
∆ _E_ int <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
int <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>+ ∆</sup> <sup>_E_</sup> self <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
�2 <sup>�</sup>
_._ (6.8)
We recall from Sec.III that the interaction terms vanish on average for random systems:
�∆ _E_ int <sup>(</sup> <sup>_k_</sup> <sup>)</sup> - = 0. The correlation
int
= 0. The correlation
�∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
int
self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_·_</sup> <sup>∆</sup> <sup>_E_</sup> int <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
= 0 (6.9)
vanishes as well for the same reason (this is due to the fact that the average Ewald interaction
energy between a fixed particle _i_ and a particle _j̸_ = _i_ is zero, see Appendix A). Eq. (6.8)
17
reduces therefore to
(∆ _E_ RMS <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>)2</sup> <sup>=</sup>
�(∆ _E_ int <sup>(</sup> <sup>_k_</sup> <sup>))2�</sup>
+
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup> <sup>)2�</sup>
_,_ (6.10)
where the first term accounts for fluctuating errors in the interactions energies, and the
second term accounts for fluctuating errors in the corrected Madelung self-energies of the
ions. Since the latter term may be written as
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup> <sup>)2�</sup>
=
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>)2�</sup>
_−_ _K_ <sup>2</sup> _,_ (6.11)
we remark that the shift _−K_ derived in the previous section, in addition to removing the
systematic bias in the _k_ -space energies, also reduces the fluctuating errors of the _k_ -space
self-energies by an amount _−K_ <sup>2</sup> .
In the substraction ∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup> <sup>,</sup> <sup>it</sup> <sup>can</sup> <sup>be</sup> <sup>seen,</sup> <sup>from</sup> <sup>(5.4)</sup> <sup>in</sup> <sup>which</sup> <sup>only</sup> <sup>_i_</sup> <sup>=</sup> <sup>_j_</sup> <sup>terms</sup> <sup>are</sup>
kept and (6.4), that all terms containing _φ_ <sup>�</sup> ( _k_ ) cancel out, so we have
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup> <sup>)2�</sup>
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
=
��
_m_ 1
_m_ 2
_U_ �( _km_ 1) _U_ �( _km_ 2) _e_ <sup>_ikg_</sup> <sup>(</sup> <sup>_m_</sup> <sup>1</sup> <sup>_−_</sup> <sup>_m_</sup> <sup>2)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_i_</sup>
�� <u>1</u> 2 _L_ <sup>3</sup>
_qi_ <sup>2</sup>
_qi_ <sup>2</sup>
_k_ _∈_ M <sup>e</sup>
_̸_
_G_ �( _k_ )
_i_
_k_ _̸_ =0
��2
_U_ - <sup>2</sup> ( _km_ )
_−_
_m_
(6.12)
where we used the symmetry _U_ <sup>�</sup> ( _−_ _k_ ) = _U_ <sup>�</sup> ( _k_ ) and introduced the shorthand notation _km_ =
_k_ + _kg_ _m_ . When the square is expanded, the summation over particles <sup>�</sup> _i_ <sup>becomes a double</sup>
summation <sup>�</sup> _i,i_ <sup>_′_</sup> <sup>.</sup> <sup>All</sup> <sup>terms</sup> <sup>with</sup> <sup>_i′̸_</sup> <sup>=</sup> <sup>_i_</sup> <sup>vanish,</sup> <sup>because</sup> <sup>_⟨_</sup> <sup>exp(</sup> <sup>_ikg_</sup> <sup>(</sup> <sup>_m_</sup> <sup>1</sup> <sup>_−_</sup> <sup>_m_</sup> <sup>2)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_i_</sup> <sup>)</sup> <sup>_⟩_</sup> <sup>=</sup> <sup>_δ_</sup> <sup>_m_</sup> 1 <sup>_,_</sup> <sup>_m_</sup> 2 <sup>,</sup>
leaving identical sums over _m_ which cancel each other. The remaining terms _i_ <sup>_′_</sup> = _i_ evaluate
to
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_K_</sup> <sup>)2�</sup>
�(∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
<u>1</u> = 4 _L_ <sup>6</sup> <sup>(</sup>
_i_
_qi_ <sup>4)</sup>
_k_ <sup>_′_</sup> _∈_ M <sup>e</sup>
_k_ <sup>_′̸_</sup> =0
_G_ �( _k_ ) _G_ �( _k_ <sup>_′_</sup> ) _×_
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
_m_ 3
_U_ - <sup>2</sup> ( _km_ ) _·_
_m_ <sup>_′_</sup>
_U_ - <sup>2</sup> ( _k_ <sup>_′_</sup> _m_ <sup>_′_</sup> <sup>)</sup>
_m_
_×_
��
_m_ 1 _m_ 2
_U_ �( _km_ 1) _U_ �( _km_ 2) _U_ �( _k_ <sup>_′_</sup> _m_ 3 <sup>)</sup> <sup>_U_</sup> <sup>�(</sup> <sup>_k_</sup> <sup>_′_</sup> _m_ 1 _−_ _m_ 2+ _m_ 3 <sup>)</sup> <sup>_−_</sup>
<u>1</u> = 4 _L_ <sup>3</sup> <sup>(</sup>
_i_
_qi_ <sup>4</sup>
_i_ <sup>4)</sup> <sup>_H_</sup> <sup>2</sup>
self <sup>2</sup> (6.13)
with
self <sup>2</sup> <sup>=</sup> <sup><u>1</u></sup>
_L_ <sup>3</sup>
-
_m_ 2 _̸_ = _m_ 1 _m_ 3
18
_k_ <sup>_′_</sup> _∈_ M <sup>e</sup>
_k_ <sup>_′̸_</sup> =0
_G_ �( _k_ ) _G_ �( _k_ <sup>_′_</sup> )��
_m_ 1
_U_ �( _km_ 1) _U_ �( _km_ 2) _U_ �( _k_ <sup>_′_</sup> _m_ 3 <sup>)</sup> <sup>_U_</sup> <sup>�(</sup> <sup>_k_</sup> <sup>_′_</sup>
<sup>_′_</sup> _m_ 1 _−_ _m_ 2+ _m_ 3 <sup>)</sup>
_._
_H_ <sup>2</sup>
_L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
(6.14)
_i_ <sup>_q_</sup> _i_ <sup>4</sup>
The fluctuating errors of the Madelung self-energies scale therefore like <sup>�</sup>
_i_ <sup>4</sup> <sup>with</sup> <sup>the</sup>
valencies of the ions. The prefactor is somewhat complicated since it involves a double
summation over wave vectors and a triple summation over alias indices _m_ 1 _,_ _m_ 2 _,_ _m_ 3, but
_H_ <sup>2</sup>
self <sup>2</sup> <sup>can be evaluated reasonably fast.</sup> <sup>The numerical calculation of</sup> <sup>_H_</sup> <sup>2</sup>
self <sup>2</sup> <sup>can be accelerated</sup>
by taking profit of the symmetries (the sum over _k_ can be restricted to only half an octant of
the reciprocal mesh), and by skipping inner loops in the triple summation over alias indices
if the product of the charge fractions is almost zero.
We calculate now the fluctuations of the errors in the interaction energies, _i.e._ the first
term of Eq. (6.10). That term reads, using (6.8), (5.4), (5.2) and (2.12) and keeping only
interaction terms:
�(∆ _E_ int <sup>(</sup> <sup>_k_</sup> <sup>))2�</sup>
_m_ _∈_ Z <sup>3</sup>
_e_ <sup>_i_</sup> <sup>_km_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_i_</sup> _×_
=
�� <u>1</u> 2 _L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
_i,j_
_i_ = _̸_ _j_
_qiqj_
_×_ - _G_ �( _k_ )
��2
_e_ <sup>_−i_</sup> <sup>_km_</sup> <sup>_′_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_j_</sup> <sup>�</sup> _U_ ( _km_ ) _U_ <sup>�</sup> ( _km_ _′_ ) _−_ _e_ <sup>_−i_</sup> <sup>_km_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_j_</sup> <sup>�</sup> _φ_ ( _km_ )
_._ (6.15)
_m_ <sup>_′_</sup> _∈_ Z <sup>3</sup>
The calculation of this average is straightforward, though somewhat tedious. We find that
it reduces to
_≃_ 4 <sup>_<u>Q</u>_</sup> _L_ <sup>43</sup> <sup>_H_</sup> int <sup>2</sup> <sup>_,_</sup> (6.16)
�(∆ _E_ int <sup>(</sup> <sup>_k_</sup> <sup>))2�</sup>
int <sup>(</sup> <sup>_k_</sup> <sup>))2�</sup>
where
int <sup>2</sup> <sup>=</sup> <sup><u>2</u></sup>
_L_ <sup>3</sup>
_m_
��
_G_ - <sup>2</sup> ( _k_ )
_m_
�2
_U_ - <sup>2</sup> ( _km_ ) _−_ 2 _G_ <sup>�</sup> ( _k_ )
_U_ - <sup>2</sup> ( _km_ ) _φ_ �( _km_ ) +
_m_
_φ_ - <sup>2</sup> ( _km_ )
_H_ <sup>2</sup>
_L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
_._ (6.17)
The factor 2 in _H_ int <sup>2</sup> <sup>originates</sup> <sup>from</sup> <sup>the</sup> <sup>fact</sup> <sup>that</sup> <sup>each</sup> <sup>pair</sup> <sup>of</sup> <sup>particles</sup> <sup>appears</sup> <sup>twice</sup> <sup>in</sup>
the sum over _i_ and _j̸_ = _i_ in (6.15). Expression (6.17) is the analog for the energy of the
parameter _Q_ introduced by Hockney and Eastwood to measure the accuracy of the P3M
forces <sup>2</sup> . Notice that (6.17) is given in real space by
<u>2</u>
_H_ int <sup>2</sup> <sup>=</sup>
_V_ cell
_V_ cell
d _r_ 1
_L_ <sup>3 d</sup> <sup>_r_</sup> <sup>[</sup> <sup>_φ_</sup> <sup>P3M(</sup> <sup>_r_</sup> <sup>;</sup> <sup>_r_</sup> <sup>1)</sup> <sup>_−_</sup> <sup>_φ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_−_</sup> <sup>_r_</sup> <sup>1)]2</sup> (6.18)
where _φ_ P3M( _r_ ; _r_ 1) is the reciprocal potential at _r_ created by a unit charge located at _r_ 1, as
obtained from the P3M algorithm. (This potential is given in Fourier space by combining
19
(C4) with (5.2) in which we set _ρ_ ( _r_ ) = _δ_ ( _r_ _−_ _r_ 1).) _H_ int <sup>2</sup> <sup>is hence twice the squared deviation</sup>
between the potential _φ_ P3M obtained from the mesh calculation and the exact reciprocal
potential _φ_, summed over all relative positions _r_ within the simulation box, and averaged
over all possible positions of charge _r_ 1 in a mesh cell ( _V_ cell = _h_ <sup>3</sup> ).
Inserting the above results in (6.10), our final expression for the RMS error of the (cor
rected) P3M energies is
<sup>+ (�</sup> _<u>i</u>_ <sup>_q_</sup> <sup>4</sup> <u>self</u>
(6.19)
2 _L_ <sup>3</sup> <sup>_/_</sup> <sup>2</sup>
_<u>i</u>_ <sup>_q_</sup> _<u>i</u>_ <sup>4</sup>
_<u>i</u>_ <sup>4)</sup> <sup>_H_</sup> <sup>2</sup>
∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
RMS <sup>=</sup>
~~�~~ _Q_ <sup>4</sup> _H_ <u>int</u> <sup>2</sup>
<u>int</u> <sup>2</sup> <sup>+ (�</sup>
where _H_ <sup>2</sup>
int <sup>2</sup> <sup>and</sup> <sup>_H_</sup> <sup>2</sup>
self <sup>2</sup> <sup>are</sup> <sup>defined</sup> <sup>in</sup> <sup>Eqs.</sup> (6.17) and (6.14). This error depends on the
influence function _G_ <sup>�</sup> ( _k_ ). The optimal influence function (the one that minimizes the error)
will be determined in the next section. The above error estimate, together with the optimal
influence function (6.21) and the constant shift (6.4) which must be applied to the P3M
energies, constitute the main results of this paper.
The RMS error (6.19) displays two different scalings with the valencies of the ions:
_i_ <sup>_q_</sup> _i_ <sup>2</sup>
( <sup>�</sup>
_i_ <sup>2)2</sup> <sup>for</sup> <sup>errors</sup> <sup>coming</sup> <sup>from</sup> <sup>pair</sup> <sup>interactions</sup> <sup>(such</sup> <sup>a</sup> <sup>scaling</sup> <sup>also</sup> <sup>governs</sup> <sup>errors</sup> <sup>in</sup> <sup>P3M</sup>
forces <sup>5</sup> ) and <sup>�</sup> _i_
_i_ <sup>_q_</sup> _i_ <sup>4</sup>
_i_ <sup>4</sup> <sup>for</sup> <sup>errors</sup> <sup>in</sup> <sup>Madelung</sup> <sup>self-energies.</sup> <sup>Because</sup> <sup>of</sup> <sup>these</sup> <sup>different</sup> <sup>scalings,</sup>
the errors from pair interactions are expected to dominate in systems with many charged
particles ( _Q_ <sup>4</sup> _≫_ <sup>�</sup>
_i_ <sup>4).</sup> <sup>Notice</sup> <sup>that</sup> <sup>_H_</sup> <sup>2</sup>
self <sup>2</sup> <sup>is,</sup> <sup>roughly</sup> <sup>speaking,</sup> <sup>proportional</sup> <sup>to</sup> <sup>(�</sup>
_i_ <sup>_q_</sup> _i_ <sup>4</sup>
_k_ <sup>_G_</sup> <sup>�(</sup> <sup>_k_</sup> <sup>))2,</sup>
while _H_ <sup>2</sup>
_k_ <sup>_G_</sup> <sup>�2(</sup> <sup>_k_</sup> <sup>).</sup> <sup>The</sup> <sup>errors</sup> <sup>in</sup> <sup>the</sup> <sup>Madelung</sup> <sup>self-energies</sup> <sup>increase</sup> <sup>there-</sup>
self <sup>2</sup> <sup>scales</sup> <sup>like</sup> <sup>�</sup>
fore more rapidly than the errors in the pair interaction energies when the Ewald splitting
parameter _α_ (and hence _G_ <sup>�</sup> ( _k_ )) is increased, or when the size of the mesh is increased. The
importance of the two source of errors (fluctuations in pair interaction energies versus fluc
tuations in Madelung self-energies) will be compared in Sec. VII for a test system with
_Q_ <sup>2</sup> = 100.
C. Optimal influence function
We can now determine the optimal influence function _G_ <sup>�</sup> ( _k_ ), by imposing the condition
that it minimizes the RMS error (6.19). Since the errors coming from pair P3M interactions
are expected to dominate the self-interaction errors (except in systems with few particles),
we optimize the influence function only with respect to the pair interactions. Setting
_<u>δH</u>_ <u>int</u> <sup>2</sup>
_δG_ <sup>�</sup> ( _k_ )
= 0 _,_ (6.20)
20
gives immediately
_U_ - <sup>2</sup> ( _km_ ) _φ_ �( _km_ )
_G_ �( _k_ ) =
_<u>m</u>_ _<u>∈</u>_ Z <sup>3</sup>
(6.21)
<u>��</u> <u>�2</u>
_U_ - <sup>2</sup> ( _km_ )
_m_ _∈_ Z <sup>3</sup>
where we recall that the Fourier-transformed reciprocal interaction _φ_ <sup>�</sup> ( _k_ ) is given by (2.11).
An optimization of the influence function with respect to the _full_ RMS error could be
performed, but would require solving a linear system of _M_ <sup>3</sup> equations to compute _G_ <sup>�</sup> ( _k_ ).
The numerical results shown in Sec. VII will confirm that such a full optimization is not
necessary in typical systems.
Since _φ_ <sup>�</sup> ( _k_ ) decays exponentially fast, the optimal influence function is given in good
approximation by
_<u>U</u>_ <u>�</u> <sup>2</sup> <u>(</u> _<u>k</u>_ <u>)</u>
_G_ �( _k_ ) _≃_ _φ_ �( _k_ )
<u>��</u>
<u>�2</u> _._ (6.22)
_m_ _∈_ Z <sup>3</sup> <sup>_U_</sup> <sup>� 2(</sup> <sup>_km_</sup> <sup>)</sup>
_G_ �( _k_ ) differs thus from _φ_ �( _k_ ) by a factor which is always less than one. This damping of the
interaction compensates as well as possible for the aliasing errors introduced by the use of
a fast Fourier transform. If _U_ <sup>�</sup> ( _k_ ) were a perfect low-pass filter ( _U_ <sup>�</sup> ( _km_ ) = 0 if _m_ _̸_ = 0), no
aliasing error would occur and the influence function would reduce to _G_ <sup>�</sup> ( _k_ ) = _φ_ <sup>�</sup> ( _k_ ) _/U_ <sup>�</sup> <sup>2</sup> ( _k_ ).
This is indeed the result expected from (5.4) when aliasing errors are absent. The true
optimal influence function (6.21) differs from this simple expression by contributions from
the high-frequency spectrum of _U_ <sup>�</sup> ( _k_ ) and reciprocal interaction (2.11).
Hockney and Eastwood obtained the following optimal influence function by minimizing
the errors in the forces instead of the energy <sup>2</sup> :
_<u>m</u>_ <sup><u>(</u></sup> <sup>_<u>k</u>_</sup> <sup>_<u>·</u>_</sup> <sup>_<u>km</u>_</sup> <sup><u>)</u></sup> <sup>_<u>U</u>_</sup> <sup><u>� 2(</u></sup> <sup>_<u>km</u>_</sup> <sup><u>)</u></sup> <sup>_<u>φ</u>_</sup> <sup><u>�(</u></sup> <sup>_<u>km</u>_</sup> <sup><u>)</u></sup>
<u>�</u>
_G_ - <sup>(forces)</sup> ( _k_ ) =
_k_ <sup>2 ��</sup>
(6.23)
<u>�2</u>
_m_ <sup>_U_</sup> <sup>� 2(</sup> <sup>_km_</sup> <sup>)</sup>
Obviously, this function is also given in very good approximation by (6.22). This explains
why influence functions (6.21), (6.22) and (6.23) all give very similar results when computing
energies and forces.
Inserting (6.21) into (6.17), we find that the minimal value of _H_ int <sup>2</sup> <sup>is</sup>
�2 <sup></sup>
_._ (6.24)
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
<sup>�</sup>
_m_ _∈_ Z <sup>3</sup>
��
_H_ int <sup>2</sup>
��min <sup>=</sup> <sup><u>1</u></sup>
_L_ <sup>3</sup>
_φ_ - <sup>2</sup> ( _km_ ) _−_
_<u>m</u>_ <sup>_<u>U</u>_</sup> <sup><u>� 2(</u></sup> <sup>_<u>km</u>_</sup> <sup><u>)</u></sup> <sup>_<u>φ</u>_</sup> <sup><u>�(</u></sup> <sup>_<u>km</u>_</sup> <sup><u>)</u></sup>
<u>�</u>
_m_ <sup>_U_</sup> <sup>� 2(</sup> <sup>_km_</sup> <sup>)</sup>
21
This is the expression of _H_ int <sup>2</sup> <sup>to</sup> <sup>be</sup> <sup>used</sup> <sup>in</sup> <sup>the</sup> <sup>RMS</sup> <sup>error</sup> <sup>estimate</sup> <sup>(6.19)</sup> <sup>when</sup> <sup>the</sup> <sup>P3M</sup>
algorithm is optimized to yield the smallest possible errors in the pair interaction energies.
We recall that the errors in the P3M energies originate from aliasing effects (due to the
sampling on a grid) and truncation errors (due to the fact that the reciprocal mesh contains
only a finite number of wave vectors). The truncation error can only be reduced by choosing
a larger mesh or by using a reciprocal interaction with a faster decay in _k_ -space, whereas
the aliasing errors may be reduced by increasing the order of the charge assignment function
(up to the maximum order allowed by the size of the mesh). The intrinsic truncation error
of a given mesh and reciprocal interaction can be obtained by assuming _U_ <sup>�</sup> ( _k_ ) in (6.24) to
be a perfect low-pass filter:
_φ_ - <sup>2</sup> ( _km_ ) _−_ _φ_ - <sup>2</sup> ( _k_ )
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
��
_m_ _∈_ Z <sup>3</sup>
_H_ int <sup>2</sup> _,_ cut _−_ off
��
min <sup>=</sup> <sup><u>1</u></sup>
_L_ <sup>3</sup>
_._ (6.25)
By inserting this formula in (6.19), we get an estimate of the intrinsic RMS cut-off error
in _k_ -space, caused by the finite number of wave vectors in the reciprocal mesh. The RMS
error associated with (6.25) depends only on the size of the mesh and on the choice of the
reciprocal interaction, _i.e._ Ewald parameter _α_ if the standard form (2.3) is used.
VII. NUMERICAL CHECK OF ACCURACY
In this section, we test the analytical results (optimal influence function, energy
shift _E_ P3M <sup>cut</sup> <sup>,</sup> <sup>RMS</sup> <sup>error</sup> <sup>estimate)</sup> <sup>derived</sup> <sup>in</sup> <sup>the</sup> <sup>previous</sup> <sup>section.</sup> <sup>We</sup> <sup>do</sup> <sup>this</sup> <sup>by</sup> <sup>comparing</sup>
the P3M energies with the exact energies calculated in a specific random system. In the
following, all dimensions are given in terms of the arbitrary length unit _L_ and charge unit
_C_ . In particular, energies and energy errors are given in units of _L_ <sup>2</sup> _/C_ . We choose the
same test system as the one defined in Appendix D of Deserno and Holm <sup>3</sup> : 100 particles
randomly distributed within a cubic box of length _L_ = 10 _L_, half of them carry a positive,
the other half a negative unit charge. The statistical average _⟨· · ·⟩_ is calculated by aver
aging over at least 100 different configurations of this test system (these configurations are
determined by using the same random number generator as in Deserno and Holm <sup>3</sup> ). Well
converged Ewald sums (in metallic boundary conditions) were used to compute the exact
energies of the test systems. The first three systems have energies _−_ 15 _._ 43059, _−_ 15 _._ 26641
22
and _−_ 15 _._ 59147 respectively, values that are all quite close to the Madelung energies of the
ions _Q_ <sup>2</sup> _ζ/_ 2 _≃−_ 14 _._ 187.
The P3M energies of the test systems were computed with various mesh sizes ( _M_ =
4 _,_ 8 _,_ 16 _,_ 32), a real-space cut-off _r_ cut = 4 _._ 95, and different orders of the charge assignment
function (from 1 to 7). Our calculations show that using the energy-optimized influence
function (6.21), instead of the force-optimized influence function (6.23), leaves the energies
almost unchanged. (A slight improvement in accuracy appears only when the aliasing error
are at their maximum, namely for a charge assignment order of 1 and large values of _α_ .)
This behavior could have been expected, since both influence functions are almost equivalent
to the simple formula (6.22).
We compare in Fig. 1 the measured systematic error _⟨E_ P3M _−_ _E_ exact _⟩_ of the uncorrected
P3M energies [Eq. (6.6) without term _E_ P3M <sup>cut</sup> <sup>], for CAO’s ranging from 1 to 7, to the expected</sup>
bias _−E_ P3M <sup>cut</sup> <sup>.</sup> <sup>The</sup> <sup>agreement</sup> <sup>is</sup> <sup>perfect</sup> <sup>for</sup> <sup>all</sup> <sup>CAO’s</sup> <sup>and</sup> <sup>for</sup> <sup>all</sup> <sup>values</sup> <sup>of</sup> <sup>Ewald’s</sup> <sup>splitting</sup>
parameter _α_ . The energy shift _E_ P3M <sup>cut</sup> <sup>in</sup> <sup>Eq.</sup> <sup>(6.6)</sup> <sup>removes</sup> <sup>therefore</sup> <sup>entirely</sup> <sup>the</sup> <sup>systematic</sup>
error, as it should.
Fig. 1 illustrates that the systematic errors in the uncorrected energies, which are due
to cut-off and aliasing errors in the Madelung self-energies of the ions, have two different
contributions of opposite sign. At small values of _α_, the _r_ -space cut-off error dominates and
leads to an overestimation of the energy because the negative interaction energy of an ion
with the neutralizing background charge provided by the other particles is not fully taken
into account. The cut-off correction (3.11) derived in Sec. III does compensate very well for
this effect. At large values of _α_, _k_ -space cut-off and aliasing errors dominate, and lead to an
underestimation of the Madelung self-energies (expression (6.4) is indeed always negative).
Since the systematic error _⟨E_ P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
P3M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_E_</sup> exact <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
exact <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_⟩_</sup> <sup>in</sup> <sup>the</sup> <sup>reciprocal</sup> <sup>energies</sup> <sup>arise</sup> <sup>solely</sup> <sup>from</sup> <sup>self</sup>
terms (the Ewald interaction between a pair of particles is zero on average), this error can
alternatively, and more efficiently, be measured by computing the P3M energy of a system
made up of a single ion in the box, averaging that energy over different positions of the
particle relative to the mesh. To restore electro-neutrality, the interaction energy (2.13)
with the (implicit) neutralizing background must of course be taken into account before
comparing the result with the exact Madelung self-energy _q_ <sup>2</sup> _ζ/_ 2 of the ion. This method
allows one to measure very rapidly the reciprocal contribution to the average error in the
Madelung self-energies of the ions. We stress that the numerical results shown in Fig. 1 can
23
0
-5
-10
Measured
Predicted
<u>0</u> <u>0,25</u> <u>0,5</u> <u>0,75</u> <u>1</u> <u>1,25</u>
α
CAO 3
CAO 1 CAO 2
CAO 7
FIG. 1: Comparison between the measured systematic error of the uncorrected P3M energies
(crosses) and the theoretical prediction _−E_ P3M <sup>cut</sup> <sup>(solid</sup> <sup>lines)</sup> <sup>as</sup> <sup>a</sup> <sup>function</sup> <sup>of</sup> <sup>Ewald</sup> <sup>parameter</sup> <sup>_α_</sup> <sup>.</sup>
The average is performed over 1000 test systems consisting in 100 charges located at random in a
box of size _L_ = 10. The mesh has size _M_ = 8 and the real-space cut-off is _r_ cut = 4 _._ 95.
easily be transposed to any cubic system with an arbitrary number of ions since the energy
shift _E_ P3M <sup>cut</sup> <sup>scales</sup> <sup>merely</sup> <sup>as</sup> <sup>_Q_</sup> <sup>2</sup> <sup>_/L_</sup> <sup>.</sup>
Having validated the energy shift (6.5), we test now the accuracy of the RMS error
estimate (6.19). We show in Fig. 2 the theoretical predictions for the RMS error of the
corrected P3M energies for different mesh sizes (thick solid lines), at fixed CAO 2. The
dominant error at small values of _α_ comes from the truncation in the real-space calculation,
while _k_ -space cut-off and aliasing errors dominate at large values of _α_ . The plot shows
also separately the contribution ∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>,</sup> <sup>which</sup> <sup>accounts</sup> <sup>for</sup> <sup>fluctuating</sup> <sup>errors</sup> <sup>in</sup> <sup>the</sup> <sup>_k_</sup> <sup>-space</sup>
Madelung self-energies, and the contribution ∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
int <sup>which</sup> <sup>accounts</sup> <sup>for</sup> <sup>fluctuating</sup> <sup>errors</sup> <sup>in</sup>
the P3M pair interaction energies. Near the optimal value of _α_, the error ∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
int <sup>dominates</sup>
slightly ∆ _E_ <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
self <sup>by half an order of magnitude.</sup> <sup>This validates the use of the optimal influence</sup>
function (6.21), which was designed to minimize errors in the pair P3M interaction energies
only. Notice that ∆ _E_ self <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
<sup>(</sup> <sup>_k_</sup> <sup>)</sup>
self <sup>overcomes ∆</sup> <sup>_E_</sup> int <sup>(</sup> <sup>_k_</sup> <sup>)</sup>
int <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>at large values of</sup> <sup>_α_</sup> <sup>, in agreement with the scaling</sup>
with _α_ discussed in Sec. VI. The errors in Madelung self-energies must therefore by included
24
to predict correctly the full RMS error curve in our test system with 100 charged particles,
but they are expected to become negligible when the number of ions is increased above a
few hundred.
1
0.1
0.01
∆E(k)self
∆E(k)int
(k)
int
∆ERMS
∆E(k)self
0 0.2 0.4 0.6 0.8 1 1.2 1.4
α
FIG. 2: Theoretical predictions for the RMS error of the corrected P3M energies for CAO 2
and three different mesh sizes [thick solid lines], for the same system and real-space cut-off as in
Fig. 1. The two contributions which make up the total _k_ -space error are also shown independently:
RMS error in the pair P3M interaction energies (Eq. (6.16), thin solid line) and RMS error in the
Madelung self-energies (Eq. (6.13), dashed line).
The predicted RMS errors agree very well with the measured RMS errors, as shown in
Fig. 3. The small deviations at low values of _α_ are due to a loss of accuracy of Kolafa
and Perram’s _r_ -space error estimate (2.14), and to the fact that this error estimate does
not take into account the improvement in accuracy brought by the new cut-off correction
term (3.11). In the regime where the dominant error comes from the _k_ -space calculation,
the agreement with our RMS error estimate is excellent, especially at high values of the
charge assignment order. The errors in the _k_ -space calculation are caused by truncation
and aliasing effects. The aliasing errors can be reduced by increasing the charge assignment
order, but the accuracy cannot go below the minimum _k_ -space cut-off error (6.25) (dashed
curve in Fig. 3), which is intrinsic to the mesh size and choice of reciprocal interaction.
25
100
10-1
10-2
10-3
<u>0</u> <u>0,2</u> <u>0,4</u> <u>0,6</u> <u>0,8</u> <u>1</u> <u>1,2</u>
α
CAO 1
CAO 2
CAO 3
CAO 4
CAO 5
CAO 6
CAO 7
Measured RMS error
Predicted RMS error
Minimum cutoff error
FIG. 3: Comparison between the measured (crosses) and predicted (solid lines) RMS errors of the
(corrected) P3M energies, for the same test system, mesh size and real-space cut-off as in Fig. 1.
The minimal error due to direct and reciprocal space cut-offs is shown as a dashed line.
The pronounced minimum in the RMS error curves stresses the importance of using the
optimal value of _α_ when performing simulations with the P3M algorithm (or with the other
variants of mesh based Ewald sums). Our accurate RMS error estimate for the P3M energies
can be used to quickly find the optimal set of parameters (mesh size, charge assignment
order, Ewald splitting parameter) that lead to the desired accuracy with a minimum of
computational effort <sup>5</sup> . Whatever the chosen parameters, it can serve also as a valuable
indicator of the accuracy of the P3M energies.
VIII. CONCLUSIONS
In this article, we discussed in detail which ingredients are necessary to utilize the P3M
algorithm to compute accurate Coulomb energies of point charge distributions. The usage
of a nearly linear scaling method ( _≈_ _N_ log _N_ ) like P3M is almost compulsory for systems
containing more than a few thousand charges.
In particular, we derived the cut-off corrections for the standard Ewald sum transparently
and interpreted the systematic errors in terms of Madelung energies. This route lead us to
26
an additional real-space cut-off correction term that has so far not been discussed in the
literature. Building on these results, we have deduced the _k_ -space cut-off correction term in
the case of the P3M algorithm, where additional aliasing errors play a role. Furthermore we
derived the exact form of the influence function that minimizes the RMS errors in the ener
gies, and showed that this function is not much different from the force-optimized influence
function, which _a_ _posteriori_ justifies why in most P3M implementations the usage of the
force-optimized influence function does not lead to inaccurate results. Based on the energy
optimized influence function we derive an accurate RMS error estimate for the energy, and
performed numerical tests on sample configurations that demonstrate the validity of our
error estimates and the necessity to include our correction terms. We also demonstrated
that the electrostatic energy of an individual particle in the system can be obtained in the
P3M method, but at the expense of an additional inverse fast Fourier transform.
With the help of the newly derived error estimates we can easily tune the desired accu
racy of the P3M algorithm and find suitable parameter combinations before running any
simulation.
The P3M algorithm can be generalized along our discussed lines to compute other long
range interactions. Of particular interest are dipolar energies, forces and torques, and the
associated error estimates for these quantities. This will be the content of a forthcoming
publication. Our P3M generalization for the energies will be included in a future version of
the molecular simulation package Espresso <sup>21</sup>, that is freely available under the GNU general
public license. The website `[http://www.espresso.mpg.de](http://www.espresso.mpg.de)` provides up-to-date information.
Acknowledgements
Funds for this research were provided by the Volkswagen Stiftung under grant I/80433
and by the DFG within grant Ho-1108/13-1.
APPENDIX A: EWALD PAIR POTENTIAL AND MADELUNG SELF-ENERGY
The Ewald formula for the electrostatic energy _E_ of a periodic charged system can be
written in a form that underlines the fact that _E_ includes the Madelung self-energies _Q_ <sup>2</sup> _ζ/_ 2
of the ions [ _Q_ <sup>2</sup> = <sup>�</sup>
_i_ <sup>_q_</sup> _i_ <sup>2</sup>
_i_ <sup>2</sup> <sup>and</sup> <sup>_ζ_</sup> <sup>is</sup> <sup>defined</sup> <sup>in</sup> <sup>(3.7)].</sup> <sup>We</sup> <sup>recall</sup> <sup>from</sup> <sup>Sec.</sup> <sup>II</sup> <sup>that</sup> <sup>the</sup> <sup>Ewald</sup>
27
formula for _E_ reads, if the system is globally neutral and if we employ metallic boundary
conditions,
_E_ = <sup><u>1</u></sup>
2
_i,j_
- <sup>_′_</sup>
_n_ _∈_ Z <sup>3</sup>
<u>1</u> _qiqjψ_ ( _r_ _ij_ + _n_ _L_ ) +
2 _L_ <sup>3</sup>
_i,j_
_e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_i−_</sup> <sup>_r_</sup> <sup>_j_</sup> <sup>)</sup> _φ_ <sup>�</sup> ( _k_ ) _−_ _Q_ <sup>2</sup> <sup>_<u>α</u>_</sup> (A1)
_~~√~~_ _<u>π</u>_ _._
_qiqj_
_k_ _∈_ K
_k_ _̸_ =0
The “self-energy terms” in _E_, _i.e._ term _E_ <sup>(</sup> <sup>_s_</sup> <sup>)</sup> and terms _i_ = _j_, are
_<u>Q</u>_ <sup>2</sup>
2
��
_n_ =0 _̸_
- _<u>π</u>_
_ζ_ +
_α_ <sup>2</sup> _L_ <sup>3</sup>
_k_ _̸_ =0
= <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
_ψ_ ( _n_ _L_ ) + <sup><u>1</u></sup>
_L_ <sup>3</sup>
_φ_ �( _k_ ) _−_ <sup><u>2</u></sup> <sup>_<u>α</u>_</sup>
_~~√~~_ _<u>π</u>_
_._ (A2)
We can write therefore
- _<u>π</u>_
_ζ_ +
_α_ <sup>2</sup> _L_ <sup>3</sup>
_E_ = <sup><u>1</u></sup>
2
= <sup><u>1</u></sup>
2
_i_ = _̸_ _j_
_i_ = _̸_ _j_
_qiqjV_ Ewald( _r_ _ij_ ) + <sup>_<u>Q</u>_</sup> <sup>2</sup> (A3)
2 <sup>_ζ_</sup>
_k_ _̸_ =0
_ψ_ ( _r_ _ij_ + _n_ _L_ ) + <sup><u>1</u></sup>
_L_ <sup>3</sup>
+ <sup>_<u>Q</u>_</sup> <sup>2</sup>
2
_qiqj_
��
_n_ =0 _̸_
_e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>_ij_</sup> <sup>�</sup> _φ_ ( _k_ )
where we defined the Ewald pair interaction <sup>6</sup>
_k_ _̸_ =0
_<u>π</u>_
_e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>�</sup> _φ_ ( _k_ ) _−_ _α_ <sup>2</sup> _L_ <sup>3</sup> <sup>_._</sup> (A4)
_V_ Ewald( _r_ ) =
_n_ =0 _̸_
_ψ_ ( _r_ + _n_ _L_ ) + <sup><u>1</u></sup>
_L_ <sup>3</sup>
_ψ_ ( _r_ + _n_ _L_ ) + <sup><u>1</u></sup>
Notice that in writing (A3), we used <sup>�</sup> _i_
_j̸_ = _i_ <sup>_qiqj π/_</sup> <sup>(</sup> <sup>_α_</sup> <sup>2</sup> <sup>_L_</sup> <sup>3) =</sup> <sup>_−Q_</sup> <sup>2</sup> <sup>_π/_</sup> <sup>(</sup> <sup>_α_</sup> <sup>2</sup> <sup>_L_</sup> <sup>3)</sup> <sup>which</sup> <sup>follows</sup>
from electro-neutrality. Thanks to the inclusion of this constant in the definition of _V_ Ewald( _r_ ),
the Ewald pair potential does not depend on the parameter _α_ [ _∂/∂α V_ Ewald( _r_ ) = 0] and its
average over the simulation box is zero <sup>22</sup> :
_⟨V_ Ewald( _r_ ) _⟩_ = <sup><u>1</u></sup>
_L_ <sup>3</sup>
_L_ <sup>3 d3</sup> <sup>_r_</sup> <sup>_V_</sup> <sup>Ewald(</sup> <sup>_r_</sup> <sup>) = 0</sup> <sup>_._</sup> (A5)
The latter property is simply a consequence of _⟨_ exp( _i_ _k_ _·_ _r_ _ij_ ) _⟩_ = _δ_ _k_ _,_ 0 and Eq. (3.5).
In conclusion, expression (A3) shows explicitly that the electrostatic energy of a periodic
charged system includes the Madelung self-energies _Q_ <sup>2</sup> _ζ/_ 2 of the ions <sup>17,18</sup> . The fact that the
Ewald interaction between a pair of particles averages to zero when one particle explores
the whole simulation box is also noteworthy aspect of Ewald potential <sup>22</sup> .
APPENDIX B: PROOF OF EQ. (5.2)
Eq. (5.2) is a consequence of the Sampling theorem [refs] and is straightforward to demon
strate. The sum in (4.3) is rewritten as an integral
_ρ_ �M( _k_ ) = _h_ <sup>3</sup> d _r_ <sup>_′_</sup>
_V_
d _r_ W( _r_ ) _U_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _ρ_ ( _r_ <sup>_′_</sup> ) _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> (B1)
28
where we used (4.1) and introduced an infinite mesh of Dirac delta functions
_m_ _∈_ Z <sup>3</sup>
W( _r_ ) =
_δ_ ( _r_ _−_ _r_ _m_ ) = <sup><u>1</u></sup>
_h_ <sup>3</sup>
_r_ _m∈_ Mp
_e_ <sup>_−ikg_</sup> <sup>_m_</sup> <sup>_·_</sup> <sup>_r_</sup> _._ (B2)
(We recall that _kg_ = 2 _π/h_ ). Using the above representation of W( _r_ ) and introducing in (B1)
the Fourier series representation of the periodic charge density,
_ρ_ ( _r_ <sup>_′_</sup> ) = <sup><u>1</u></sup>
_L_ <sup>3</sup>
(B3)
_ρ_ �( _k_ <sup>_′_</sup> ) exp( _i_ _k_ <sup>_′_</sup> _·_ _r_ <sup>_′_</sup> ) _,_
_k_ <sup>_′_</sup> _∈_ K
we recover the result (5.2) after straightforward simplifications.
APPENDIX C: PROOF OF EQUIVALENCE BETWEEN EQS. (4.9) AND (4.6)
Eq. (4.9) is equivalent to
<sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M <sup>=</sup> <sup><u>1</u></sup>
2 _V_
_E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M
2 _V_
_k_ _∈_ K
_k_ _̸_ =0
_ρ_ - <sup>_∗_</sup> ( _k_ )Φ( <sup>�</sup> _k_ ) _,_ (C1)
where Φ( <sup>�</sup> _k_ ) is the _full_ Fourier transform ( _k_ _∈_ K) of the back-interpolated potential
mesh (4.8):
Φ(� _k_ ) =
_V_
d _r_ <sup>_′_</sup> W( _r_ <sup>_′_</sup> ) _U_ ( _r_ _−_ _r_ <sup>_′_</sup> )ΦM( _r_ <sup>_′_</sup> ) _._ (C2)
Φ( _r_ )d _r_ = _h_ <sup>3</sup>
_V_
d _r_ _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup>
We replace in this equation ΦM( _r_ <sup>_′_</sup> ) and W( _r_ <sup>_′_</sup> ) by their expressions (4.7) and (B2), and
perform the integration over _r_ <sup>_′_</sup> :
Φ(� _k_ ) = <sup><u>1</u></sup>
_L_ <sup>3</sup>
_k_ <sup>_′_</sup> _∈_ M <sup>e</sup>
Φ�M( _k_ <sup>_′_</sup> )
_m_
_V_
d _r_ _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup> _U_ <sup>�</sup> ( _k_ <sup>_′_</sup> + _kg_ _m_ ) _e_ <sup>_i_</sup> <sup>(</sup> <sup>_k_</sup> <sup>_′_</sup> <sup>+</sup> <sup>_kg_</sup> <sup>_m_</sup> <sup>)</sup> <sup>_·_</sup> <sup>_r_</sup> _._ (C3)
The integration over _r_ introduces a Kronecker symbol _δ_ _k_ _,_ _k_ <sup>_′_</sup> + _kg_ _m_ . We get therefore the simple
result
Φ(� _k_ ) = Φ�M( _k_ ) _U_ �( _k_ ) (C4)
where the function Φ <sup>�</sup> M( _k_ ), which is defined originally only for _k_ _∈_ M <sup>�</sup>, is now understood
to be extended periodically to all K space. Notice that the inverse FFT does not introduce
aliasing errors: the sum over _m_ merely renders Φ <sup>�</sup> M( _k_ ) periodic. In accordance with (4.3)
29
and (4.5), we extend also _ρ_ �M( _k_ ) and _G_ <sup>�</sup> ( _k_ ) periodically, with period 2 _π/h_ . Using the above
result and (4.5), the reciprocal energy (C1) can be expressed as
<sup>(</sup> <sup>_ks_</sup> <sup>)</sup> <u>1</u>
P3M <sup>=</sup>
2 _L_ <sup>3</sup>
_E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M
_ρ_ - <sup>_∗_</sup> ( _k_ ) _U_ <sup>�</sup> ( _k_ ) _ρ_ �M( _k_ ) _G_ <sup>�</sup> ( _k_ ) (C5)
_k_ _∈_ K
<u>1</u> =
2 _L_ <sup>3</sup>
_k_ _∈_ M <sup>e</sup>
_m_ _∈_ Z <sup>3</sup>
_ρ_ - <sup>_∗_</sup> ( _k_ + _kg_ _m_ ) _U_ <sup>�</sup> ( _k_ + _kg_ _m_ ) _ρ_ �M( _k_ ) _G_ <sup>�</sup> ( _k_ ) _._ (C6)
This may be compared with Eq. (4.6), _i.e._
<sup>(</sup> <sup>_ks_</sup> <sup>)</sup> <u>1</u>
P3M <sup>=</sup>
2 _L_ <sup>3</sup>
_E_ <sup>(</sup> <sup>_ks_</sup> <sup>)</sup>
P3M
_ρ_ - <sup>_∗_</sup> M <sup>(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_ρ_</sup> <sup>�M(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_G_</sup> <sup>�(</sup> <sup>_k_</sup> <sup>)</sup> <sup>_._</sup> (C7)
_k_ _∈_ M <sup>e</sup>
_k_ _̸_ =0
Recalling (5.2) and the fact that _U_ <sup>�</sup> ( _k_ ) is real, we see that both expressions are equivalent.
1 A. Arnold and C. Holm,in _Advanced_ _Computer_ _Simulation_ _Approaches_ _for_ _Soft_ _Matter_ _Sciences_
_II_, eds. C. Holm and K. Kremer (Springer, Berlin, 2005)
2 R.W. Hockney and J.W. Eastwood, _Computer_ _Simulation_ _Using_ _Particles_ (IOP, Bristol, 1988)
3 M. Deserno and C. Holm, J. Chem. Phys. 109 (1998): 7678
4 U. Essmann, L. Perera et al., J. Chem. Phys. 103 (1995): 8577
5 M. Deserno and C. Holm, J. Chem. Phys. 109 (1998): 7694
6 S.W. de Leeuw, J.W. Perram and E.R. Smith, Proc. R. Soc. London, Ser. A 373 (1980):57
7 J.-M. Caillol, J. Chem. Phys. 101 (1994): 6080
8 E.R. Smith, Mol. Phys. 65 (1988): 1089
9 V. Ballenegger and J.-P. Hansen, J. Chem. Phys. 122 (2005): Art. 114711
10 J. Kirkwood, J. Chem. Phys. 7 (1939): 911
11 A. Alastuey and V. Ballenegger, Physica A 279 (2000): 268
12 V. Ballenegger and J.-P. Hansen, Mol. Phys. 102 (2004): 599
13 P. Ewald, Ann. Phys. (Leipzig) 64 (1921): 253
14 G. Hummer, L.R. Pratt and A.E. Garc´ıa, J. Phys. Chem. 99 (1995):14188
15 M.P. Allen and D.J. Tildesley, _Computer_ _Simulation_ _of_ _Liquids_ Oxford Science Publications.
(Clarendon Press, Oxford, 1987)
16 J. Kolafa and J.W. Perram, Mol. Sim. 9 (1992): 351
30
17 S.G. Brush, H.L. Sahlin and E. Teller, J. Chem. Phys. 45 (1966): 2102
18 B.R. Nijboer and T.W. Ruijgrok, J. Stat. Phys. 53 (1988): 361
19 T. Darden, D. Pearlman and L.G. Pedersen, J. Chem. Phys. 109 (1998): 10921
20 Z. Wang and C. Holm, J. Chem. Phys. 115 (2001): 6351
21 H.J. Limbach, A. Arnold, B.A. Mann, and C. Holm, Comp. Phys. Comm. 174, (2006): 704
22 G. Hummer, L.R. Pratt and A.E. Garc´ıa, J. Phys. Chem. A 102 (1998):7885
31
섹션 본문
섹션 본문이 없습니다.
참고문헌
참고문헌 정보가 없습니다.