• Keine Ergebnisse gefunden

14.Oktober2020 FranziskaNestler NFFT-basiertePartikelsimulationfürverschiedenartigeperiodischeRandbedingungen

N/A
N/A
Protected

Academic year: 2022

Aktie "14.Oktober2020 FranziskaNestler NFFT-basiertePartikelsimulationfürverschiedenartigeperiodischeRandbedingungen"

Copied!
46
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

NFFT based particle simulation for various types of periodic boundary conditions

NFFT-basierte Partikelsimulation für verschiedenartige periodische Randbedingungen

Franziska Nestler

Seminar: Theorie, Modellierung und Simulation, Institut für Physik, TU Chemnitz

14. Oktober 2020

(2)

NFFT based particle simulation for various types of periodic boundary conditions

Overview

1

Introduction

2

The Ewald summation approach

3

Fourier Approximations

4

Nonequispaced FFT and related methods

5

The particle-particle NFFT (P

2

NFFT) algorithm

6

Numerical Results

7

Summary and discussion

(3)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

The Coulomb problem

Charged particle system: Let N charges q

j

R

at positions

xj

R3

be given.

Are interested in the electrostatic potentials (x

ij

:=

xi

xj

):

φ(j) :=

N

X

i=1 i6=j

q

i

kx

ij

k , j = 1, . . . , N. → O(N

2

)?

3d-periodic boundary conditions Choose S :=

Z3

,

xj

∈ [−

L

/

2

,

L

/

2

)

3

and set

φ(j) :=

X

n∈S N

X

i=1 i6=jifn=0

q

i

kx

ij

+ Lnk

→ crystals, . . .

→conditional convergence for electrical neutral particle systems

(4)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

The Coulomb problem

Charged particle system: Let N charges q

j

R

at positions

xj

R3

be given.

Are interested in the electrostatic potentials (x

ij

:=

xi

xj

):

φ(j) :=

N

X

i=1 i6=j

q

i

kx

ij

k , j = 1, . . . , N. → O(N

2

)?

3d-periodic boundary conditions Choose S :=

Z3

,

xj∈[−L/2,L/2)3

and set

φ(j) :=

X

n∈S N

X

i=1 i6=jifn=0

q

i

kx

ij

+ Lnk

→ crystals, . . .

L

→conditional convergence for electrical neutral particle systems

(5)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

The Coulomb problem

Charged particle system: Let N charges q

j

R

at positions

xj

R3

be given.

Are interested in the electrostatic potentials (x

ij

:=

xi

xj

):

φ(j) :=

N

X

i=1 i6=j

q

i

kx

ij

k , j = 1, . . . , N. → O(N

2

)?

3d-periodic boundary conditions Choose S :=

Z3

,

xj

∈ [−

L

/

2

,

L

/

2

)

3

and set

φ(j) :=

X

n∈S N

X

i=1 i6=jifn=0

q

i

kx

ij

+ Lnk

→ crystals, . . .

→conditional convergence for electrical neutral particle systems

(6)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

The Coulomb problem

Charged particle system: Let N charges q

j

R

at positions

xj

R3

be given.

Are interested in the electrostatic potentials (x

ij

:=

xi

xj

):

φ(j) :=

N

X

i=1 i6=j

q

i

kx

ij

k , j = 1, . . . , N. → O(N

2

)?

3d-periodic boundary conditions Choose

S:=Z3

,

xj

∈ [−

L

/

2

,

L

/

2

)

3

and set

φ(j) :=

X

n∈S N

X

i=1 i6=jifn=0

q

i

kx

ij

+

Lnk

→ crystals, . . .

→conditional convergence for electrical neutral particle systems

(7)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

Extension to systems with charges and dipoles

Add

dipole particles. Given

N

c

charges q

j

R

at positions

xj

, j ∈ C,

N

d

dipoles with

dipole momentsµj∈R3

at positions

xj

, j ∈ D.

Total number of particles N := N

c

+ N

d

. Replace the charges q

j

by the operators ξ

j

:

q

j

7→

ξj:=

