38
1 X. Gonze Université Catholique de Louvain, Louvain-la-neuve, Belgium [email protected] Density Functional Theory : formalism and implementation CECAM Tutorial Electronic excitations and spectroscopies : Theory and Codes Lyon 2007 Density Functional Theory 2 Overview Introduction A. The electronic N-body problem B. Functionals of the density C. The Kohn & Sham approach D. Approximations to the exact Density Functional Theory E. The band gap problem F. The plane wave basis set G. Pseudopotentials H. Iterative algorithms I. ABINIT

Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

  • Upload
    vandan

  • View
    215

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

1

X. GonzeUniversité Catholique de Louvain,

Louvain-la-neuve, [email protected]

Density Functional Theory :formalism and implementation

CECAM TutorialElectronic excitations and spectroscopies :

Theory and CodesLyon 2007

Density Functional Theory 2

OverviewIntroduction

A. The electronic N-body problemB. Functionals of the densityC. The Kohn & Sham approachD. Approximations to the exact Density Functional TheoryE. The band gap problemF. The plane wave basis setG. PseudopotentialsH. Iterative algorithmsI. ABINIT

Page 2: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

2

Density Functional Theory 3

Milestones : first-principles approach

Precursor : Thomas-Fermi approximation (1927)

Inhomogeneous electron gasP. Hohenberg and W. Kohn, Phys. Rev. 136, B864 (1964)Self-consistent equations including exchange and correlation effectsW. Kohn and L. Sham, Phys. Rev. 140, A1133 (1965)

Ceperley, Alder (1980); Perdew, Zunger (1981) : computation andparametrization of the exchange and correlation energyneeded in the local density approximation

Density Functional Theory 4

Most cited papers

Papers published in APS journals (PRL, PRA, PRB, .. RMP),most cited by papers published in APS journals

Page 3: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

3

Density Functional Theory 5

A basic reference on DFTand applications to solids

Richard M. Martin

Cambridge University Press, 2004

Electronic Structure : Basic Theory andPractical Methods

(ISBN: 0521782856)

For details, see

http : //www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521782856

Density Functional Theory 6

Electronic N-body problemAfter the Born-Oppenheimer approximation :

- decoupling of the nuclei and electron dynamics- nuclei positions can be considered as fixed- effective Born-Oppenheimer potential energy hypersurface

Born-Oppenheimer energy

Potential created by the nuclei, felt by the N electrons

Schrödinger equation, very difficult to solve for more than 2 electrons

En

BORI{ }( ) = EI I

RI{ }( ) + En

elRI{ }( )

Vext(r) = !

ZI

r ! RII

"

!1

2"i

2+Vext ri( )

#$%

&'(+

1

ri ! rji< j

)i

)*

+,,

-

.//0n r1,r2,…,rN( ) = En

el 0n r1,r2,…,rN( )

Page 4: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

4

Density Functional Theory 7

A basic difference between classicaland quantum N-body systemsClassical objects : fields

or trajectoriesp(r,t),V (r,t),T (r,t),E(r,t),...

R1(t),R

2(t),R

3(t),...R

N(t)

Quantum objects : wavefunctions for interacting particles !(r

1,r2,r3,...,r

N,t)

Classical positions and velocities of 8planets : 2x3x8=48 real numbers.

Suppose an oxygen atom : 8 electrons.Quantum description at a particular time,on a discretized 10x10x10 realspace mesh contained in a cube...24-dimensional object 10 real numbers24

Density Functional Theory 8

Density-functional theory (DFT)Quantum objects : wavefunctions

for interacting particles

For the oxygen atom, back to8x10x10x10 real numbers,but with an approximatetreatment ...

DFT : set of wavefunctions for non-interacting particles

!1(r,t),!

2(r,t),...!

N(r,t)

Hohenberg & Kohn (1964), Kohn & Sham (1965) : Legendre transform between the density and potentialgives an effective potential for non-interacting particles

W. Kohn, chemistry Nobel prize 1998

!(r1,r2,r3,...,r

N,t)

Page 5: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

5

Density Functional Theory 9

First Hohenberg-Kohn theorem (I)The ground state density ρ(r) (usually written n(r) in DFT)of a many-electron system determines uniquely the external potential V(r), modulo one global constant.

Context : the set of many-body Hamiltonian that have the same kinetic energy but differ by their external potential V(r), a general one-body local potential

n(r) = N !*r ,r

2,r3,...r

N( )! r ,r2,r3,...r

N( )" dr2dr

3...dr

N

Advantages of working with the density :- dimensionality of the problem is reduced from 3N to 3- visualisation is easy- the density is an experimental observable

H V[ ] = T + Vint+ V

i

! (ri)

Density Functional Theory 10

First Hohenberg-Kohn theorem (II)Proof by reductio ad absurdum :

If two different (not simply by a global constant) potentials are considered,their ground states will have different densities.

Consequence : formally, the density can be considered as the fundamental variable of the formalism, instead of the potential

No need for wavefunctionsor Schrödinger equation !

Page 6: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

6

Density Functional Theory 11

First Hohenberg-Kohn theorem (III)The proof :

First, a lemma.Consider two local potentials V1(r) and V2(r). Their ground-state wavefunctions may or may not be degenerate, but one wavefunction ψ cannot be common to both, except if the potentials differ only by a shift, or are identical everywhere (except at points of zero density - these points forming a set of measure zero).Indeed, the difference between the corresponding Schrödinger equations would imply

