poissonsolverswithinterpolatingscaling functions ...bigdft.org/images/e/ef/berlin-lg.pdfpoisson...

23
Poisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances Surfaces BC Performances Outlook Numerical Methods in Density Functional Theory TU UNIVERSITY -BERLIN Poisson Solvers with Interpolating Scaling Functions for Electronic Structure Calculations Luigi Genovese L_Sim - CEA Grenoble 23 July 2008 Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Upload: others

Post on 04-Jun-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Numerical Methods in Density Functional Theory

TU UNIVERSITY - BERLIN

Poisson Solvers with Interpolating ScalingFunctions

for Electronic Structure Calculations

Luigi Genovese

L_Sim - CEA Grenoble

23 July 2008

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 2: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Outline

1 Self-Consistent potential in DFTPoisson Solver

2 Poisson Solver for Free BCCalculation of the Poisson KernelPerformances

3 A Poisson solver for Surfaces BCPerformances

4 Summary and outlook

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 3: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Self-Consistent potential in DFT

In the DFT calculation in the Kohn-Sham formalism we have:

Find a set of orthonormal orbitals Ψi(r) that minimizes:

E =−12

N/2

∑i=1

ZΨ∗i (r)∇

2Ψi(r)dr +12

Zρ(r)VH(r)dr

+ Exc[ρ(r)] +Z

Vext(r)ρ(r)dr

where

ρ(r) = 2N/2

∑i=1

Ψ∗i (r)Ψi(r)

∇2VH(r) =−4πρ(r)

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 4: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Operations performed in BigDFT code

Different operatorsDaubechies:

Kinetic energy

Scalar products, Vnl

Interpolating SF:

Vloc (gaussians)

XC (ρ needed)

Hartree : ∇2VH = ρ

Numerical operationsConvolutions withshort filters

Scalar products

FFT (Poisson Solver)

Interpolating Daubechies

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 5: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

The Poisson Solver in electronic structure calculation

During the minimization procedure we need to perform

Poisson’s equationCalculation of the self-consistent potential:

∇2VH(r) =−4πρ(r)

Such equation should be solved at each minimisationiteration. Need of having an efficient and accurate formalism.

Plane waves approachThe most common approach. Uses the fourier components

f (x ,y ,z) = ∑px ,py ,pz

e−2πi

(pxLx

x+pyLy

y+ pzLz

z)fpx ,py ,pz

The Poisson equation is algebraic in the Fourier coefficients

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 6: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Poisson Solver with plane waves treatment

The Laplacian is diagonal in Plane waves representation

Immediate solution

Vpx ,py ,pz =1π

1(pxLx

)2+(

pyLy

)2+(

pzLz

)2 ρpx ,py ,pz ,

CharacteristicsSimple and fast, easy to parallelize (FFT)

Automatically implement Periodic BC on a finite volume

Do not fix the value of V0,0,0

⇒ May result in problems for systems with other BC

How to solve this equation for other BC?

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 7: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Problems with Plane Wave expansion

How to remove long-distance interactions?Model their effect and subtract it

Good for integrated quantities (e.g. total energy) but stillinefficient for the local values V (r)The size L of the effective system must be enlarged wrtthe original one

Modify the kernel operator K = Kshort + Klong

Does not implement well short-distance behaviour,resulting in errorsThese errors decrease when the size of the system islarge

In both casesWe must consider a size that is larger than the size of theoriginal system

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 8: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Isolated BC: the Green function treatment

Consider the Poisson equation for isolated BC. In this casethe solution is given by

Green’s function for Free BC (kernel)

∇2 1

r=−4πδ(r) =⇒ V (r) =

Zdr′

ρ(r′)|r− r′|

An unambiguous solutionSuch prescription is unique and is compatible with Free BC.How to implement it?Plane-wave based approaches:

Truncated kernel, numerically or analytically

Screening Functions

Approximate treatment, large box required.

Need of an accurate and efficient algorithm

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 9: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Poisson Solver with Interpolating Scaling Functions

A convenient basis for an electrostatic problem

Interpolating Scaling FunctionsA set of localised functions centered on the nodes of auniform mesh

ϕj(x) = ϕ0(x− j)