(qj :j∈ C, µ>jxj :j∈ D.

Electrostatic potentials:

φ(j) :=

X

n∈S N

X

i=1 i6=jifn=0

ξi

kx

ij

+ Lnk , j = 1, . . . , N.

(8)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

Periodic boundary conditions

3d-periodic

S :=

Z3

→ crystals, . . .

L L

L

1

open boundary conditions S := {0}

3

1

2d-periodic

S :=

Z2

× {0} → thin liquid films, . . .

L L

1

1d-periodic

S :=

Z

× {0}

2

→ nano channels, . . .

L

1

(9)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

Periodic boundary conditions

3d-periodic

S :=

Z3

→ crystals, . . .

L L

L

1

open boundary conditions S := {0}

3

1

2d-periodic

S :=

Z2

× {0} → thin liquid films, . . .

L L

1d-periodic

S :=

Z

× {0}

2

→ nano channels, . . .

L

(10)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

Triclinic structures

Also more general box shapes may be treated:

Insert kx

ij

+

Lnk

with a 3 × 3 matrix

L

and matrix-vector products

Ln.

`1

`2

`3

1

`1

`2

1

`1

1 1

But, for simplicity, we restrict to the cubic case in this talk!

(11)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

Preliminary studies and PhD project

Dissertation: Oct. 2012 – April 2018

Efficient Computation of Electrostatic Interactions in Particle Systems Based on Nonequispaced Fast Fourier Transforms

Starting Point:

• FastO(NlogN)algorithm (P2NFFT) for 3d-periodic charged particle systems [Pippig, Potts 2011]

• Fast summation techniques for open boundary conditions [Nieslony, Potts, Steidl 2004]

Goal: Unified framework / fast algorithm for

• 2d- and 1d-periodic boundary conditions,

• open boundary conditions,

• dipole-dipole interactions,

• charge-dipole interactions.

• Error control and automated parameter tuning (as far as possible).

DFG Project

Fast Fourier-based Coulomb solvers for partially periodic boundary conditions, together with Prof. Dr. Christian Holm (Institute for Computational

Physics, University of Stuttgart)

(12)

NFFT based particle simulation for various types of periodic boundary conditions Introduction: What are we interested in?

Preliminary studies and PhD project

Dissertation: Oct. 2012 – April 2018

Efficient Computation of Electrostatic Interactions in Particle Systems Based on Nonequispaced Fast Fourier Transforms

Starting Point:

• FastO(NlogN)algorithm (P2NFFT) for 3d-periodic charged particle systems [Pippig, Potts 2011]

• Fast summation techniques for open boundary conditions [Nieslony, Potts, Steidl 2004]

Goal: Unified framework / fast algorithm for

• 2d- and 1d-periodic boundary conditions,

• open boundary conditions,

• dipole-dipole interactions,

• charge-dipole interactions.

• Error control and automated parameter tuning (as far as possible).

DFG Project

Fast Fourier-based Coulomb solvers for partially periodic boundary conditions, together with Prof. Dr. Christian Holm (Institute for Computational

Physics, University of Stuttgart)

(13)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Ewald splitting

Idea of Ewald summation

[Ewald 1921]

:

Ewald splitting

1

r =

erf(αr) r

| {z } long ranged, continuous

+

erfc(αr) r

| {z } singular in 0, short ranged

0 0.2 0.4 0.6 0.8 1 0

2 4 6 8 10

erf(x) :=

2πRx

0

e

−t2

dt (error function),

lim

r→0 erf(αr)

r = π

erfc(x) := 1 − erf(x) (complementary error function)

α > 0 (scaling parameter)

(14)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Ewald splitting

Idea of Ewald summation

[Ewald 1921]

:

Ewald splitting

1

r =

erf(αr) r

| {z } long ranged, continuous

+

erfc(αr) r

| {z } singular in 0, short ranged

0 0.2 0.4 0.6 0.8 1 0

2 4 6 8 10

erf(x) :=

2πRx

0

e

−t2

dt (error function),

lim

r→0 erf(αr)

r = π

erfc(x) := 1 − erf(x) (complementary error function)

α > 0 (scaling parameter)

(15)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

3d-periodic constraints

φ(j) =

X

n∈Z3 N

X

i=1 i6=jifn=0

ξ

i

kx

ij

+ Lnk

=

X

n∈Z3 N

X

i=1 i6=jifn=0

ξierfc(αkxij+Lnk) kxij+Lnk

+

X

n∈Z3 N

X

i=1

ξierf(αkxij+Lnk)

kxij+Lnk

− φ

self

(j)

short range part:

direct evaluation (truncation), only consider kx

ij

+ Lnk ≤ r

cut

long range part:

Fourier coefficients

are known an- alytically.

φ

self

(j) =

(

π

q

j

: charges 0 : dipoles

φ

long

(j) =

X

k∈Z3\{0} N

X

i=1

ξ

i

e−π2kkk2/(α2L2)

πLkkk2

e

2πik>xij/L

→ good choice of truncation parameters: O(N

3/2

)

(16)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

3d-periodic constraints

φ(j) =

X

n∈Z3 N

X

i=1 i6=jifn=0

ξ

i

kx

ij

+ Lnk

=

X

n∈Z3 N

X

i=1 i6=jifn=0

ξierfc(αkxij+Lnk) kxij+Lnk

+

X

n∈Z3 N

X

i=1

ξierf(αkxij+Lnk)

kxij+Lnk

− φ

self

(j)

short range part:

direct evaluation (truncation), only consider kx

ij

+ Lnk ≤ r

cut

long range part:Fourier coefficients

are known an- alytically.

φ

self

(j) =

(

π

q

j

: charges 0 : dipoles

φ

long

(j) =

X

k∈Z3\{0}

N

X

i=1

ξ

i

e−π2kkk2/(α2L2)

πLkkk2

e

2πik>xij/L

→ good choice of truncation parameters: O(N

3/2

)

(17)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

3d-periodic constraints

→ How to compute the long range part even more efficiently? Idea: FFT for nonequispaced data (NFFT), particle mesh approach → O(N log N) A fast algorithm is obtained based on the identity e

y−z

= e

y

· e

−z

:

φ

long,3d

(j) =

X

k∈Z3 N

X

i=1

ξ

iΘ3dk,α

e

2πik>xij/L

=

X

k∈Z3

Θ3dk,α

N

X

i=1

ξ

i

e

2πik>xi/L

!

e

−2πik>xj/L

(18)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Fourier space representations 3d/2d/1d/0d

Periodic directions:

Compute analytical Fourier transform (exponential decrease for kkk → ∞ or |k| → ∞).

Influence of nonperiodic directions:

Fourier coefficients depend on particle distances regarding the nonperiodic dimensions.

φ

long,3d

(j) =

X

k∈Z3 N

X

i=1

ξ

iΘ3dk,α

e

2πik>xij/L

φ

long,2d

(j) =

X

k∈Z2 N

X

i=1

ξ

i

Θ

2dk,α

(|x

3,ij

|)e

2πik>x˜ij/L

,

x

= (˜

x, x3

)

φ

long,1d

(j) =

X

k∈Z N

X

i=1

ξ

i

Θ

1dk,α

(k¯

xij

k)e

2πik>x1,ij/L

,

x

= (x

1

,

x)

¯

φ

long,0d

(j) =

N

X

i=1

ξ

i

Θ

0dα

(kx

ij

k) with Θ

0dα

(r) = erf(αr)

r

(19)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Fourier space representations 3d/2d/1d/0d

Periodic directions:

Compute analytical Fourier transform (exponential decrease for kkk → ∞ or |k| → ∞).

Influence ofnonperiodic directions:

Fourier coefficients depend on particle distances regarding the nonperiodic dimensions.

φ

long,3d

(j) =

X

k∈Z3 N

X

i=1

ξ

i

Θ

3dk,α

e

2πik>xij/L

φ

long,2d

(j) =

X

k∈Z2 N

X

i=1

ξ

iΘ2dk,α(|x3,ij|)e2πik>x˜ij/L

,

x

= (˜

x, x3

)

φ

long,1d

(j) =

X

k∈Z N

X

i=1

ξ

iΘ1dk,α(k¯xijk)e2πik>x1,ij/L

,

x

= (x

1

,

x)

¯

φ

long,0d

(j) =

N

X

i=1

ξ

iΘ0dα(kxijk)

with Θ

0dα

(r) = erf(αr)

r

(20)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Goal: fast algorithm

3d-periodic:

φ

long,3d

(j) =

X

k∈Z3

Θ

3dk,α

N

X

i=1

ξ

i

e

2πik>xi/L

!

e

−2πik>xj/L

Idea for 2d/1d/0d:

Obtain the same structure by applying appropriate periodization approaches to the symmetric / radial functions

Θ

2dk,α

(| · |), Θ

1dk,α

(k

·

k) and Θ

0dα

(k

·

k).

Approximate by Fourier sums, e.g.:

Θ

2dk,α

(| · |) ≈

X

l

ˆ b

(k,l),α

e

2πil·/h

for each

k.

(k, l) ∈

Z3

⇒ φ

long,2d

(j) ≈

X

(k,l)∈Z3

ˆb(k,l),α N

X

i=1

ξ

i

e

2πi

k l

>

˜ xi /L xi,3/h

!

e

−2πi

k l

>

˜ xj /L xi,3/h

(21)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Goal: fast algorithm

3d-periodic:

φ

long,3d

(j) =

X

k∈Z3

Θ3dk,α

N

X

i=1

ξ

i

e

2πik>xi/L

!

e

−2πik>xj/L

Idea for 2d/1d/0d:

Obtain the same structure by applying appropriate periodization approaches to the symmetric / radial functions

Θ

2dk,α

(| · |), Θ

1dk,α

(k

·

k) and Θ

0dα

(k

·

k).

Approximate by Fourier sums, e.g.:

Θ

2dk,α

(| · |) ≈

X

l

ˆb(k,l),α

e

2πil·/h

for each

k. (k, l)∈Z3

⇒ φ

long,2d

(j) ≈

X

(k,l)∈Z3

ˆb(k,l),α N

X

i=1

ξ

i

e

2πi

k l

>

˜ xi /L xi,3/h

!

e

−2πi

k l

>

˜ xj /L xi,3/h

(22)

NFFT based particle simulation for various types of periodic boundary conditions The Ewald summation approach

Involved functions

−10 0 −5 0 5 10 2

4 6

−10 0 −5 0 5 10 3

6

−10 0 −5 0 5 10 15

30

Θ

2dk,α

(·), Θ

1dk,α

(·):

k

or k large enough.

Type A:

Very fast decay.

Θ

2dk,α

(·), Θ

1dk,α

(·):

k

or k small; Θ

0dα

(·).

Type B:

No decay at all or not fast enough.

The functionsΘ2dk,α(·),Θ1dk,α(·)andΘ0dα(·)are only interesting in the interval[−L, L].

In this example we haveL= 10.

(23)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodization approaches (nonperiodic dimensions)

One-dimensional setting:

Approximate a given nonperiodic function over[−L, L]by a trig. polynomial.

Different techniques may be applied for functions of type A and B, respectively.

L L

h2 h

2 3h

2 C

L L

h2 h

2 3h

h−L 2 Cp−1

Type A:The function is sufficiently small

Type B:Construct an interpolating polynomial

outside a not too large interval[−h2,h2].

within[L, h−L]that fits the derivatives off

Use analytical Fourier transform:

up to a certain degree.

Poisson:f(x)≈1h X

|l|≤M/2

l h

e2πilx/h

via FFT: f(x)˜ ≈ X

|l|≤M/2

ˆble2πilx/h

Higher dimensions:The generalization in case ofType Afunctions is straight forward. The periodization approachType Bis possible in a similar fashion for radial kernelsf=f(kxk).

(24)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodization approaches (nonperiodic dimensions)

One-dimensional setting:

Approximate a given nonperiodic function over[−L, L]by a trig. polynomial.

Different techniques may be applied for functions of type A and B, respectively.

L L

h2 h

2 3h

2 C

L L

h2 h

2 3h

h−L 2 Cp−1

Type A:The function is sufficiently small Type B:Construct an interpolating polynomial outside a not too large interval[−h2,h2]. within[L, h−L]that fits the derivatives off Use analytical Fourier transform: up to a certain degree.

Poisson:f(x)≈1h X

|l|≤M/2

l h

e2πilx/h via FFT: f(x)˜ ≈ X

|l|≤M/2

ˆble2πilx/h

Higher dimensions:The generalization in case ofType Afunctions is straight forward. The periodization approachType Bis possible in a similar fashion for radial kernelsf=f(kxk).

(25)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodization approaches (nonperiodic dimensions)

One-dimensional setting:

Approximate a given nonperiodic function over[−L, L]by a trig. polynomial.

Different techniques may be applied for functions of type A and B, respectively.

L L

h2 h

2 3h

2 C

L L

h2 h

2 3h

h−L 2 Cp−1

Type A:The function is sufficiently small Type B:Construct an interpolating polynomial outside a not too large interval[−h2,h2]. within[L, h−L]that fits the derivatives off Use analytical Fourier transform: up to a certain degree.

Poisson:f(x)≈1h X

|l|≤M/2

l h

e2πilx/h via FFT: f(x)˜ ≈ X

|l|≤M/2

ˆble2πilx/h

Higher dimensions:The generalization in case ofType Afunctions is straight forward.

The periodization approachType Bis possible in a similar fashion for radial kernelsf=f(kxk).

(26)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodic dimensions:

Exponential decrease forkkk → ∞or|k| → ∞ ⇒truncateFourier series.

Nonperiodic dimensions:

Apply appropriate periodization approaches to the involved functions.

Result: φlong(j)≈ X

κ∈M

ˆbκ

XN i=1

ξie2πiκ>˘xi

!

e−2πiκ>x˘j

withM ⊂Z3finiteand scaled nodes˘x:=L−1x(periodic),x˘:=h−1x(nonper. directions).

Indices Fourier coefficients Approach

3dp: κ=k ˆbk= Θp3k,αk,0e−π2kkk2/(α2L2 )

πLkkk2 analytic FT

2dp: κ= (k, l) Computeˆbk,lvia periodization kkksmall:Type B(1d-FFT) of each functionΘp2k,α(| · |) kkklarge:Type A(analytic) 1dp: κ= (k,l) Computeˆbk,lvia periodization |k|small:Type B(2d-FFT)

of each functionΘp1k,α(k · k) |k|large:Type A(analytic) 0dp: κ=l ApproximateΘp0α(k · k) = erf(αk·k)k·k Type B(3d-FFT)

(27)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodic dimensions:

Exponential decrease forkkk → ∞or|k| → ∞ ⇒truncate Fourier series.

Nonperiodic dimensions:

Apply appropriate periodization approaches to the involved functions.

Result: φlong(j)≈ X

κ∈M

ˆbκ

XN i=1

ξie2πiκ>˘xi

!

e−2πiκ>x˘j

withM ⊂Z3finite and scaled nodes˘x:=L−1x(periodic),x˘:=h−1x(nonper. directions).

Indices Fourier coefficients Approach

3dp: κ=k ˆbk= Θp3k,αk,0e−π2kkk2/(α2L2 )

πLkkk2 analytic FT

2dp: κ= (k, l) Computeˆbk,lvia periodization kkksmall:Type B(1d-FFT) of each functionΘp2k,α(| · |) kkklarge:Type A(analytic)

1dp: κ= (k,l) Computeˆbk,lvia periodization |k|small:Type B(2d-FFT) of each functionΘp1k,α(k · k) |k|large:Type A(analytic) 0dp: κ=l ApproximateΘp0α(k · k) = erf(αk·k)k·k Type B(3d-FFT)

(28)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodic dimensions:

Exponential decrease forkkk → ∞or|k| → ∞ ⇒truncate Fourier series.

Nonperiodic dimensions:

Apply appropriate periodization approaches to the involved functions.

Result: φlong(j)≈ X

κ∈M

ˆbκ

XN i=1

ξie2πiκ>˘xi

!

e−2πiκ>x˘j

withM ⊂Z3finite and scaled nodes˘x:=L−1x(periodic),x˘:=h−1x(nonper. directions).

Indices Fourier coefficients Approach

3dp: κ=k ˆbk= Θp3k,αk,0e−π2kkk2/(α2L2 )

πLkkk2 analytic FT

2dp: κ= (k, l) Computeˆbk,lvia periodization kkksmall:Type B(1d-FFT) of each functionΘp2k,α(| · |) kkklarge:Type A(analytic) 1dp: κ= (k,l) Computeˆbk,lvia periodization |k|small:Type B(2d-FFT)

of each functionΘp1k,α(k · k) |k|large:Type A(analytic)

0dp: κ=l ApproximateΘp0α(k · k) = erf(αk·k)k·k Type B(3d-FFT)

(29)

NFFT based particle simulation for various types of periodic boundary conditions Fourier Approximations

Periodic dimensions:

Exponential decrease forkkk → ∞or|k| → ∞ ⇒truncate Fourier series.

Nonperiodic dimensions:

Apply appropriate periodization approaches to the involved functions.

Result: φlong(j)≈ X

κ∈M

ˆbκ

XN i=1

ξie2πiκ>˘xi

!

e−2πiκ>x˘j

withM ⊂Z3finite and scaled nodes˘x:=L−1x(periodic),x˘:=h−1x(nonper. directions).

Indices Fourier coefficients Approach

3dp: κ=k ˆbk= Θp3k,αk,0e−π2kkk2/(α2L2 )

πLkkk2 analytic FT

2dp: κ= (k, l) Computeˆbk,lvia periodization kkksmall:Type B(1d-FFT) of each functionΘp2k,α(| · |) kkklarge:Type A(analytic) 1dp: κ= (k,l) Computeˆbk,lvia periodization |k|small:Type B(2d-FFT)

of each functionΘp1k,α(k · k) |k|large:Type A(analytic) 0dp: κ=l ApproximateΘp0α(k · k) = erf(αk·k)k·k Type B(3d-FFT)

(30)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

FFT for nonequispaced data – NFFT

Notation For M ∈ 2

N

set I

M

:= {−

M

/

2

, . . . ,

M

/

2

− 1}

d

Zd

.

Torus

T

:=

R

/

Z

' [−

1

/

2

,

1

/

2

)

NFFT:

f(x

j

) :=

X

k∈IM

f ˆ

k

e

−2πik>xj xj

Td

, j = 1, . . . , N

(inverse) FFT: f (j) :=

X

k∈IM

f ˆ

k

e

−2πik>j/M j

IM

, N := |I

M

| = M

d

adjoint NFFT:

h(k) :=

N

X

j=1

f

j

e

2πik>xj k

∈ I

M

Complexity: O(|I

M

| log |I

M

| + N )

[Dutt, Rokhlin 1993] [Beylkin 1995] [Potts, Steidl, Tasche 2001] [Greengard, Lee 2004]

(31)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

FFT for nonequispaced data – NFFT

Notation For M ∈ 2

N

set I

M

:= {−

M

/

2

, . . . ,

M

/

2

− 1}

d

Zd

. Torus

T

:=

R

/

Z

' [−

1

/

2

,

1

/

2

)

NFFT:

f(x

j

) :=

X

k∈IM

f ˆ

k

e

−2πik>xj xj

Td

, j = 1, . . . , N

(inverse) FFT: f (j) :=

X

k∈IM

f ˆ

k

e

−2πik>j/M j

∈ I

M

, N := |I

M

| = M

d

adjoint NFFT:

h(k) :=

N

X

j=1

f

j

e

2πik>xj k

∈ I

M

Complexity: O(|I

M

| log |I

M

| + N )

[Dutt, Rokhlin 1993] [Beylkin 1995]

[Potts, Steidl, Tasche 2001] [Greengard, Lee 2004]

(32)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

FFT for nonequispaced data – NFFT

Notation For M ∈ 2

N

set I

M

:= {−

M

/

2

, . . . ,

M

/

2

− 1}

d

Zd

. Torus

T

:=

R

/

Z

' [−

1

/

2

,

1

/

2

)