V1(r

i) !V

2(r

i)[ ] + "E

i=1

N

#$%&'()* r

1,r2,...,r

N( ) = 0

for each many-dimensional point (=each configuration of electrons).Fixing the positions corresponding to the indices from 2 to N,one obtains that the difference between V1(r1) and V2(r1) must be a constant in space.

Density Functional Theory 12

First Hohenberg-Kohn theorem (IV)

E1= !

1HV1

!1

So, we define Ψ1 the (or one of the) ground-state wavefunction(s) of HV1, with associated charge density n1(r) and Ψ2 the (or one of the) ground-state wavefunction(s) of HV2, with associated charge density n2(r).

Due to the variational principle, E1= !

1HV1

!1

< !2HV1

!2

Here, a strict inequality holds, because Ψ2 cannot be one of the ground-statewavefunctions of HV1 (see previous slide) . The HV1 and HV2 Hamiltonians onlydiffer by their one-electron local potential, so that

!2HV1

!2= !

2HV2

!2+ !

2HV1" H

V2!

2

= !2HV2

!2+ V

1(r) "V

2(r)( )# n

2(r)dr

= E2+ V

1(r) "V

2(r)( )# n

2(r)dr

So that E1< E

2+ V

1(r) !V

2(r)( )" n

2(r)dr

E2= !

2HV2

!2

Page 7: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

7

Density Functional Theory 13

First Hohenberg-Kohn theorem (V)

By the same line of thought, interchanging 1 and 2, we get

Summing the two inequalities give 0 < V2(r) !V

1(r)( )" n

1(r) ! n

2(r)( )dr

Postulating n1(r) equal to n2(r) everywhere leads to 0 < 0 , which is obviously wrong.So, we have proven that the knowledge of the ground-state density defines the one-body local potential up to a constant. The one-body local potential is thus a functional of the ground-state density, as well as all the quantities that may be known formally once the potential is known up to a constant (like the set of ground-state wavefunctions).

If one fixes the shift in the potential through a simple condition (like "the external potential goes to zero at infinite distance"), the electronic energy is also a functional of the density. Indeed, the hamiltonian is uniquely defined by the specification of the external potential, and the electronic energy is its expectation value.

E1< E

2+ V

1(r) !V

2(r)( )" n

2(r)dr

E2< E

1+ V

2(r) !V

1(r)( )" n

1(r)dr

Density Functional Theory 14

The constrained-search approach to DFTM. Levy, Proc. Nat. Acad. Sci. USA, 76, 6062 (1979)

Use the extremal principle of QM.

EV= min

!

! HV!{ } = min

n

min!"n

! HV!{ }{ }

= minn

min!"n

! T + Vint+ V !{ }{ }

= minn

min!"n

! T + Vint

! + n(r)V (r)dr#{ }{ }

F n[ ] = min!"n

! T + Vint

!{ }

= minn

F n[ ] + n(r)V (r)dr!{ } = minn

EVn[ ]{ }

where is a universal functional of the density ... Not known explicitely !

Page 8: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

8

Density Functional Theory 15

The exchange-correlation energyF[n] : large part of the total energy, hard to approximate

Kohn & Sham (Phys. Rev. 140, A1133 (1965)) :mapping of the interacting system on a non-interacting system

If one considers a non-interacting electronic system :

Kinetic energy functional of the density

Exchange-correlation functional of the density :

Not known explicitely !But let’s suppose we know it

F n[ ] = min!"n

! T + Vint

!{ }

Tsn[ ] = min

!"n

! T !{ }

Excn[ ] = F n[ ]! Ts n[ ]!

1

2

n(r1)n(r

2)

r1- r

2

" dr1dr

2

Density Functional Theory 16

The Kohn-Sham potentialSo, we have to minimize: (under constraint of total electron number)

Introduction of Lagrange multipliers

If one considers the minimization for non-interacting electronsin a potential VKS(r), with the same density n(r), one gets

Identification :

The Kohn-Sham potential

EVn[ ] = Ts n[ ] + V (r)n(r)! dr +

1

2

n(r1)n(r

2)

r1- r

2

! dr1dr

2+ E

xcn[ ]

0 = ! EVn[ ]" # n(r)dr -N${ }( ) = !T

sn[ ]

!n+V (r) +

n(r1)

r1- r

$ dr1+!E

xcn[ ]

!n(r)" #

%

&'(

)*$ !n(r)dr

0 =!T

sn[ ]

!n+V

KS(r) " #

$%&

'()* !n(r)dr

VKS(r) = V (r) +

n(r1)

r1- r

! dr1+"E

xcn[ ]

"n(r)

Page 9: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

9

Density Functional Theory 17

VKS(r) = V

ext(r) +

n(r1)

r1- r

! dr1+"E

xcn[ ]

"n(r)

The Kohn-Sham orbitals and eigenvaluesNon-interacting electrons in the Kohn-Sham potential :

Hartree potential Exchange-correlation potential

Density

To be solved self-consistently !

Note : by construction, at self-consistency, and supposing the exchange-correlation functional to be exact, the density will be the exact density, thetotal energy will be the exact one, but Kohn-Sham wavefunctions andeigenenergies correspond to a fictitious set of independent electrons, so theydo not correspond to any exact quantity.

!1

2"2

+VKS(r)

#$%

&'()

i(r) = *

i)

i(r)

n(r) = !i

*(r)!

i(r)