Undergo multiscale relation

ϕ(x) =m

∑j=−m

hj︸︷︷︸filters

ϕ(2x− j)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6

LEAST ASYMMETRIC DAUBECHIES-16

scaling functionwavelet

4 The expansion coefficients are the real space valuesρjx ,jy ,jz = ρ(hx jx ,hy jy ,hz jz)

4 Represents exactly an order m polynomial

4 The first m discrete and continuous moments coincide

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 10: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

A finite three-dimensional convolution

The expression of the potential in this basis is thus intuitive:

V (i) = ∑j

Kij ρj

Where the central object is the

Poisson Kernel in the ISF basis

Kij = Ki−j , Ki =Z

K (|r|)ϕi(r)dr , K (r) =1r

Values of the potential are obtained via a convolution

V (i) = ∑j

Ki−j ρj

It can be treated via a zero-padded FFT algorithm

4 Exact, easy to parallelize (FFT)

4 For a box of N3 points, it reduces the scaling fromO(N6) to O(N3 logN)

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 11: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Characteristics of the approach

This approach is:

Explicit, guarantees the good BC

Real space-based, immediate interpretation of theexpansion coefficients

Can be combined with other real-space treatments ofthe density (e.g. XC) combined with ABINIT XC routines

Can be used independently from the BigDFT code

Preserves the first m (multipole) moments of theelectrostatic potential

Requires only the evaluation of the kernel

We need to evaluate N3 integrals Ki =R

K (|r|)ϕi(r)drwhere ϕi(r) = ϕix (x)ϕiy (y)ϕiz (z)

ISF basis is a tensor product

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 12: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Gaussian tensor product decomposition

It can be shown that (Beylkin et al.)

Approximation with gaussians

1r'∑

kωk e−pk r2

with k = 1, · · · ,89, pk , ωk suitably chosen

Accuracy of 10−8 for r ∈ (10−9,1)

We can rescale for R ∈ (0,L).

The computational cost is reduced N3→ 89×N

Kj =89

∑k=1

ωk Kjx (pk )Kjy (pk )Kjz (pk )

Kj(p) =Z

ϕ0(x)e−p(x−j)2dx

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 13: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Other properties of the scaling functions

The computational cost is reduced N3 → 89×N.

MoreoverThe scaling property of the interpolets

ϕ0(x/2) = ∑j

hjϕj(x) ,

Implies similar condition of the one-dimensional function

Kj(4p) =12 ∑

jhjK2i−j(p) .

Thus we can evaluate the integrals for low p (not too sharpgaussians), then rescaling.

ISF properties allows us to gain in accuracy

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 14: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Characteristics

Very fast with moderate memory occupation:

Elapsed Time for a 1283 grid on a Cray XT3

proc 1 2 4 8 16 32 64

s .92 .55 .27 .16 .11 .08 .09

More precise than other existing Free BC Poisson Solvers

1e-11

1e-10

1e-09

1e-08

1e-07

1e-06

1e-05

1e-04

0.001

0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6

Max

Err

or

Grid step

HockneyTuckerman

8th14th20th30th40th50th60th

100th

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 15: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Characteristics of the Solver

In summary, we have developed a technique

Free boundary conditions

Very high accuracy

Good computational performance, easy to parallelize

Can be used also in other contexts and/or combinedwith other treatment (e.g. XC)

Coupled with ABINIT XC routines

In BigDFT code, for big systems it represents a small amount(typical values are less than 2-3% for big systems) of theoverall computation

L. Genovese, T. Deutsch, A. Neelov, S. Goedecker, G. Beylkin

J. Chem. Phys. 125, 074105 (2006)

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 16: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

The Surfaces boundary conditions

The same formalism can be applied to other BC

Surfaces BCA domain isolated in one direction (say y ) and periodic in xand z, with periods Lx and Lz . A function f which lives insuch a domain can be expanded as

f (x ,y ,z) = ∑px ,pz

e−2πi( pxLx

x+ pzLz

z)fpx ,pz (y)

without any loss of generality.

Mixed representationFor such functions the Poisson’s equation become(

∂2y −µ2

px ,pz

)Vpx ,pz (y) = ρpx ,pz (y) ,