NFFT:

f(x

j

) :=

X

k∈IM

f ˆ

k

e

−2πik>xj xj

Td

, j = 1, . . . , N

(inverse) FFT: f (j) :=

X

k∈IM

f ˆ

k

e

−2πik>j/M j

∈ I

M

, N := |I

M

| = M

d

adjoint NFFT:

h(k) :=

N

X

j=1

f

j

e

2πik>xj k

∈ I

M

Complexity: O(|I

M

| log |I

M

| + N )

[Dutt, Rokhlin 1993] [Beylkin 1995]

[Potts, Steidl, Tasche 2001] [Greengard, Lee 2004]

(33)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

NFFT: idea and workflow

Trace problem back to equidistant case via convolution with a window function.

inverse FFT:

gl

:= 1 M

d

X

k∈IM

1 c

k

( ˜ ϕ)

f ˆ

k

e

2πik>l/M

(l ∈ I

M

)

Convolution with window function:

f(x

j

) ≈

X

l∈IM

gl

ϕ ˜

xj

Ml

12

1

0

2 1

M

Mm,mM

˜ ϕ(x)

12

1

0

2

(34)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

NFFT: idea and workflow

Trace problem back to equidistant case via convolution with a window function.

inverse FFT:

gl

:= 1 M

d

X