i

"

Density Functional Theory 18

Minimum principle for the energy

Using the variational principle for non-interacting electrons,one can show that the solution of the Kohn-Sham self-consistentsystem of equations is equivalent to the minimisation of

under constraints of orthonormalization for the occupied orbitals.

EKS

!i{ }"# $% = !

i&1

2'2 !

i

i

( + Vext(r)n(r)) dr +

1

2

n(r1)n(r

2)

r1- r

2

) dr1dr

2+ E

xcn[ ]

!i!

j= "

ij

Page 10: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

10

Density Functional Theory :approximations

Density Functional Theory 20

An exact result for the exchange-correlation energy(without demonstration)The exchange-correlation energy, functional of the densityis the integral over the whole space of the density times the local exchange-correlation energy per particle

while the local exchange-correlation energy per particle is theelectrostatic interaction energy of a particle with its DFTexchange-correlation hole.

Sum rule :

Excn[ ] = n(r

1)!

xc(r1;n)" dr

1

!xc(r1;n)=

1

2

nxc(r2r1;n)

r1" r

2

# dr2

nxc(r2r1;n)! dr

2= "1

Page 11: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

11

Density Functional Theory 21

The local density approximation (I)Hypothesis :- the local XC energy per particle only depend on the local density- and is equal to the local XC energy per particle of an

homogeneous electron gas of same density (in a neutralizing background - « jellium » )

!xcLDA(r1; n ) = !xc

hom( n(r1) )

Gives excellent numerical results ! Why ?

1) Sum rule is fulfilled

2) Characteristic screening length indeed depend on local density

Density Functional Theory 22

The local density approximation (II)Actual function : exchange part + correlation part

with

for the correlation part, one resorts to accuratenumerical simulations beyond DFT (e.g. Quantum Monte Carlo)

Corresponding exchange-correlation potential

!x

hom(n) = Cn

1/3C = !

3

4"3"

2( )1/3

µx(n) = C

4

3n1/3

=4

3!x

hom(n)

Vxc(r) =

!Excn[ ]

!n(r)

Vxcapprox

(r) = µxc n(r)( ) µxc(n) =

d n!xc

approx(n)( )

dn

Page 12: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

12

Density Functional Theory 23

The local density approximation (III)To summarize :

or

and

ELDA

n[ ] = Ts n[ ] + Vext(r)n(r)! dr +

1

2

n(r1)n(r

2)

r1- r

2

! dr1dr

2+ E

xc

LDAn[ ]

ELDA !

i{ }"# $% = !i&

1

2'2 !

i

i

( + Vext

(r)n(r)) dr +1

2

n(r1)n(r

2)

r1

- r2

) dr1dr

2

+ n(r1)*

xc

LDA(n(r

1))) dr

1

VKS

LDA(r) = V

ext(r) +

n(r1)

r1- r

! dr1+ µ

xc

hom(n(r))

Density Functional Theory 24

Beyond the local density approximation

Generalized gradient approximations (GGA)

No model system like the homogeneous electron gas !Many different proposals, including one from Perdew,Burke and Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996),often abbreviated « PBE ».Others : PW86, PW91, LYP ...

Also : « hybrid » functionals (B3LYP), « exact exchange » functional,« self-interaction corrected » functionals ...

Excapprox

n[ ] = n(r1)!xcapprox (n(r1), "n(r1) ,"

2n(r1))# dr1

Page 13: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

13

The DFT bandgap problem (I)

• DFT is a ground state theory⇒ no direct interpretation of Kohn-Sham eigenenergies εi in

• However {εi } are similar to quasi-particle band structure : LDA / GGA results for valence bands are accurate ... but

NOT for the band gap

• The band gap can alternatively be obtained from total energy differences

in the limit N → ∞(where E(N) is the total energy of the N - electron system)

EgKS

= !c - !v

Eg = E(N+1) + E(N-1) - 2 E(N) = E(N+1) - E(N){ } - E(N) - E(N-1){ }[ correct expression ! ]

!1

2"2

+Vext(r) +

n(r1)

r1- r

# dr1+V

xc(r)

$

%&'

()*

i(r) = +

i*

i(r)

Density Functional Theory 26

The DFT bandgap problem (II)

• For LDA & GGA, the XC potential is a continuous functional ofthe number of electrons

• In general, the XC potential might be discontinuous with the number of particle

!i = "E

"fi [Janak's theorem]

# EgKS

= !c - !v N$%

= Eg= E(N+1) + E(N-1) - 2E(N)

e.g. xOEP EgKS

! Eg

N electrons N+1 electrons

ΔVxcεc- εv

!c - !v = EgKS

Page 14: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

14

Density Functional Theory 27

The DFT bandgap problem (III)

Comparison of LDA and GW bandStructures with photoemission andInverse photoemission experiments for Silicon.

From "Quasiparticle calculations in solids", by Aulbur WG, Jonsson L, Wilkins JW, in Solid State Physics 54, 1-218 (2000)

Density Functional Theory 28

An example : Zircon / Hafnon

• body-centered tetragonal (I41/amd)

• primitive cell with 2 formula units of MSiO4

• M atoms → (0,3/4,1/8) Si atoms → (0,1/4,3/8) O atoms → (0,u,v)

• in the MO8 units, four O atoms are closer to the Zr atoms than the four other ones• O atoms are 3-fold coordinated

