NFFT based Ewald summation
for electrostatic systems with charges and dipoles
NFFT based Ewald summation
for electrostatic systems with charges and dipoles
Franziska Nestler Technische Universität Chemnitz
Faculty of Mathematics joint work with M. Pippig and M. Hofmann
Stuttgart, 11/2015
NFFT based Ewald summation
for electrostatic systems with charges and dipoles
1 Introduction NFFT
Fast summation The Coulomb problem
2 Fast Ewald summation for charged particle systems The 3d-periodic case
Mixed periodic boundary conditions
3 Extension to systems containing charges and dipoles
Introduction NFFT
The 1d-NFFT (FFT for nonequispaced data)
Notation
• define the torusT:=R/Z'[−1/2,1/2)
• forM∈2NsetIM :={−M/2, . . . ,M/2−1}
NFFT: f(xj) := X
k∈IM
fˆke−2πikxj xj∈T, j= 1, . . . , N
(inverse) FFT: f(j) := X
k∈IM
fˆke−2πikj/M j∈ IM
, N:=M
adjoint NFFT: h(k) :=
N
X
j=1
fje2πikxj k∈ IM
Complexity:O(MlogM+N)
[Dutt, Rokhlin 1993] [Beylkin 1995] [Potts, Steidl, Tasche 2001] [Greengard, Lee 2004]
Introduction NFFT
The 1d-NFFT (FFT for nonequispaced data)
Notation
• define the torusT:=R/Z'[−1/2,1/2)
• forM∈2NsetIM :={−M/2, . . . ,M/2−1}
NFFT: f(xj) := X
k∈IM
fˆke−2πikxj xj∈T, j= 1, . . . , N (inverse) FFT: f(j) := X
k∈IM
fˆke−2πikj/M j∈ IM, N:=M
adjoint NFFT: h(k) :=
N
X
j=1
fje2πikxj k∈ IM
Complexity:O(MlogM+N)
[Dutt, Rokhlin 1993] [Beylkin 1995]
[Potts, Steidl, Tasche 2001] [Greengard, Lee 2004]
Introduction NFFT
The 1d-NFFT (FFT for nonequispaced data)
Notation
• define the torusT:=R/Z'[−1/2,1/2)
• forM∈2NsetIM :={−M/2, . . . ,M/2−1}
NFFT: f(xj) := X
k∈IM
fˆke−2πikxj xj∈T, j= 1, . . . , N (inverse) FFT: f(j) := X
k∈IM
fˆke−2πikj/M j∈ IM, N:=M
adjoint NFFT: h(k) :=
N
X
j=1
fje2πikxj k∈ IM
Complexity:O(MlogM+N)
[Dutt, Rokhlin 1993] [Beylkin 1995]
[Potts, Steidl, Tasche 2001] [Greengard, Lee 2004]
Introduction NFFT
NFFT window function
Goal: Evaluation of the trigonometric polynomial
f(x) :=
M/2−1
X
k=−M/2
fˆke−2πikx
inxj∈T,j= 1, . . . , N.
Idea: Approximatefby
f(x)≈
σM/2−1
X
l=−σM/2
glϕ(x˜ −l/σM)
| {z }
discrete convolution
,
where
• ϕ˜is a1-periodic function with small support[−m/σM,−m/σM]⊂T(mσM),
• σ≥1is called oversampling factor,
• glare up to now unknown.
Introduction NFFT
−12 0 12
1 σM
−σMm,σMm ϕ(x)
˜ ϕ(x)
−12 0 12
1
σM f(x)≈
σMP/2−1
`=−σM/2
g`ϕ(x˜ −`/σM)
ind >1dimensions:tensor product approachϕ(x)7→ϕ(x1)·. . .·ϕ(xd).
Introduction NFFT
NFFT workflow
1 Deconvolution in Fourier space:O(M)
ˆ gk:=
( fˆ
k
ck( ˜ϕ) :k∈ {−M/2, . . . ,M/2−1},
0 :else.
2 Inverse FFT:O(σMlog(σM))
gl:= 1 σM
σM/2−1
X
k=−σM/2
ˆ
gke−2πikl/(σM), l=−σM/2, . . . ,σM/2−1.
3 Convolution in spatial domain:O((2m+ 1)N)
f(xj)≈
σM/2−1
X
l=−σM/2
glϕ(x˜ j−l/σM), j= 1, . . . , N.
Introduction NFFT
NFFT workflow
1 Deconvolution in Fourier space:O(M)
ˆ gk:=
( fˆ
k
ck( ˜ϕ) :k∈ {−M/2, . . . ,M/2−1},
0 :else.
2 Inverse FFT:O(σMlog(σM))
gl:= 1 σM
σM/2−1
X
k=−σM/2
ˆ
gke−2πikl/(σM), l=−σM/2, . . . ,σM/2−1.
3 Convolution in spatial domain:O((2m+ 1)N)
f(xj)≈
σM/2−1
X
l=−σM/2
glϕ(x˜ j−l/σM), j= 1, . . . , N.
Introduction NFFT
NFFT workflow
1 Deconvolution in Fourier space:O(M)
ˆ gk:=
( fˆ
k
ck( ˜ϕ) :k∈ {−M/2, . . . ,M/2−1},
0 :else.
2 Inverse FFT:O(σMlog(σM))
gl:= 1 σM
σM/2−1
X
k=−σM/2
ˆ
gke−2πikl/(σM), l=−σM/2, . . . ,σM/2−1.
3 Convolution in spatial domain:O((2m+ 1)N)
f(xj)≈
σM/2−1
X
l=−σM/2
glϕ(x˜ j−l/σM), j= 1, . . . , N.
Introduction NFFT
Deconvolution:
ˆ
gk:= ˆdk·fˆk. Standard approach:
dˆk:=
1
ck( ˜ϕ) :k=−M/2, . . . ,M/2−1,
0 :else.
Least square optimized NFFT:
dˆk:=
ck( ˜ϕ) P
r∈Z
c2k+rσM( ˜ϕ) :k=−M/2, . . . ,M/2−1,
0 :else.
Introduction NFFT
Matrix-vector form
1 Deconvolution in Fourier space:gˆk:= ˆdkfˆk
ˆ
g:=D·f,ˆ D∈RσM×M : diag. matrix with entriesdˆk 2 Inverse FFT:gˆ7→g
g=F ·ˆg, F ∈CσM×σM :Fourier matrix
3 Convolution in spatial domain:f(xj)≈PσM/2−1
l=−σM/2glϕ(x˜ j−l/σM) f˜=B·g, B∈RN×σM, bjl= ˜ϕ(xj−l/σM)
Introduction NFFT
Adjoint NFFT
NFFT: Compute for allj= 1, . . . , N fj:=
M/2−1
X
k=−M/2
fˆke−2πikxj ⇐⇒ f:=A·fˆ,
whereA= e−2πikxj
j,k∈RN×M. Approximation:f≈BF D·fˆ.
adjoint NFFT: Compute for allk=−M/2, . . . ,M/2−1 hk:=
N
X
j=1
fje2πikxj ⇐⇒ h=A∗·f,
whereA∗= e2πikxj
k,j∈RM×N. Approximation:h≈DF∗BT·f.
Introduction NFFT
Adjoint NFFT
NFFT: Compute for allj= 1, . . . , N fj:=
M/2−1
X
k=−M/2
fˆke−2πikxj ⇐⇒ f:=A·fˆ,
whereA= e−2πikxj
j,k∈RN×M. Approximation:f≈BF D·fˆ.
adjoint NFFT: Compute for allk=−M/2, . . . ,M/2−1 hk:=
N
X
j=1
fje2πikxj ⇐⇒ h=A∗·f,
whereA∗= e2πikxj
k,j∈RM×N. Approximation:h≈DF∗BT·f.
Introduction Fast summation
Fast summation based on NFFT in 1d
[Potts, Steidl 2003]Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
0
−L L
K(x)
1
• Extend the interval at both ends.
• Construct asmooth transition(match derivatives up to some orderp∈N).
→Two-point-Taylor interpolation
• Theregularized kernel functionis smooth and periodic.
Introduction Fast summation
Fast summation based on NFFT in 1d
[Potts, Steidl 2003]Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
0
−L L
−(L+δ) L+δ
∂j
∂xjKB(L) =∂x∂jjK(L)
K(x)
KB(x) KB(x)
1
• Extend the interval at both ends.
• Construct asmooth transition(match derivatives up to some orderp∈N).
→Two-point-Taylor interpolation
• Theregularized kernel functionis smooth and periodic.
Introduction Fast summation
Fast summation based on NFFT in 1d
[Potts, Steidl 2003]Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
0
−L L
−(L+δ) L+δ
K(x)
KR(x)
KB(x) KB(x)
1
• Extend the interval at both ends.
• Construct asmooth transition(match derivatives up to some orderp∈N).
→Two-point-Taylor interpolation
• Theregularized kernel functionis smooth and periodic.
Introduction Fast summation
Fast summation based on NFFT in 1d
[Potts, Steidl 2003]Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
K(x) =KR(x) ∀x∈[−L, L]
f(xj) =
N
X
i=1
ciKR(xij)
0
−L L
−(L+δ) L+δ
K(x)
KR(x)
KB(x) KB(x)
1
Far field computations (use FFT and NFFT): KRis periodic with period2(L+δ) =:h.
f(xj) =
N
X
i=1
ciKR(xij)≈
N
X
i=1
ci
X
`∈IM
ˆb`e2πi`xij/h
= X
`∈IM
ˆb` N
X
i=1
cie2πi`xi/h
!
| {z }
adj. NFFT
e−2πi`xj/h
| {z }
NFFT
*Use the FFT to approximate the FKˆb`.
Introduction Fast summation
Fast summation based on NFFT in 1d
[Potts, Steidl 2003]Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
K(x) =KR(x) ∀x∈[−L, L]
f(xj) =
N
X
i=1
ciKR(xij)
0
−L L
−(L+δ) L+δ
K(x)
KR(x)
KB(x) KB(x)
1
Far field computations (use FFT and NFFT):
KRis periodic with period2(L+δ) =:h.
f(xj) =
N
X
i=1
ciKR(xij)≈
N
X
i=1
ci
X
`∈IM
ˆb`e2πi`xij/h
= X
`∈IM
ˆb` N
X
i=1
cie2πi`xi/h
!
| {z }
adj. NFFT
e−2πi`xj/h
| {z }
NFFT
*Use the FFT to approximate the FKˆb`.
Introduction Fast summation
Fast summation based on NFFT in 1d
[Potts, Steidl 2003]Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
K(x) =KR(x) ∀x∈[−L, L]
f(xj) =
N
X
i=1
ciKR(xij)
0
−L L
−(L+δ) L+δ
K(x)
KR(x)
KB(x) KB(x)
1
Far field computations (use FFT and NFFT):
KRis periodic with period2(L+δ) =:h.
f(xj) =
N
X
i=1
ciKR(xij)≈
N
X
i=1
ci
X
`∈IM
ˆb`e2πi`xij/h= X
`∈IM
ˆb` N
X
i=1
cie2πi`xi/h
!
| {z }
adj. NFFT
e−2πi`xj/h
| {z }
NFFT
*Use the FFT to approximate the FKˆb`.
Introduction Fast summation
Fast decaying kernels
Computef(xj) :=
N
X
i=1
ciK(xi−xj)forxj∈[−L/2,L/2], j= 1, . . . , N.
Assume that
• K(·)is sufficiently small outside of[−h/2,h/2]⊇[−L, L].
• we know the analytical Fourier transformK(·).ˆ
Use analytical Fourier coefficients (Poisson summation, no FFT-precomputation).
−h/2 h/2
K(x)≈ X∞ n=−∞
K(x+nh) =1 h
X∞
`=−∞
K(ˆ`/h)e2πi`x/h K(x)
h-periodization
N 1
X
i=1
ciK(xij)≈ 1 h
X
`∈IM
K(ˆ `/h)
N
X
i=1
cie2πi`xi/h
!
e−2πi`xj/h
Introduction Fast summation
For d ≥ 2 dimensions, radial kernels
Computef(xj) :=
N
X
i=1
ciK(kxi−xjk)forj= 1, . . . , N. Assumekxi−xjk ≤L.
dj
drjKB(L+δ) = 0 dj
drjKB(L) =drdjjK(L)
L
−L L+δ
−(L+δ)
K(x)
1
• 1d regularization on[−h/2,h/2],h/2:=L+δ
• claim vanishing derivatives at the boundary
• rotate and extend the function to the torushT2 (constant value over the striped area)
• result: periodically smooth function in 2 variables
• approximate by bivariate trigonometric polynomials (2d FFT)
Franziska Nestler TU Chemnitz, Faculty of Mathematics
Introduction The Coulomb problem
Coulomb interactions
LetNchargesqj∈Rat positionsxj∈[−L/2,L/2]3be given.
Coulomb interaction energy s.t. periodic boundary conditions:
U :=1 2
N
X
j=1
qjφ(j) with φ(j) :=X
n∈S N
X
i=1 0 qi
kxij+Lnk, whereS ⊂Z3.
• 0d-periodic:S:={0}3
• 3d-periodic:S:=Z3
• 2d-periodic:S:=Z2× {0}
• 1d-periodic:S:=Z× {0}2
Introduction The Coulomb problem
Coulomb interactions
LetNchargesqj∈Rat positionsxj∈[−L/2,L/2]3be given.
Coulomb interaction energy s.t. periodic boundary conditions:
U :=1 2
N
X
j=1
qjφ(j) with φ(j) :=X
n∈S N
X
i=1 0 qi
kxij+Lnk, whereS ⊂Z3.
• 0d-periodic:S:={0}3
• 3d-periodic:S:=Z3
• 2d-periodic:S:=Z2× {0}
• 1d-periodic:S:=Z× {0}2
Franziska Nestler 1 TU Chemnitz, Faculty of Mathematics
Introduction The Coulomb problem
Coulomb interactions
LetNchargesqj∈Rat positionsxj∈[−L/2,L/2]3be given.
Coulomb interaction energy s.t. periodic boundary conditions:
U :=1 2
N
X
j=1
qjφ(j) with φ(j) :=X
n∈S N
X
i=1 0 qi
kxij+Lnk, whereS ⊂Z3.
• 0d-periodic:S:={0}3
• 3d-periodic:S:=Z3
• 2d-periodic:S:=Z2× {0}
• 1d-periodic:S:=Z× {0}2
L L
L
Franziska Nestler 1 TU Chemnitz, Faculty of Mathematics
Introduction The Coulomb problem
Coulomb interactions
LetNchargesqj∈Rat positionsxj∈[−L/2,L/2]3be given.
Coulomb interaction energy s.t. periodic boundary conditions:
U :=1 2
N
X
j=1
qjφ(j) with φ(j) :=X
n∈S N
X
i=1 0 qi
kxij+Lnk, whereS ⊂Z3.
• 0d-periodic:S:={0}3
• 3d-periodic:S:=Z3
• 2d-periodic:S:=Z2× {0}
• 1d-periodic:S:=Z× {0}2
L
L
1
Introduction The Coulomb problem
Coulomb interactions
LetNchargesqj∈Rat positionsxj∈[−L/2,L/2]3be given.
Coulomb interaction energy s.t. periodic boundary conditions:
U :=1 2
N
X
j=1
qjφ(j) with φ(j) :=X
n∈S N
X
i=1 0 qi
kxij+Lnk, whereS ⊂Z3.
• 0d-periodic:S:={0}3
• 3d-periodic:S:=Z3
• 2d-periodic:S:=Z2× {0}
• 1d-periodic:S:=Z× {0}2 L
1
Fast Ewald summation for charged particle systems
Ewald summation
Apply the well known Ewald splitting 1
r = erfc(αr)
r +erf(αr) r withr:=kxij+Lnkand obtain
φ(j) =X
n∈S N
X
i=1 0 qi
kxij+Lnk
=X
n∈S N
X
i=1
0qierfc(αkxij+Lnk) kxij+Lnk +
φL(j) :=X
n∈S N
X
i=1
qi
erf(αkxij+Lnk) kxij+Lnk − 2α
√πqj
• short range partcan be obtained via direct evaluation after truncation
• lim
r→0 erf(αr)
r = √2απ⇒substractself potential
• write thelong range partas a sum in Fourier space
Fast Ewald summation for charged particle systems
Ewald summation
Apply the well known Ewald splitting 1
r = erfc(αr)
r +erf(αr) r withr:=kxij+Lnkand obtain
φ(j) =X
n∈S N
X
i=1 0 qi
kxij+Lnk =X
n∈S N
X
i=1
0qierfc(αkxij+Lnk) kxij+Lnk +
φL(j) :=X
n∈S N
X
i=1
qi
erf(αkxij+Lnk) kxij+Lnk − 2α
√πqj
• short range partcan be obtained via direct evaluation after truncation
• lim
r→0 erf(αr)
r = √2απ⇒substractself potential
• write thelong range partas a sum in Fourier space
Fast Ewald summation for charged particle systems
Ewald summation
Apply the well known Ewald splitting 1
r = erfc(αr)
r +erf(αr) r withr:=kxij+Lnkand obtain
φ(j) =X
n∈S N
X
i=1 0 qi
kxij+Lnk =X
n∈S N
X
i=1
0qierfc(αkxij+Lnk) kxij+Lnk +
φL(j) :=
X
n∈S N
X
i=1
qi
erf(αkxij+Lnk) kxij+Lnk − 2α
√πqj
• short range partcan be obtained via direct evaluation after truncation
• lim
r→0 erf(αr)
r = √2απ⇒substractself potential
• write thelong range partas a sum in Fourier space
Fast Ewald summation for charged particle systems
Ewald summation
Apply the well known Ewald splitting 1
r = erfc(αr)
r +erf(αr) r withr:=kxij+Lnkand obtain
φ(j) =X
n∈S N
X
i=1 0 qi
kxij+Lnk =X
n∈S N
X
i=1
0qierfc(αkxij+Lnk) kxij+Lnk +
φL(j) :=X
n∈S N
X
i=1
qi
erf(αkxij+Lnk) kxij+Lnk
− 2α
√πqj
• short range partcan be obtained via direct evaluation after truncation
• lim
r→0 erf(αr)
r = √2απ⇒substractself potential
• write thelong range partas a sum in Fourier space
Fast Ewald summation for charged particle systems The 3d-periodic case
3d-periodic Ewald summation
Applying the splitting we obtain
φ(j) =φshort(j) +φF(j) +φself(j) +φcorrect(j), where
φshort(j) = X
n∈Z3 N
X
i=1
0qierfc(αkxij+Lnk) kxij+Lnk
φF(j) = 1 πL
X
k∈Z3\{0}
e−π2kkk2/(α2L2) kkk2
N
X
i=1
qie2πikTxi/L
!
e−2πikTxj/L
φself(j) =−2α
√πqj
and the correction termφcorrect(j)represents the applied order of summation or rather the surrounding medium.
Fast Ewald summation for charged particle systems The 3d-periodic case
Order of summation
The correction term reads as
φcorrect(j) = 4π V(1 + 2)
N
X
i=1
qixi
!T
xj− 2π V(1 + 2)
N
X
i=1
qikxik2,
wheredenotes the dielectric constant of the surrounding medium.
Corresponding summation orders:
vacuum b.c.,= 1 X
i,j
X
n∈Z3
0:= lim
R→∞
N
X
i,j=1
X
kLnk≤R 0
spherical shells, whole boxes
metallic b.c.,=∞ 1
(ScaFaCoS)
X
i,j
X
n∈Z3
0:= lim
R→∞
N
X
i,j=1
X
kxij+Lnk≤R 0
increasing sharp cutoff
Franziska Nestler TU Chemnitz, Faculty of Mathematics
Fast Ewald summation for charged particle systems The 3d-periodic case
NFFT based computation of the long range part
Define the Fourier coefficients ψ(k) :=ˆ
( 1 πL
e−π2kkk2/(α2L2)
kkk2 :k6=0,
0 :k=0.
Truncate the infinite sum and compute the structure factors
S(k) :=
N
X
i=1
qie2πikTxi/L≈S˜(k),
wherek∈ IM, via theadjoint NFFT.
Finally, the long range parts of the potentials are approximated via theNFFT.
φL(j)≈ X
k∈IM
ψ(k) ˜ˆ S(k) e−2πikTxj/L.
Fast Ewald summation for charged particle systems The 3d-periodic case
Fields and forces
• Potentials:φ(j) =φshort(j) +φF(j) +φself(j) +φcorrect(j)
• Energies:U(j) =qjφ(j)
• Overall energy:U =12PN j=1qjφ(j)
• Fields:E(j) =−∇xjφ(j) =Eshort(j) +EF(j)+Ecorrect(j)
• Forces:F(j) =qjE(j)
Fourier space parts of the fields:
EF(j) =−∇xj
X
k∈IM
ψ(k)Sˆ (k) e−2πikTxj/L
Fast Ewald summation for charged particle systems The 3d-periodic case
Gradient NFFT
∇f(xj) =∇xj
X
k∈IM
fˆke−2πikTxj.
• ik-differentiation:
∇f(xj) =−2πi X
k∈IM
fˆkke−2πikTxj.
We need an FFT in each of the 3 dimensions.
{fˆk}7→ {ˆD gk} 7→ {−2πiˆgkk}3xFFT7→ {gl} 7→X
l
glϕ(x˜ j−l/σM)
• Analytical differentiation:
{fˆk}7→ {ˆD gk}1xFFT7→ {gl} 7→X
l
gl∇ϕ(x˜ j−l/σM)
Apply the differentiation operator to the NFFT window function. Only one FFT is needed.
Fast Ewald summation for charged particle systems The 3d-periodic case
Gradient NFFT
∇f(xj) =∇xj
X
k∈IM
fˆke−2πikTxj.
• ik-differentiation:
∇f(xj) =−2πi X
k∈IM
fˆkke−2πikTxj.
We need an FFT in each of the 3 dimensions.
{fˆk}7→ {ˆD gk} 7→ {−2πiˆgkk}3xFFT7→ {gl} 7→X
l
glϕ(x˜ j−l/σM)
• Analytical differentiation:
{fˆk}7→ {ˆD gk}1xFFT7→ {gl} 7→X
l
gl∇ϕ(x˜ j−l/σM)
Apply the differentiation operator to the NFFT window function. Only one FFT is needed.
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
Ewald summation with 2d-periodic b.c.
Long range part under 2d-periodic b.c.[Grzybowski, Gwó´zd´z, Bródka 2000]
We writexij= (˜xij, xij,3)and obtain φL(j) = X
k∈Z2\{0}
N
X
i=1
qie2πik·˜xij/LΘp2(kkk, xij,3) −
N
X
i=1
qiΘp2(0, xij,3)
2d Fourier series k=0part
Θp2(k, r)
k= 1 k=√
2 k=√
3 . . .
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
e2πkr/L 2Lk erfcπk
αL+αr
+e−2πkr/L2Lk erfcπk αL−αr
Θp2(0, r) =2
√π
αL2e−α2r2+2rπL2erf(αr)
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
Ewald summation with 2d-periodic b.c.
Long range part under 2d-periodic b.c.[Grzybowski, Gwó´zd´z, Bródka 2000]
We writexij= (˜xij, xij,3)and obtain φL(j) = X
k∈Z2\{0}
N
X
i=1
qie2πik·˜xij/LΘp2(kkk, xij,3) −
N
X
i=1
qiΘp2(0, xij,3)
2d Fourier series k=0part
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
0 0.1 0.2 0.3 0.4 0.5
Θp2(k, r)
k= 1 k=√
2 k=√
3 . . .
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
e2πkr/L 2Lk erfc
πk αL+αr
+e−2πkr/L2Lk erfc πk αL−αr
Θp2(0, r) =2
√π
αL2e−α2r2+2rπL2erf(αr)
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
Ewald summation with 2d-periodic b.c.
Long range part under 2d-periodic b.c.[Grzybowski, Gwó´zd´z, Bródka 2000]
We writexij= (˜xij, xij,3)and obtain φL(j) = X
k∈Z2\{0}
N
X
i=1
qie2πik·˜xij/LΘp2(kkk, xij,3) −
N
X
i=1
qiΘp2(0, xij,3)
2d Fourier series k=0part
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
0 0.1 0.2 0.3 0.4 0.5
Θp2(k, r)
k= 1 k=√
2 k=√
3 . . .
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
e2πkr/L 2Lk erfc
πk αL+αr
+e−2πkr/L2Lk erfc πk αL−αr
Θp2(0, r) =2
√π
αL2e−α2r2+2rπL2erf(αr)
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
Apply 1d fast summation
k= 0and smallk6= 0 k6= 0large enough
0
−L L
−h/2 h/2
R(k,·) Θp2(k,·)
polynomial polynomial
1
−h/2 h/2
Θp2(k, r)≈ X∞ n=−∞
Θp2(k, r+nh) Θp2(k,·) h-periodization
1
Choose an appropriate periodh >2L:
• embedΘp2(k,·)into a smooth function R(k,·)(regularization)
• interpolate the derivatives at the boundary up to orderp∈N
• approximate Fourier coefficients byFFT
• approximate the function by itsh-periodic version
• useanalytical Fourier coefficients (Poisson summation formula)
Result: Θp2(k, r)≈
M3/2−1
P
l=−M3/2
ˆbk,le2πilr/h , r∈[−L, L].
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
NFFT based algorithm
φL(j) = X
k∈Z2
e2πik·x˜ij/L
N
X
i=1
qiΘp2(kkk, xij,3)
≈ X
k∈IM
e2πik·x˜ij/L
N
X
i=1
qiΘp2(kkk, xij,3)
≈ X
k∈IM
X
l∈IM3
ˆbkkk,l
N
X
i=1
qie
2πi
k1 k2 l
·
xi1/L xi2/L xi3/h
| {z }
3d adj. NFFT
e
−2πi
k1 k2 l
·
xj1/L xj2/L xj3/h
| {z }
3d NFFT,j=1,...,N
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
1d and 0d-periodic b.c.
• 2d-periodic:
φF(j) = X
k∈Z2 N
X
i=1
qie2πikTx˜ij/LΘp2(kkk,|xij,3|) Approximate the functionsΘp2(kkk,·)by trigonometric polynomials.
• 1d-periodic:
φF(j) =X
k∈Z N
X
i=1
qie2πikxij,1/LΘp1(|k|,k˜xijk)
Approximate the functionsΘp1(|k|,k · k)by bivariate trigonometric polynomials.
• 0d-periodic (open):
φF(j) =
N
X
i=1
qi
erf(αkxijk) kxijk
Approximateerf(αk · k)/k · kby a trivariate trigonometric polynomial.
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
1d and 0d-periodic b.c.
• 2d-periodic:
φF(j) = X
k∈Z2 N
X
i=1
qie2πikTx˜ij/LΘp2(kkk,|xij,3|)
Approximate the functionsΘp2(kkk,·)by trigonometric polynomials.
• 1d-periodic:
φF(j) =X
k∈Z N
X
i=1
qie2πikxij,1/LΘp1(|k|,k˜xijk)
Approximate the functionsΘp1(|k|,k · k)by bivariate trigonometric polynomials.
• 0d-periodic (open):
φF(j) =
N
X
i=1
qi
erf(αkxijk) kxijk
Approximateerf(αk · k)/k · kby a trivariate trigonometric polynomial.
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
1d and 0d-periodic b.c.
• 2d-periodic:
φF(j) = X
k∈Z2 N
X
i=1
qie2πikTx˜ij/LΘp2(kkk,|xij,3|)
Approximate the functionsΘp2(kkk,·)by trigonometric polynomials.
• 1d-periodic:
φF(j) =X
k∈Z N
X
i=1
qie2πikxij,1/LΘp1(|k|,k˜xijk)
Approximate the functionsΘp1(|k|,k · k)by bivariate trigonometric polynomials.
• 0d-periodic (open):
φF(j) =
N
X
i=1
qi
erf(αkxijk) kxijk
Approximateerf(αk · k)/k · kby a trivariate trigonometric polynomial.
Fast Ewald summation for charged particle systems Mixed periodic boundary conditions
P
2NFFT, computation of the Fourier space part
3d-periodic: φF(j) = X
k∈IM
ψ(k)S(k)ˆ e
−2πikT
xj,1/L xj,2/L xj,3/L
2d-periodic: φF(j) = X
(k,l)∈IM
ˆbk,lS(k, l)e
−2πi(k,l)T
xj,1/L xj,2/L xj,3/h
1d-periodic: φF(j) = X
(k,l)∈IM
ˆbk,lS(k,l)e
−2πi(k,l)T
xj,1/L xj,2/h xj,3/h
0d-periodic: φF(j) = X
l∈IM
ˆblS(l)e
−2πilT
xj,1/h xj,2/h xj,3/h
Steps:1. adjoint NFFT, 2. multiply with the Fourier coefficients, 3. NFFT:
φF≈BF D·D·DF∗BT·q