k∈IM

1 ck( ˜ϕ)

f ˆ

k

e

2πik>l/M

(l ∈ I

M

)

Convolution with window function:

f(xj)≈ X

l∈IM

gl

ϕ ˜

xj

Ml

12

1

0

2 1

M

Mm,mM

˜ ϕ(x)

12

1

0

2

(35)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

NFFT: various parameters

f(xj)

X

l∈IM

gl

ϕ ˜

xj

Ml

12

1

0

2 1

M

mM,Mm

˜ ϕ(x)

12

1

0

2

Parameters:

window function ϕ (B-spline, a Bessel function, Gaussian)

→ compactly supported or truncated (only a few non-zero summands)

support parameter m ∈

N

(width of window)

oversampling factor σ ≥ 1

(36)

NFFT based particle simulation for various types of periodic boundary conditions Tools: How do we get a fast algorithm?

NFFT: various parameters

f(xj)

X

l∈IσM

gl

ϕ ˜

xj

σMl

12

1

0

2 1

σM

σMm ,σMm

˜ ϕ(x)

12

1

0

2

Parameters:

window function ϕ (B-spline, a Bessel function, Gaussian)

→ compactly supported or truncated (only a few non-zero summands)

support parameter m ∈

N

(width of window)

oversampling factor σ ≥ 1