• (SiO4)4- anions and M4+ cations• alternating SiO4 tetrahedra and MO8 units, sharing edges to form chains parallel to [0 0 1]

Page 15: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

15

Density Functional Theory 29

Structural parameters

Interatomic distances and angles are within 1 or 2% of experimental values.

(From GM Rignanese)

Density Functional Theory 30

Phonon frequencies at the zone center

(From GM Rignanese)

Page 16: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

16

The plane wave basis set

Density Functional Theory 32

Prerequisites of plane waves

eiKrPlane wave with infinite spatial extent.

One cannot use a finite set of planewaves for finite systems !Need periodic boundary conditions (supercell approach for finite systems).

!m,k

(r+Nia

i) = !

m,k (r)

For a periodic Hamiltonian : wavevector (crystal momentum), Bloch’s theorem

k

!m,k

(r) = N"0( )

-1/2 e

ik.ru

m,k (r) u

m,k (r+a

i)=u

m,k (r)

Born-von Karman supercell

!m,k

(r+ai) = e

ik.ai!m,k

(r)

supercell vectors Niai with N=N1N2N3

Primitive vectors ai , primitive cell volume !0

Page 17: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

17

Density Functional Theory 33

Plane wave representation of wavefunctions

uk(r) = u

k(G)

G

! eiGr

!k(r) = N"

0( )-1/2

uk (G)

G

# ei(k+G)r

Kinetic energy of a plane wave !"2

2#(k+G)

2

2

The coefficients for the lowest eigenvectorsdecrease exponentially with the kinetic energy

uk(G)

k +G( )2

2

Selection of plane waves determined by a cut-off energy Ecut

k +G( )

2

2

< Ecut Plane wave sphere

! Discontinuous increase of the number of the plane waves Npw

uk(G) =

1

!o

e-iGr

!o" u

k(r) dr (Fourier transform)

Reciprocal space lattice : G such that eiGris periodic

Density Functional Theory 34

Simplicity of PW basis, but need for pseudopotentials

The Fourier transform theory teaches us :- details in real space are described if their characteristic length is larger than the inverse of the largest wavevector norm (roughly speaking)- quality of a plane wave basis set can be systematically increased by increasing the cut-off energy

Problem : huge number of PWs is required to describe localizedfeatures (core orbitals, oscillations of other orbitals close to the nucleus)

Pseudopotentials (or, in general, « pseudization »)to eliminate the undesirable small wavelength features

Page 18: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

18

Pseudopotentials

Density Functional Theory 36

Core and valence electrons (I)

Core electrons occupy orbitals that are « the same » in the atomic environment or in the bonding environment

It depends on the accuracy of the calculation !

Separation between core and valence orbitals : the density...

« Frozen core »

n(r) = !i

*(r)!

i(r)

i

N

"

= !i

*(r)!

i(r)

i#core

Ncore

" + !i

*(r)!

i(r)

i#val

Nval

" = ncore

(r) + nval

(r)

for i !core : "i="

i

atom

Page 19: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

19

Density Functional Theory 37

Small core / Large core

(remark also valid for pseudopotentials, with similar cores)It depends on the target accuracy of the calculation !

For some elements, the core/valence partitioning is obvious,for some others, it is not.

F atom :

1s( )2

+ 2s( )2

2p( )5

1s( )2

2s( )2

2p( )6

3s( )2

3p( )6

4s( )2

3d( )2

Ti atom :

Gd atom : small core with n=1,2,3 shells , might include 4s, 4p, and 4d in the core. 4f partially filled�

1s( )2

2s( )2

2p( )6

3s( )2

3p( )6

4s( )2

3d( )2

small core

large core

IP 1keV 10-100 eV

IP 99.2 eV 43.3eV

Density Functional Theory 38

Core and valence electrons (II)

Separation between core and valence orbitals : the energy ...

One needs an expression for the energy of the valence electrons ...

EKS

!i{ }"# $% = !

i&1

2'2 !

i

i

( + Vext(r)n(r)) dr +

1

2

n(r1)n(r

2)

r1- r

2

) dr1dr

2+ E

xcn[ ]

EKS

!i{ }"# $% = !

i&

1

2'2 !

i

i(core

Ncore

) + Vext

(r)ncore

(r)* dr +1

2

ncore

(r1)n

core(r

2)

r1

- r2

* dr1dr

2

+ !i&

1

2'2 !

i

i(val

Nval

) + Vext

(r)nval

(r)* dr +1

2

nval

(r1)n

val(r

2)

r1

- r2

* dr1dr

2

+nval

(r1)n

core(r

2)

r1

- r2

* dr1dr

2+ E

xcncore

+ nval[ ]

Page 20: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

20

Density Functional Theory 39

Valence electrons in a screened potential

The potential of the nuclei κ is screened by the core electrons

The total energy becomes

with Non-linear XCcore correction

Vion,! (r) = "

Z!

r " R!

+ncore,! (r1)

r - r1

# dr1

Vion,! (r) = "

Zval ,!

r " R!

+ "Zcore,!

r " R!

+ncore,! (r1)

r - r1

# dr1

$

%&'

()

E = Eval

+ Ecore,!

!"#

$%&'(+1

2

Zval ,!Zval ,! '

R! ) R! '(! ,! ')! *! '

"

Eval,KS !i{ }"# $% = !

i&

1

2'2 !

i

i(val

Nval

) + Vion,* (r)

*)+,-

./0nval

(r)1 dr

+1

2

nval

(r1)nval