where µ2px ,pz

= 4π2(px/Lx )2 + (pz/Lz)2.

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 17: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

A Green’s function formalism

The Green’s function for the one-dimensional Helmoltzequation can be used(

∂2y −µ2)G(µ;y) = δ(y) ;

G(µ;y) =

{− 1

2µ e−µ|y | µ > 012 |y | µ = 0

,

the components of the potential can be carried out:

A Green’s function for each Fourier component

Vpx ,pz (y) =Z

dy ′G(µpx pz ;y− y ′)ρpx ,pz (y ′) .

We can use Interpolating Scaling Functions for the Isolateddirection.

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 18: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Surfaces BC with Mixed representation

By defining the one-dimensional kernels

K (µpx ,pz ; j) =Z

G(µpx pz ;y)ϕj(y)dy

We can have a treatment similar to the Free BC case

1-dim convolution for each reciprocal space component

Vpx ,pz (i) = ∑j

K (µpx ,pz ; i− j)ρpx ,pz (j)

From mixed representation to full real spaceThe calculation can be performed with a (semi-)zero-paddedFFT algorithm. The I/O are function of the real domain.

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 19: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Speed-up the calculation

The calculation of the kernel can be improved

SpeedThe analytic form of the Green functions allows for recursionrelations−→ improvement in speed of a factor of (Nz + 1)/3

AccuracyThe scaling relation will again help in the kernel

K (2µ; j) =12 ∑

jhjK (2µ,2i− j)

A “Free-Lunch” caseWe have the same advantages of the Free BC treatment withan explicit formalism conceived for surfaces BC

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 20: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Poisson Solver for surface boundary conditions

Elapsed Time on a Cray XT3, 1283 grid

#proc 1 2 4 8 16 32 64sec .43 .26 .16 .10 .07 .05 .04

More precise than other treatments

1e-16

1e-14

1e-12

1e-10

1e-08

1e-06

1e-04

0.01

0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5

Abs

olut

e re

lativ

e er

ror

grid spacing

Mortensen8th

16th24th40th

h8 curve

L. Genovese, T. Deutsch, S. Goedecker

J. Chem. Phys. 127, 054704 (2007)

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 21: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

A Poisson solver for surface problems

Like the Free BC caseWe developed a technique

4 Accurate and fast, easy to parallelize

4 Can be applied both in real or reciprocal space codes

4 Explicit treatment No supercell or screening functions

4 More precise than other existing approaches

4 Allows comparisons betweeen different backgrounds(charged systems)

Example of the plane capacitor:Periodic

x

y

V

x

Hockney

x

y

V

x

Our approach

x

y

V

x

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 22: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Flexibility: the Poisson Solver in BigDFT

Flexible Boundary ConditionsDirect approach(non-iterative)

Explicit, high precision

Clean and precise treatment of the electrostaticSeveral applications:

Impurities, dopants

Surface properties (adsorbtion, cathalysis)

Charged defects, in bulk or in surfaces

These Solvers can be used independently from BigDFT codeAlready integrated in other DFT codes (CP2K, ABINIT, OCTOPUS)

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese

Page 23: PoissonSolverswithInterpolatingScaling Functions ...bigdft.org/images/e/ef/Berlin-LG.pdfPoisson Solver with ISF DFT Hartree potential Poisson Solver Free BC Poisson Kernel Performances

PoissonSolver with

ISF

DFT HartreepotentialPoisson Solver

Free BCPoisson Kernel

Performances

Surfaces BCPerformances

Outlook

Summary and outlook

Interpolating SF can be use to solve the Poisson’s equation

∇2VH =−4πρ

with a Green’s function treatment, in different environements:

Isolated BC

VH(~j) =R

d~x ρ(~x)

|~x−~j|

Surfaces BC

Vpx ,pz (y) =Z

dy ′G(µpx pz ;y− y ′)ρpx ,pz (y ′)

From ρ(~j) on a uniform grid

Explicit treatment of the boundary conditions

Can be generalised to other environmentsWires BC

Spherical heterostructures (multipole expansion)

Laboratoire de Simulation Atomistique http://inac.cea.fr/L_Sim Luigi Genovese