(37)

NFFT based particle simulation for various types of periodic boundary conditions P2NFFT for systems with charges and dipoles

3d/2d/1d/0d-periodic boundary conditions

φ(j) =

X

n∈S N

X

i=1 i6=jifn=0

ξi

erfc(αkxij+Lnk) kxij+Lnk

+

X

n∈S N

X

i=1

ξi

erf(αkxij+Lnk)

kxij+Lnk

− φ

self

(j)

short:

Direct via truncation, only consider kx

ij

+ Lnk ≤ r

cut

.

long:

Combine different NFFT variants.

φ

long

(j) ≈

X

κ∈IM

ˆ b

k

X

i∈C

q

i

e

2πiκ>x˘i

| {z }

adj. NFFT

+

X

i∈D

µ>i

xi

e

2πiκ>x˘i

| {z }

adj. grad. NFFT

!

e

−2πiκ>x˘j

| {z }

NFFT

j ∈ C ∪ D

Computation of the forces:

charges: F(j) =−∇xjφ(j)·qj →gradient NFFT dipoles: F(j) =−∇xj>xjφ(j)·µj →Hessian NFFT

[Hofmann, N., Pippig 2017]

(38)

NFFT based particle simulation for various types of periodic boundary conditions P2NFFT for systems with charges and dipoles