(r2 )

r1 - r2

1 dr1dr2 + Exc ncore + nval[ ]

Density Functional Theory 40

Removing core electrons (I)

From the previous construction : valence orbitals must still be orthogonal to core orbitals( => oscillations, slope at the nucleus ...)

Pseudopotentials try to remove completely the core orbitalsfrom the simulation

Problem with the number of nodes This is a strong modification of the system ...

Pseudopotentials confine the strong changes within a « cut-off radius »

Page 21: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

21

Density Functional Theory 41

Removing core electrons (II)

1

2!2

+ v "#i > = $i "#i >Going from

To

– 12!2 + vps

"#ps,i > = $ps,i " #ps, i >

Possible set of conditions (norm-conserving pseudopotentials) :

!i = !ps,i

!i(r) = !ps,i(r) for r > rc

!i(r)

2dr

r < rc

= !ps,i(r)2

drr < rc

Hamann D.R., Schluter M., Chiang C, Phys.Rev.Lett. 43, 1494 (1979)

Density Functional Theory 42

Forms of pseudopotentials

Must be a linear, hermitian operator

General form :

Spherically symmetric !

Non-local part

Semi-local pspsee the paper by Bachelet, Hamann and Schlüter, Phys.Rev.B 26, 4199 (1982)

Separable pspKleinman L., Bylander D.M., Phys.Rev.Lett. 48, 1425 (1982)

Vps!( )(r) = V

ps

kernel" (r,r')! (r')dr'

Vps

