wavelets for density functional calculations: four ... · • all xc functionals of the libxc...

36
Wavelets for density functional calculations: Four families and three applications Stefan Goedecker [email protected] http://comphys.unibas.ch/ • Haar wavelets • Daubechies wavelets: BigDFT code • Interpolating wavelets: Poisson solver and direct exchange library • Multi-wavelets: High accuracy atomization energies

Upload: others

Post on 07-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Wavelets for density functional

calculations: Four families and three

applications

Stefan Goedecker

[email protected]

http://comphys.unibas.ch/

• Haar wavelets

• Daubechies wavelets: BigDFT code

• Interpolating wavelets: Poisson solver and direct exchange library

• Multi-wavelets: High accuracy atomization energies

Page 2: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Wavelets: A family of relatively new mathematical basis sets withastonishing properties

All families share the properties:

• of being localized both in real and in Fourier space. This allows for the so-called

multi-resolution analysis that gives information about the localization properties

both in real and in Fourier space of a function (signal)

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-50 -40 -30 -20 -10 0 10 20 30

Page 3: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

• of being a systematic basis set, i.e the error is guaranteed to approach zero as the

basis set tends to infinity

• an arbitrary high degree of adaptivity can be obtained.

Page 4: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Wavelet basis functions

Each family is characterized by two functions. The mother scaling function ψ and the

mother wavelet φ. A basis set is generated by translations and dilatation-s of these two

functions

• j: Translation, Localization in real space

• k: Dilatation, Localization in Fourier space

ψkj(x) ∝ ψ(2kx− j)

φkj(x) ∝ φ(2kx− j)

Both the wavelet and the scaling function at a certain resolution level can be written as a

linear combination of scaling functions at a higher resolution level (refinement relations)

φ(x) =m

∑j=−m

h j φ(2x− j)

Page 5: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Haar wavelet ψ and scaling function φ

φ ψ

1 0

1

0

Scaling function representation

0 1x

φ4

f (x) = ∑j

s4j φ4

j(x)

Page 6: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Haar wavelet basis set

φ

ψ

ψ

ψ

ψ

0

1

2

3

4

Wavelet representation:

f (x) = s01φ0

1(x)+d01ψ0

1(x)+2

∑i=1

d1i ψ1

i (x)+4

∑i=1

d2i ψ2

i (x)+8

∑i=1

d3i ψ3

i (x) (1)

Page 7: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Operators in a wavelet basis: The standard form

3

2

1

0

D

D

D

DS 0

3

2

1

0

D

D

D

DS 0

b

*=

c A

• Coupling between different resolution levels

• Works fine for a limited number (two) of resolution levels.

• Complicated and numerically inefficient structure for a large number of resolution

levels

Page 8: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Operators in a wavelet basis: The non-standard operator form

SDS

0

D

S

D

S

D

0

1

1

2

3

3

2

b

*=

SDS

0

D

S

D

S

D

0

1

1

2

3

3

2

c A

• No coupling between different resolution levels

• For a small number of resolution levels larger prefactor than standard form

• Easy and numerically efficient structure if the transition region between the different

resolution levels is large compared to the support length of the wavelet

Page 9: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Daubechies wavelets

Ingrid Daubechies, 1988:

ORTHONORMAL BASES OF COMPACTLY SUPPORTED WAVELETS

Daubechies wavelet basis set combines advantages of

Plane waves:

• Systematic, orthogonal basis set

• Localization in Fourier space allows for efficient preconditioning techniques.

Gaussians:

• Localized in real space: well suited for molecules and other open structures, direct

way to linear scaling

• Adaptivity

Page 10: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Daubechies wavelet of order 4

-2

-1.5

-1

-0.5

0

0.5

1

1.5

-2 -1 0 1 2 3

DAUBECHIES-4 SCALING FUNCTION AND WAVELET

scaling functionwavelet

Even though the function is not very smooth polynomials up to degree 4 can be repre-

sented exactly

Page 11: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

High order Daubechies wavelets are used to represent wave functionsin BigDFT

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6

LEAST ASYMMETRIC DAUBECHIES-16

scaling functionwavelet

Polynomial up to degree 16 can be represented exactly: convergence rate h14

Page 12: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

BigDFT solves the many-electron Schrodinger equation in

the Kohn-Sham density functional approximation using a

Daubechies wavelet basis

• All boundary conditions

• All XC functionals of the LibXC library (LDA, GGA, hybrid functionals)

• Local geometry optimizations (with constraints)

• Saddle point searches

• Global geometry optimization: Minima Hopping

• Implicit solvation models (dielectric, electrolyte)

• linear scaling version

• Vibrations

• Born Oppenheimer MD

• collinear and non-collinear magnetism

• Empirical van der Waals terms

• High degree of parallelization and GPU acceleration: fast time to solution

Website: inac.cea.fr/L Sim/BigDFT/

Page 13: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Wavelet basis sets in three dimensions

1 scaling function

7 wavelets

all are products of 1-dim scaling functions and wavelets

φi, j,k(x,y,z) = φ(x− i)φ(y− j)φ(z− k)