3d/2d/1d/0d-periodic boundary conditions

φ(j) =

X

n∈S N

X

i=1 i6=jifn=0

ξi

erfc(αkxij+Lnk) kxij+Lnk

+

X

n∈S N

X

i=1

ξi

erf(αkxij+Lnk)

kxij+Lnk

− φ

self

(j)

short:

Direct via truncation, only consider kx

ij

+ Lnk ≤ r

cut

.

long:

Combine different NFFT variants.

φ

long

(j) ≈

X

κ∈IM

ˆ b

k

X

i∈C

q

i

e

2πiκ>x˘i

| {z }

adj. NFFT

+

X

i∈D

µ>i

xi

e

2πiκ>x˘i

| {z }

adj. grad. NFFT

!

e

−2πiκ>x˘j

| {z }

NFFT

j ∈ C ∪ D

Computation of the forces:

charges: F(j) =−∇xjφ(j)·qj →gradient NFFT dipoles: F(j) =−∇xj>xjφ(j)·µj →Hessian NFFT

Fast algorithm: particle-particle NFFT,O(NlogN)[Pippig, Potts 2011] [Hofmann, N., Pippig 2017]

(39)

NFFT based particle simulation for various types of periodic boundary conditions P2NFFT for systems with charges and dipoles

3d/2d/1d/0d-periodic boundary conditions