kernel(r,r') = Vloc (r)! (r-r') +Vnloc (r,r')

Vnloc(r,r') =

!m

! Y!m

* ",#( )V!(r,r ')Y

!m" ',# '( )

V!(r,r ') = V

!(r)! (r " r ')

V!(r,r ') = !

!

*(r) f

!!!(r ')

Page 22: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

22

Density Functional Theory 43

VPS

(R) (

Ha)

0

-1

-2

-3

-4

-5

Radial distance (atomic units)0 1 2 3

Am

plitu

de

0 2 4

1.0

0.5

0

-0.5

Radial distance (atomic units)

3s Radial wave function of Si

Pseudo-wavefunctionAll-electron

wave function

sp

d !Zv

r

Density Functional Theory 44

Norm-conserving pseudopotentials and beyond

Tables of pseudopotentials (LDA only):

BHS - Bachelet, Hamann, Schluter, PRB 26, 4199 (1982)HGH - Hartwigsen, Goedecker, Hutter, PRB 58, 3641 (1998)

Programs to generate pseudopotentials :

OPIUM http://opium.sourceforge.netFHI98PP http://www.FHI-Berlin.MPG.DE/th/fhi98md/fhi98PPTroullier-Martins http://bohr.inesc.pt/~jlm/pseudo.html

Ultra-soft pseudopotentials - Vanderbilt, PRB41, 7892 (1990) Projector-augmented Waves (PAW) - P. Blöchl, PRB50, 17953 (1994)

Page 23: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

23

Analysis of simple iterativealgorithms

Algorithmics : problems to be solved

(1) Kohn - Sham equation

Representation of V and ψi : real space , planewaves , localised functions ..

Size of the system [2 atoms… 600 atoms…] + vacuum ?Dimension of the vectors 300… 100 000… (if planewaves)# of (occupied) eigenvectors 4… 1200…

(2) Self-consistency

(3) Geometry optimizationFind the positions of ions such that the forces vanish

[ = Minimization of energy ]

Current practice : iterative approaches

!1

2"2

+VKS(r)

#$%

&'()

i(r) = *

i)

i(r)

rj{ } G j{ }

A xi

= !ixi

xi

VKS(r) !

i(r)

n(r)

R!{ } F

!{ }

Page 24: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

24

Density Functional Theory 47

Energy and forces close to the equilibrium geometry

Analysis of forces close to the equilibrium geometry, at which forces vanish,thanks to a Taylor expansion :

Moreover,

Vector and matrix notation

Let us denote the equilibrium geometry as

R! ,"

*

R! ,"

*#R

*

R! ," #R

F! ," # F

!2EBO

!R" ,#!R" ',# ' R" ,#

*{ }

$H

!F" ',# '

!R" ,#

= $!2EBO

!R" ,#!R" ',# '

F! ," = #

$EBO

$R! ,"

(the Hessian)

F! ," (R! '," ' ) = F! ," (R! '," '

*) +

#F! ,"

#R! '," '! '," '

$R*{ }

R! '," ' %R! '," '

*( ) +O R! '," ' %R! '," '

*( )2

Density Functional Theory 48

The ‘steepest-descent’ algorithm (I)

=> Iterative algorithm. Choose a starting geometry, then a parameter , and iterately update thegeometry, following the forces :

Forces are gradients of the energy : moving the atomsalong gradients is the steepest descent of the energy surface.

!

Analysis of this algorithm, in the linear regime :

Equivalent to the simple mixing algorithm of SCF (see later)

R! ,"

(n+1)= R

! ,"

(n)+ #F

! ,"

(n)

F(R) = F(R*) !H R !R

*( ) +O R !R*( )2

R(n+1)

= R(n)

+ !F(n)

R(n+1)

!R*( ) = R

(n)!R

*( )! "H R(n)!R

*( )

R(n+1)

!R*( ) = 1! "H( ) R

(n)!R

*( )

Page 25: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

25

Density Functional Theory 49

The ‘steepest-descent’ algorithm (II)

Need to understand the action of the matrix (or operator)

For convergence of the iterative procedure, the"distance" between the trial geometry and the equilibriumgeometry must decrease. 1) Can we predict conditions for convergence ?2) Can we make convergence faster ?

R(n+1)

!R*( ) = 1! "H( ) R

(n)!R

*( )

1! "H

Density Functional Theory 50

The ‘steepest-descent’ algorithm (III)What are the eigenvectors and eigenvalues of ?

Yes ! If λ positive, sufficiently small ...

symmetric, positive definite matrix

The coefficient of is multiplied by 1- λ hi

positive definite => all hi are positiveIs it possible to have |1- λ hi| < 1 , for all eigenvalues ?

H

H

=! 2EBO

!R" ,#!R" ',# ' R" ,#*{ }

$

%

& &

'

(

) )

Hf i = hif i

where f i{ } form a complete, orthonormal, basis set

Thus the discrepancy can be decomposed as

R(n)!R

*( ) = ci(n)

i

" f i

R(n+1)

!R*( ) = 1! "H( ) ci

(n)

i

# f i = ci(n)

i

# 1! "hi( )f i

H

and

f i

Iteratively :

R(n)!R

*( ) = ci(0)

i

" 1! #hi( )(n)f i

The size of the discrepancy decreases if |1- λ hi| < 1

Page 26: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

26

Density Functional Theory 51

The ‘steepest-descent’ algorithm (IV)

The maximum of all |1- λ hi| should be as small as possible.At the optimal value of λ, what will be the convergence rate µ ? ( = by which factor is reduced the worst component of ? )

How to determine the optimal value of λ ?

As an exercise : suppose h1 = 0.2h2 = 1.0h3 = 5.0

=> what is the best value of λ ?

+ what is the convergence rate µ ?

R(n)!R

*( ) = ci(0)

i

" 1! #hi( )(n)f i

R(n)!R

*( )

Hint : draw the three functions |1- λ hi| as a function of λ. Then, findthe location of λ where the largest of the three curves is the smallest. Find the coordinates of this point.

Density Functional Theory 52

The ‘steepest-descent’ algorithm (V)Minimise the maximum of |1- λ hi|

h1 = 0.2 |1- λ .0.2| optimum => λ = 5h2 = 1.0 |1- λ . 1 | optimum => λ = 1h3 = 5.0 |1- λ . 5 | optimum => λ = 0.2

?

0.2 1

1

h3h2

h1

λ

optimum µ = |1- λ 0.2| = |1- λ 5|

1- λ. 0.2 = -( 1- λ .5)

2 - λ (0.2+5)=0 => λ = 2/5.2

µ = 1 − 2. (0.2 / 5.2)

positive negative

Only ~ 8% decrease of the error, per iteration ! Hundreds of iterations will beneeded to reach a reduction of the error by 1000 or more.

Note : the second eigenvalue does not play any role.The convergence is limited by the extremal eigenvalues : if the parameter is toolarge, the smallest eigenvalue will cause divergence, but for that smallparameter, the largest eigenvalue lead to slow decrease of the error...

Page 27: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

27

Density Functional Theory 53

The condition numberIn general, λopt = 2 / (hmin + hmax)

µopt = 2 / [1+ (hmax/hmin)] - 1 = [(hmax/hmin) -1] / [(hmax/hmin) +1]

Perfect if hmax = hmin . Bad if hmax >> hmin .hmax/hmin called the "condition" number. A problem is "ill-conditioned" if thecondition number is large. It does not depend on the intermediate eigenvalues.

Suppose we start from a configuration with forces on the order of 1 Ha/Bohr, andwe want to reach the target 1e-4 Ha/Bohr. The mixing parameter is optimal.How many iterations are needed ?Let us work this out for a generic decrease factor Δ , with "n" the number of iterations.

F(n) ! hmax hmin "1

hmax hmin +1

#

$ %

&

' (

n

F(0)

! " hmax

hmin

#1hmax

hmin

+1

$

% &

'

( )

n

n ! lnhmax

hmin

+1

hmax

hmin

"1

#

$ %

&

' (

)

* +

,

- .

"1

ln/ ! 0.5 hmax

hmin( )ln

1

/

(The latter approximate equality suppose a large condition number)

Density Functional Theory 54

Analysis of self-consistency

Natural iterative methodology (KS : in => out) :

Which quantity plays the role of a force, that should vanish at the solution ?The difference (generic name : a "residual")

Simple mixing algorithm ( ≈ steepest - descent )

Analysis ...

Like the steepest-descent algorithm, this leads to the requirement tominimize |1- λ hi| where hi are eigenvalues of

(actually, the dielectric matrix)

VKS(r) !

i(r)

n(r)Vin(r)!"

i(r)! n(r)!V

out(r)

Vout(r) !V

in(r)

vin(n+1)

= vin(n)+! vout

(n)" vin

(n)( )

vout v in[ ] = vout v*[ ] +

!vout

!vin

v in " v*( )

H

!vout

!vin

Page 28: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

28

Density Functional Theory 55

How to do a better job ?

The residual vector is the nul vector at convergence in all three case.

Simple mixingSteepest descent very primitive algorithmsPuissance + schift

The information about previous iterations is completely ignoredWe already know several vector/residual pairs We should try to use them !

1) Taking advantage of the history

2) Decreasing the condition number

v(n)! v