ψ1i, j,k(x,y,z) = φ(x− i)φ(y− j)ψ(z− k)

ψ2i, j,k(x,y,z) = φ(x− i)ψ(y− j)φ(z− k)

ψ3i, j,k(x,y,z) = φ(x− i)ψ(y− j)ψ(z− k)

ψ4i, j,k(x,y,z) = ψ(x− i)φ(y− j)φ(z− k)

ψ5i, j,k(x,y,z) = ψ(x− i)φ(y− j)ψ(z− k)

ψ6i, j,k(x,y,z) = ψ(x− i)ψ(y− j)φ(z− k)

ψ7i, j,k(x,y,z) = ψ(x− i)ψ(y− j)ψ(z− k)

Page 14: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Pseudopotentials: two resolution levels are used in BigDFT

Page 15: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Kinetic energy matrix elements between scaling functions

ai =

∫φ(x)

∂2

∂x2φ(x− i)dx

Can be calculated exactly (Beylkin):

ai =∫

φ(x)∂2

∂x2φ(x− i)dx

= ∑ν,µ

2hνhµ

∫φ(2x−ν)

∂2

∂x2φ(2x−2i−µ)dx

= ∑ν,µ

2hνhµ22−1∫

φ(y−ν)∂2

∂y2φ(y−2i−µ)dy

= ∑ν,µ

hνhµ22∫

φ(y)∂2

∂ylφ(y−2i−µ+ν)dy

= ∑ν,µ

hνhµ 22 a2i−ν+µ

We thus have to find the eigenvector a associated with the eigenvalue of 2−2,

∑j

Ai, j a j =

(

1

2

)2

ai

Page 16: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

where the matrix Ai, j is given by

Ai, j = ∑ν,µ

hνhµ δ j,2i−ν+µ

Operator approach: Applying the kinetic energy operator results in a convolution with the

filter a

(KΨ)i = ∑j

Ψ jai− j

In the 3-dim case applying the kinetic energy operator requires a 3-dim convolution with

a filter that is a product of 3 1-dim filters. The operation count is 3 N1N2N3L where L is

the length of the filter.

Page 17: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Interpolating scaling functions: PSolver library of BigDFT for

solution of Poisson’s equation

• Compact support

• Many continuous derivatives for a given support length

• Trivial transformation from a real space data set to a scaling function expansion

• Not orthogonal

Page 18: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Construction of interpolating scaling functions

Recursive interpolation from Kronecker data set: Example linear interpolation

0 1 2 3-1-2-3

0

0.2

0.4

0.6

0.8

1

-6 -4 -2 0 2 4 6

’scf2’

Page 19: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

High order interpolating scaling functions represent charge densities

and potentials

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-10 -5 0 5 10

Interpolating scf 14Interpolating scf 100

Page 20: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Solution of Poisson’s equation for free boundary conditionsL. Genovese, T. Deutsch, A. Neelov, S. Goedecker, G. Beylkin, J. Chem. Phys. 125 (2006)

Given the values of the charge density on a regular grid, ρi, j,k, the continuous charge

distribution is represented in terms of interpolating scaling functions

ρ(r) = ∑i, j,k

ρi, j,kφ(x− i)φ(y− j)φ(z− k)

The moments of the discrete and continuous charge distributions ρi, j,k and ρ(r) are iden-

tical

∑i, j,k

il1 jl2 kl3 ρi, j,k =∫

dr xl1 yl2 zl3 ρ(r) (2)

if l1, l2, l3 < m, where m is the order of the scaling functions. The potential at a grid point

i1, i2, i3 is given by

Vi1,i2,i3 = ∑j1, j2, j3

ρ j1, j2, j3

∫φ(x′− j1)φ(y

′− j2)φ(z′− j3)

|r j1, j2, j3 − r′| dr′

= ∑j1, j2, j3

ρ j1, j2, j3 Ki1− j1,i2− j2,i3− j3

The above convolution can be calculated rapidly with Fourier methods

Page 21: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Boundary conditions

The Poisson equation is solved exactly for all boundary conditions

• free

• wire

• surface

• periodic

Highly accurate treatment of

• charged clusters

• dipolar surfaces

• clusters, surfaces in electric fields

Page 22: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Efficient and accurate hybrid functional calculations with the PSolver

package of BigDFT

The exact exchange energy Ex is given by

EX =N

∑i=1

N

∑j=i+1

∫ ∫dr dr′

ψ∗i (r)ψ j(r)ψ∗

i (r′)ψ j(r

′)|r− r′| (3)

For a system of N electrons it requires the solution of N(N − 1)/2 Poisson equations for