φ(j) =

X

n∈S N

X

i=1 i6=jifn=0

ξi

erfc(αkxij+Lnk) kxij+Lnk

+

X

n∈S N

X

i=1

ξi

erf(αkxij+Lnk)

kxij+Lnk

− φ

self

(j)

short:

Direct via truncation, only consider kx

ij

+ Lnk ≤ r

cut

.

long:

Combine different NFFT variants.

φ

long

(j) ≈

X

κ∈IM

ˆ b

k

X

i∈C

q

i

e

2πiκ>x˘i

| {z }

adj. NFFT

+

X

i∈D

µ>i

xi

e

2πiκ>x˘i

| {z }

adj. grad. NFFT

!

e

−2πiκ>x˘j

| {z }

NFFT

j ∈ C ∪ D

Computation of the forces:

charges: F(j) =−∇xjφ(j)·qj →gradient NFFT dipoles: F(j) =−∇xj>xjφ(j)·µj →Hessian NFFT

(40)

NFFT based particle simulation for various types of periodic boundary conditions P2NFFT for systems with charges and dipoles

Visualization of the P

2

NFFT workflow

Precomputations

Run P2NFFT Precompute Fourier coefficients

Structure factors

Direct computations

Long range interactions 3d-periodic

ˆ c(κ):=ψp3(k)

analytic FT

2d-periodic ˆ c(κ):=ψp2(k,l)

1d-FFTk

1d-periodic ˆ c(κ):=ψp1(k,l)

2d-FFT∀k

0d-periodic ˆ c(κ):=ψp0(l)

3d-FFT

Adj. NFFT Sc(κ)

Adj.∇-NFFT Sd(κ)

Multiplication:

fˆκ:=c(κ) · [Sˆ c(κ)+Sd(κ)]

Near field module Self interactions

Correction terms NFFT(fˆκ)

Potentials ∇-NFFT(fˆκ)

Fields ∇∇>-NFFT(fˆκ)

Field gradients

MD-Simulations Compute energies, forces and torques.

Time evolution: simulate motion of particles.

Get new particle positions.

New time step.

Size of simulation box does not change.

New time step.

Simulation box has to be increased.

(41)

NFFT based particle simulation for various types of periodic boundary conditions Numerical results

Error estimates for 3d-periodic boundary conditions

Root mean square (rms) errors in the forces

∆F :=

vu ut1

N XN j=1

kF(j)−F(j)k2≈ ?

Two types of errors:

1

Truncation of Ewald sums

Fshort(j)≈Fshorttrunc.(j),Flong(j)≈Flongtrunc.(j)

X

charge-charge interactions (3d-p.)

[Kolafa, Perram 1992] X

dipole-dipole interactions (3d-p.)

[Wang, Holm 2001]

X

extension to charge-dipole systems (3d-p.)

[Hofmann, N., Pippig 2017]

2

NFFT based approximation errors

Flongtrunc.(j)≈FlongNFFT(j)

(42)

NFFT based particle simulation for various types of periodic boundary conditions Numerical results

Error estimates for 3d-periodic boundary conditions

Root mean square (rms) errors in the forces

∆F :=

vu ut1

N XN j=1

kF(j)−F(j)k2≈ ?

Two types of errors:

1 Truncation of Ewald sums Fshort(j)≈Fshorttrunc.(j),Flong(j)≈Flongtrunc.(j)

X

charge-charge interactions (3d-p.)

[Kolafa, Perram 1992]

X

dipole-dipole interactions (3d-p.)

[Wang, Holm 2001]

X

extension to charge-dipole systems (3d-p.)