(n+1)

v(n)

, r(n )( )

R! F

vin ! vout " vin

!T "# = !T ˆ H !T

R = ˆ H - #( ) !T

$

% &

' &

Density Functional Theory 56

Minimisation of the residual (I)

An excellent strategy is select the sp such as to minimize the norm of the residual (RMM =residual minimisation method - Pulay). Then one mixes part ofthe predicted residual to the predicted vector.

Suppose we knowthat

We try to find the best v that can be obtained by combining the latestone with its differences with other v(p) . This is equivalent to considering

What is the residual associated with v , if we make a linear approximation ?

⇒ The new residual is a linear combination of the old ones, with the same coefficients as those of the potential.

gives for p=1, 2 ... n

with�

v(p)

r(p)

v = spv(p)

p=1

n

!

1= spp=1

n

! (like a normalisation)

r = H v-v*( ) = H spv

(p)

p=1

n

! " spp=1

n

!#

$%&

'(v*

#

$%

&

'(

= sp v(p) ! v*( )

p=1

n

"#

$

% %

&

'

( (

= spH v(p) ! v*( )

p=1

n

" = spr(p)

p=1

n

"

Page 29: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

29

Density Functional Theory 57

Minimisation of the residual (II)

Characteristics of the RMM method :(1) it takes advantage of the whole history(2) it makes a linear hypothesis(3) one needs to store all previous vectors and residuals(4) it does not modify the condition number

Point (3) : memory problem if all wavefunctions are concerned, and the basis set is large (plane waves, or discretized grids). Might sometimes also be a problem for potential-residual pairs, represented on grids, especially for a large number of iterations. No problem of memory for geometries and forces.

Simplified RMM method : Anderson's method, where onlytwo previous pairs are kept.

(D.G. Anderson, J. Assoc. Comput. Mach. 12, 547 (1964))

Density Functional Theory 58

Modifying the condition number (I)

Back to the optimization of geometry, with the linearizedrelation between forces, hessian and nuclei configuration :

F(R) = -H R -R*( )

Steepest-descent :

giving

Now, suppose an approximate inverse Hessian

H-1( )

approx

Then, applying

H-1( )

approxon the forces, and moving the nuclei

along these modified forces gives

R(n+1)

= R(n)+! H

-1( )approx

F(n)

The difference between trial configuration and equilibrium configuration,in the linear approximation, behaves like

R(n +1)

- R*( ) = 1 - ! H

-1( )approx

H"

# $

%

& ' R

(n)- R

*( )

R(n+1)

= R(n)

+ !F(n)

R(n+1)

!R*( ) = 1! "H( ) R

(n)!R

*( )

Page 30: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

30

Density Functional Theory 59

Modifying the condition number (II)

F(R) = -H R -R*( )

R(n+1)

= R(n)+! H

-1( )approx

F(n)

R(n +1)

- R*( ) = 1 - ! H

-1( )approx

H"

# $

%

& ' R

(n)- R

*( )Notes : 1) If the approximate inverse Hessian is perfect, the optimal

geometry is reached in one step, with λ =1. Thus the steepest-descent is NOT the best direction in general.

2) Non-linear effects are not taken into account. For geometryoptimization, they might be quite large. Even with theperfect hessian, one needs 5-6 steps to optimize a water molecule.3) Approximating the inverse hessian by a multipleof the unit matrix is equivalent to changing the λ value.4) Eigenvalues and eigenvectors ofwill govern the convergence : the condition number can be changed. is often called a "pre-conditioner".5) Generalisation to other optimization problems is trivial. (The Hessianis referred to as the Jacobian if it is not symmetric.)

H-1( )

approxH

H-1( )

approx

Density Functional Theory 60

Modifying the condition number (III)

Selfconsistent determination of the Kohn-Sham potential :

The jacobian is the dielectric matrix. Lowest eigenvalue close to 1 usually. Largest eigenvalue for small close-shell molecules, and small unit cell solids, is 1.5 ... 2.5 . (Simple mixing will sometimes converge with parameter set to 1 !) For larger close-shell molecules and large unit cell insulators, the largest eigenvalue is on the order of the macroscopic dielectric constant (e.g. 12 for silicon). For large-unit cell metals, or open-shell molecules the largest eigenvalue might diverge !

Model dielectric matrices are known for rather homogeneous systems. With knowledge of the approximate macroscopic dielectric constant,preconditioners can be made very efficient. Work is still in progressfor inhomogeneous systems (e.g. metals/vacuum systems).

The approximate Hessian can be generated on a case-by-case basis.

Page 31: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

31

Density Functional Theory 61

Modifying the condition number (V)

The approximate Hessian can be further improved by using the history.

Large class of methods : - Broyden (quasi-Newton-type), - Davidson, - conjugate gradients, - Lanczos ... (although the three latter methods are not often presented in this way !).

ABINIT in brief

Page 32: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

32

Density Functional Theory 63

ABINIT in brief (I)ABINIT package :

Total energy/charge density/electronic structure/forces of periodic solids andmolecules (supercell geometry)

Density functional theory / Time-Dependent DFT / Many-body perturbationtheory (GW)

Pseudopotentials/Plane Waves - Projector Augmented Waves - Wavelets Geometry optimization / dynamics Linear responses, non-linear responses (phonons, homogeneous electric field,

stresses) written mostly in F90 different utilities, automatic tests, documentation, tutorial ...

+ Web site, mailing lists, software repository