all pairwise charge densities ψ∗i (r

′)ψ j(r′

At greatly reduced cost hybrid functional calculations should become much more widespread

in systematic basis sets since:

• High accuracy can nearly be reached in atomization energies

• Materials that are problematic with other functionals such as transition metal oxides

can be well treated

• Gaps in solids are reasonably accurate

Page 23: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

A direct hybrid functional calculation is about two orders of magnitude more expen-

sive than a GGA calculation with all the state of the art plane wave codes

BigDFT gives extremely high speed in the expensive exact exchange energy part:

• Since only a few basic operations have to be performed in our scaling function basis,

all the computations are implemented in CUDA and are executed on the GPU

• Communication is overlapped with computation

• Direct GPU communication

Page 24: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Hybrid functional calculations possible up to 1000 atoms: Cray (Piz Daint) at CSCS

Page 25: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Exact ionic forces

In contrast to other approaches that gain speed by evaluating the exact exchange based on

localized orbitals, no cutoffs or other approximations are necessary and the forces are the

exact derivative of the energy. This leads for instance to a perfect energy conservation in

MD.

Page 26: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

PBE0 pseudopotentials are available and should be used in PBE0 calculations

XC used in calculation PBE PBE0 PBE0

XC of pseudopotential used PBE PBE PBE0

C2Hs2 416.35 399.38 405.79

CH3Cls 400.13 393.13 395.53

CH3OHs 518.58 505.43 508.56

CHs4 420.50 415.18 418.13

COs2 413.48 384.89 389.52

H2COs 385.02 368.52 371.66

H2Os 232.98 225.17 226.07

HOCls 174.07 161.60 162.71

OHd 109.20 104.74 105.14

Atomization energy of molecules in kcal/mol for consistent (PBE/PBE and PBE0/PBE0)

and inconsistent (PBE/PBE0) use of the exchange correlation functionals in the molec-

ular calculation and for the generation of the pseudopotential. Dual space Gaussian

pseudopotentials were used in the BigDFT code with free boundary conditions.

Page 27: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Overview: Poisson Solver package of BigDFT

• Solves the Poisson equation both for a constant and a spatially varying dielectric

constant as well as the Poisson Boltzmann equation to describe electrolytes

• all standard boundary conditions

• Input and output are given on equally spaced Cartesian grids. In the periodic case

both orthorombic and non-orthorombic cells can be treated

• The hybrid functional package is based on the Poisson solver package and the

LibXC library

Page 28: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Multi-wavelets: All electron calculations

• compact support

• several basis functions per support interval representable as polynomials

• orthogonal

• symmetric

• Continuous derivatives within interval, possibly discontinuities among neighboring

intervals (discontinuous Galerkin)

• Only integral equations can be solved

Page 29: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Solving Schrodingers equation in integral form

−1

2∇2Ψi(r)+V (r)Ψi(r) = εiΨi(r)

(

∇2 +2εi

)

Ψi(r) = 4π1

2πV (r)Ψi(r)

Helmholtz equation: The inverse operator of

∇2 +2εi

is ∫exp(−

√−2εi|r− r′|)

|r− r′| dr′

. Hence we obtain the following iteration scheme for the Kohn-Sham orbitals

Ψnewi (r) =

∫exp(−

√−2εi|r− r′|)

|r− r′| Ψoldi (r′)dr′

Page 30: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

MRChem

Frediani et al.: Real-space numerical grid methods in quantum chemistry, Phys. Chem.

Chem. Phys. 2015, 17, 31357

• Developed in the group of Luca Frediani in Norway by Stig Jensen et al

• Performs non-relativistic all-electron density functional calculations for LDA, GGA

and hybrid functionals by using multi-wavelets

• Allows for an arbitrary number of resolution levels and uses the non-standard oper-

ator form

• Any preset accuracy for the wave functions/energies can be obtained (if enough

memory/cores are available)

• Same underlying method as in MADNESS, highly stable implementation

• Program under development to include more features

Page 31: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Accuracy of DFT calculations

Nearly all codes use approximations that go beyond the XC functional: basis sets,

pseudopotentials

Kurt Lejaeghere et al.: Reproducibility in density functional theory calculations of solids,

Science 351, 6280 (2016)

• A large number of electronic structure codes give more or less identical results for

the energy versus volume curve

• For more difficult quantities significant disagreement between different codes can

still be found

Atomization energies with µHa accuracy obtained with MRChem fora test set of nearly 300 molecules:S. Jensen et al.: The Elephant in the Room of Density Functional Theory Calculations .

Phys. Chem. Lett., 2017, 8 (7), pp 14491457

• For codes with a systematic basis set the accuracy is only limited by the pseudopo-

tential or PAW scheme.

Page 32: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Basis set errors

Page 33: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Pseudopotential errors

Page 34: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

People involved in this work

• Basel: Bastian Schaefer, Augustin Degomme, Giuseppe Fisicaro, Santanu Saha,

Huan Tran, Alireza Ghasemi

• Grenoble: Luigi Genovese, Damien Caliste, Thierry Deutsch

• Arctic University of Norway: Stig Jensen, Luca Frediani

Page 35: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Selected Applications of BigDFTGeometric ground state of metal decorated boron clusters

Santanu Saha et al., accepted by Nature Scientific reports

Page 36: Wavelets for density functional calculations: Four ... · • All XC functionals of the LibXC library (LDA, GGA, hybrid functionals) • Local geometry optimizations (with constraints)

Selected Applications of BigDFTDisconnectivity graph for a 26 atom gold cluster

Au+26 Bastian Schaefer et al. ACS Nano, 8 7413 (2014)