[Hofmann, N., Pippig 2017]

2

NFFT based approximation errors

Flongtrunc.(j)≈FlongNFFT(j)

(43)

NFFT based particle simulation for various types of periodic boundary conditions Numerical results

Truncation errors in the Ewald sums (3d-periodic)

Based on existing estimates: Ewald truncation errors are predicted accurately.

charges:

0.5 1 1.5 2

10−14 10−11 10−8 10−5 10−2

rcut

=3.5 rcut

= 4.0 rcut

= 4.5 rcut

= 5.0 M= 16

M=24 M=32

α

rmsforceerror

dipoles:

0.5 1 1.5 2

10−14 10−11 10−8 10−5 10−2

rcut

=3.5 rcut

= 4.0 rcut

= 4.5 rcut

= 5.0 M= 16

M=24 M=32

α

rmsforceerror

Figure:

• Solid: Measured rms force errors in a small particle system.Nc=Nd= 50, L= 10.

• Dotted: Predicted rms force errors in the short range part.

• Dashed: Predicted rms force errors in the Fourier space part.

(44)

NFFT based particle simulation for various types of periodic boundary conditions Numerical results

Approximation errors: P

2

NFFT method

• Usage of NFFT algorithms introduces further approximation errors.

• Choose NFFT parameters such that additional errors are sufficiently small.

→Error analysis: Quite well understood for 3d-periodic boundary conditions.

• Choice of parameters for mixed periodic and open constraints:

based on error estimates for 3d-periodicity (heuristically).

0.5 1 1.5 2

10−7 10−6 10−5 10−4 10−3 10−2 10−1 100

rcut= 3 rcut= 4 rcut= 5

β= 2 β= 3

β= 4

α

rmsforceerror

charges

0.5 1 1.5 2

10−7 10−6 10−5 10−4 10−3 10−2 10−1 100

rcut= 3 rcut= 4 rcut= 5

β= 2

β= 3 β= 4

α

dipoles

system:Nc=Nd= 100,L= 10.

3d-periodic ,0d-periodic

(45)

Summary

P

2

NFFT (particle-particle NFFT)

X O(NlogN)method, based on NFFT [Pippig, Potts 2011]

X 3d-periodic, open, mixed periodic (same structure) [N., Pippig, Potts 2015]

X Extension to charge-dipole systems [Hofmann, N., Pippig 2017]

X Triclinic box shapes [N. 2018, Dissertation]

X Code publicly available github.com/scafacos

X Massively parallel [Pippig 2015]

X Numerical results for charge-dipole systems [N. 2018, Dissertation]

X Error analysis (3d-periodic) [N. 2018, Dissertation]

X Automated parameter tuning (publ. in progress) X Supported in ESPResSo

Thank you for your attention!

(46)

Summary

P

2

NFFT (particle-particle NFFT)

X O(NlogN)method, based on NFFT [Pippig, Potts 2011]

X 3d-periodic, open, mixed periodic (same structure) [N., Pippig, Potts 2015]

X Extension to charge-dipole systems [Hofmann, N., Pippig 2017]

X Triclinic box shapes [N. 2018, Dissertation]

X Code publicly available github.com/scafacos

X Massively parallel [Pippig 2015]

X Numerical results for charge-dipole systems [N. 2018, Dissertation]

X Error analysis (3d-periodic) [N. 2018, Dissertation]

X Automated parameter tuning (publ. in progress) X Supported in ESPResSo

Thank you for your attention!

Referenzen

ÄHNLICHE DOKUMENTE

At first, we must determine the appropriate Ewald splitting parameter α and a suitable grid size M. Therefore, we adopt the parameter tuning given in [35] such that it works with

Abstract—The efficient computation of interactions in charged particle systems is possible based on the well known Ewald summation formulas and the fast Fourier transform for

In the case of 3d-periodic boundary conditions the nonequispaced fast Fourier trans- form (NFFT) 30 can be directly applied to the Fourier space sum in order to achieve a

Abstract—Ewald summation has established as basic element of fast algorithms evaluating the Coulomb interaction energy of charged particle systems in three dimensions subject

N., Pippig, Potts: NFFT based fast Ewald summation for various types of periodic boundary conditions. Sutmann, Grotendorst, Gompper, Marx (Eds.), Computational Trends in Solvation

Fast Ewald summation for electrostatic systems with charges and dipoles for various types of periodic boundary conditions.. Franziska Nestler Chemnitz University

• new approach to fast Ewald summation under mixed boundary conditions: [Nestler, Pippig, Potts 2013 (Preprint)]. • 2d-periodic: Ewald + fast summation

Hofmann, Nestler, Pippig: NFFT based Ewald summation for electrostatic systems with charges and dipoles.. Nestler: Fast Ewald summation for electrostatic systems with charges