Density Functional Theory 64

ABINIT in brief (II)Chronology :

Precursor : the Corning PW code (commercialized 1992-1995 by Biosym) 1997 : beginning of the ABINIT project Dec 2000 : release of ABINITv3 under the GNU General Public License (GPL) Nov 2002 : 1st int. ABINIT developer workshop - 40 participants May 2004 : 2nd int. ABINIT developer workshop Aug 2005 : Summer School Santa Barbara - 45 students + 18 instructors Dec 2006 : CECAM school “Electronic excitations” - 30 students Jan 2007 : 3rd int. ABINIT developer workshop As of Nov 2007 : about 1250 addresses in the main mailing list, and about 30

registered developers on the repository

Page 33: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

33

ABINIT :a "free" or "open source" package

Density Functional Theory 66

The “Free” or “Open Source” software concept

Free for freedom, not price freedom 1 : unlimited use for any purpose freedom 2 : study and modify for your needs (need source access !) freedom 3 : copy freedom 4 : distribute modifications

From copyright to freedom (“copyleft”) copyright allows licensing licenses grants freedom

Terminology : Free software=Open source=Libre software

Page 34: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

34

Density Functional Theory 67

Free software licences ...Many types

GNU General Public Licence GNU Lesser General Public License (links are possible) BSD licence X11 license, Perl license, Python license... public domain release

GNU General Public License (GPL)“The licences for most softwares are designed to take away your freedom to share and

change it. By contrast, the GNU GPL is intended to guarantee your freedom toshare and change free software - to make sure the software is free for all its users”(http://www.gnu.org/copyleft/gpl.html) grants four freedoms protection of freedom « vaccination »

ABINIT :Capabilities

Page 35: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

35

Density Functional Theory 69

ABINIT v5.5 capabilities (I)Methodologies

Pseudopotentials/Plane Waves+ Projector Augmented Waves (for selected capabilities)

Many pseudopotential types, different PAW generators+ Wavelets (BIGDFT effort)

Density functionals : LDA, GGA (PBE and variations, HCTH),LDA+U (or GGA+U)+ some advanced functionals (exact exchange + RPA or ...)

LR-TDDFT for finite systems excitation energies (Casida)GW for accurate electronic eigenenergies

(4 plasmon pole models or contour integration ; non-self-consistent / partly self-consistent /quasiparticle self-consistent ; spin-polarized)

Density Functional Theory 70

ABINIT v5.5 capabilities (II)Insulators/metals - smearings : Fermi, Gaussian, Gauss-Hermite ...Collinear spin / non-collinear spin / spin-orbit coupling

Forces, stresses, automatic optimisation of atomic positions and unit cellparameters (Broyden and Molecular dynamics with damping)

Molecular dynamics (Verlet or Numerov), Nosé thermostat, Langevindynamics

Susceptibility matrix by sum over states (Adler-Wiser)Optical (linear + non-linear) spectra by sum over states

Electric field gradients

Symmetry analyser (database of the 230 spatial groups and the 1191Shubnikov magnetic groups)

Page 36: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

36

Density Functional Theory 71

ABINIT v5.5 capabilities (III)Density-Functional Perturbation Theory :

Responses to atomic displacements, to static homogeneouselectric field, to strain perturbations

Second-order derivatives of the energy, giving direct access to :dynamical matrices at any q, phonon frequencies, force constants ;

phonon DOS, thermodynamic properties (quasi-harmonic approximation) ;dielectric tensor, Born effective charges ;elastic constants, internal strain ;piezoelectric tensor ...

Matrix elements, giving direct access to :electron-phonon coupling, deformation potentials, superconductivity

Non-linear responses thanks to the 2n+1 theorem - at present :non-linear dielectric susceptibility; Raman cross-section ;electro-optic tensor

ABINIT :structure

Page 37: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

37

Density Functional Theory 73

ABINIT : the pipeline and the driver

Parser

Checks, prediction of memory needs ...

DRIVER

Summary of results

CPU/Wall clock time analysis

Density, forces,MD, TDDFT ...

Linear Responses to atomic displacementelectric field

Non-linear responses

GW computation ofband structure

Treatment of each dataset in turn

Processing units

Density Functional Theory 74

Stages in the main processing unit

(1) gstate.f

(3) scfcv.f

(4) vtorho.f

(5) vtowfk.f

(6) cgwf.f

(7) getghc.f

(2) moldyn.f

Ground-state

Molecular dynamics

Self-consistent field convergence

From a potential (v) to a density (rho)

From a potential (v) to a wavefunction at some k-point Conjugate-gradient on one wavefunction

Get the application of the Hamiltonian

Page 38: Density Functional Theory : formalism and implementation : 2x3x8=48 real numbers. Suppose an oxygen atom : 8 electrons. Quantum description at a particular time, on a discretized 10x10x10

38

Density Functional Theory 75

External files in a ABINIT run

Filenames

ABINITMain input

Pseudopotentials

(previous results)

« log »

Main output

(other results)

Results : density (_DEN), potential (_POT), wavefunctions (_WFK), ...

Density Functional Theory 76

Sources and binariesNumbering of version : x.y.z e.g. 5.2.3

Major version number(change each other year)

Minor version number(new capabilities,change every three months)

Debug status number(change during the life of aminor version number)

Life of a minor version (usually one year) :

tests availability for developers production

robustvery robustobsolete

Usually, three « active » minor versions at all time.