Quick viewing(Text Mode)

VASP: Basics (DFT, PW, PAW, … )

VASP: Basics (DFT, PW, PAW, … )

VASP: Basics (DFT, PW, PAW, … )

University of Vienna, Faculty of and Center for Computational Materials Science, Vienna, Austria Outline

● Density functional theory

● Translational invariance and periodic boundary conditions

● Plane wave

● The Projector-Augmented-Wave method

● Electronic minimization The Many-Body Schrödinger equation

Hˆ (r1,...,rN )=E (r1,...,rN )

1 1 i + V (ri)+ (r1,...,rN )=E (r1,...,rN ) 02 ri rj 1 i i i=j X X X6 | | @ A For instance, many-body WF storage demands are prohibitive: N (r1,...,rN ) (#grid points)

5 on a 10×10×10 grid ~ 10 PetaBytes !

A solution: map onto “one-” theory: (r ,...,r ) (r), (r),..., (r) 1 N ! { 1 2 N } Hohenberg-Kohn-Sham DFT

Map onto “one-electron” theory: N (r ,...,r ) (r), (r),..., (r) (r ,...,r )= (r ) 1 N ! { 1 2 N } 1 N i i i Y Total energy is a functional of the density: E[⇢]=T [ [⇢] ]+E [⇢]+E [⇢] + E [⇢]+U[Z] s { i } H xc Z The density is computed using the one-electron orbitals: N ⇢(r)= (r) 2 | i | i X The one-electron orbitals are the solutions of the Kohn-Sham equation: 1 + V (r)+V [⇢](r)+V [⇢](r) (r)=✏ (r) 2 Z H xc i i i ⇣ ⌘ BUT: Exc[⇢]=??? Vxc[⇢](r)=??? Exchange-Correlation

Exc[⇢]=??? Vxc[⇢](r)=???

• Exchange-Correlation functionals are modeled on the uniform-electron-gas (UEG): The correlation energy (and potential) has been calculated by means of Monte- Carlo methods for a wide range of densities, and has been parametrized to yield a density functional.

• LDA: we simply pretend that an inhomogeneous electronic density locally behaves like a homogeneous electron gas.

• Many, many, many different functionals available: LDA, GGA, meta-GGA, van-der-Waals functionals, etc etc An N-electron system: N = O(1023)

Hohenberg-Kohn-Sham DFT takes us a long way:

(r ,...,r ) (r), (r),..., (r) 1 N ! { 1 2 N } (#grid points)N N (#grid points) ⇥

Nice for and molecules, but in a realistic piece of solid state material N= O(1023)! Translational invariance: Periodic Boundary Conditions

Translational invariance implies:

ikR nk(r + R)= nk(r)e and ikr nk(r)=unk(r)e

unk(r + R)=unk(r)

All states are labeled by Bloch vector k and the band index n: • The Bloch vector k is usually constrained to lie within the first Brillouin zone of the reciprocal space lattice.

• The band index n is of the order if the number of electrons per unit cell. Reciprocal space & the first Brillouin zone

z L 4pi/L z z

b b b1 2 1 b2 a2 y y a1 x x a3 y x

b3 b3

A B C

2⇡ 2⇡ 2⇡ b = a a b = a a b = a a 1 ⌦ 2 ⇥ 3 2 ⌦ 3 ⇥ 1 3 ⌦ 1 ⇥ 2

⌦ = a a a a b =2⇡ 1 · 2 ⇥ 3 i · j ij Sampling the 1st BZ

The evaluation of many key quantities involves an integral over the 1st BZ. For instance the charge density:

1 ⇢(r)= f (r) 2dk ⌦ nk| nk | BZ n BZ X Z We exploit the fact that the orbitals at Bloch vectors k that are close together are almost identical and approximate the integral over the 1st BZ by a weighted sum over a discrete set of k-points:

⇢(r)= w f (r) 2dk, k nk| nk | Xnk

23 Fazit: the intractable task of determining with N=10 (r1,...,rN ) , has been st reduced to calculating at a discrete set of nk(r) k-points in the 1 BZ, for a number of bands that is of the order if the number of electrons in the unit cell. Idea: equally spaced mesh in the 1st Brillouin zone

Example: a quadratic 2D lattice r • q1=q2=4, i.e., 16 points in total b • Only 3 symmetry inequivalent points: 44 k1 1 1 1 k2 4 k1 =( , ) !1 = k ⇥ 8 8 ) 4 3 r 3 3 1 b 4 k =( , ) ! = 0 ⇥ 2 8 8 ) 2 4 3 1 1 IBZ 8 k =( , ) ! = ⇥ 3 8 8 ) 3 2 BZ 1 1 1 1 F (k)dk F (k1)+ F (k2)+ F (k3) ⌦BZ ) 4 4 2 BZZ Algorithm:

• Calculate equally spaced mesh. • Shift the mesh if desired. • Apply all symmetry operations of the Bravais lattice to all k-points. • Extract the irreducible k-points (IBZ). • Calculate the proper weighting.

Common meshes: Two different choices for the center of the mesh.

• Centered on Γ • Centered around Γ (can break the symmetry!) before after shifted to symmetrization

r r

• In certain cell geometries (e.g. hexagonal cells) even meshes break the symmetry.

• Symmetrization results in non-uniform distributions of k-points.

• Γ-point centered meshes preserve the symmetry.

AB C The total energy

E[⇢, R,Z ]=T [ [⇢] ]+E [⇢, R,Z ]+E [⇢]+U( R,Z ) { } s { nk } H { } xc { } The kinetic energy 1 T [ [⇢] ]= w f s { nk } k nkh nk| 2 | nki Xnk The Hartree energy

1 ⇢eZ (r)⇢eZ (r0) E [⇢, R,Z ]= dr0dr H { } 2 r r ZZ | 0| where

2 ⇢ (r)=⇢(r)+ Z (r R ) ⇢(r)= wkfnk nk(r) dk eZ i i | | i nk X X The Kohn-Sham equations 1 + V [⇢ ](r)+V [⇢](r) (r)=✏ (r) 2 H eZ xc nk nk nk ⇣ ⌘ The Hartree potential

⇢eZ (r0) V [⇢ ](r)= dr0 H eZ r r Z | 0| A plane wave basis set

ikr nk(r)=unk(r)e unk(r + R)=unk(r)

All cell-periodic functions are expanded in plane waves (Fourier analysis):

1 iGr 1 i(G+k)r unk(r)= CGnke (r)= C e ⌦1/2 nk 1/2 Gnk G ⌦ X XG iGr iGr ⇢(r)= ⇢Ge V (r)= VGe XG XG The basis set includes all plane waves for which

1 G + k 2

Transformation by means of FFT between “real” space and “reciprocal” space:

iGr FFT 1 iGr C = C e C = C e rnk Gnk ! Gnk N rnk FFT r XG X Why use plane waves?

• Historical reason: Many elements exhibit a band-structure that can be interpreted in a free electron picture (metallic s and p elements). theory was initially developed to cope with these elements (pseudopotential perturbation theory).

• Practical reason: The total energy expressions and the Hamiltonian are easy to implement.

• Computational reason: The action of the Hamiltonian on the orbitals can be efficiently evaluated using FFTs. FFT real space reciprocal space

G cut

τ 2

b2 01 23N−1 0 5 −4012345−3 −2 −1 τ 1 b1 −N/2+1 N/2 x = n / N τ g = n 2 π / τ 1 1 1 1 1 1

iGr FFT 1 iGr C = C e C = C e rnk Gnk ! Gnk N rnk FFT r XG X FFT real space reciprocal space

G cut

τ 2

b2 01 23N−1 0 5 −4012345−3 −2 −1 τ 1 b1 −N/2+1 N/2 x = n / N τ g = n 2 π / τ 1 1 1 1 1 1

iGr FFT 1 iGr C = C e C = C e rnk Gnk ! Gnk N rnk FFT r XG X iGr FFT 1 iGr C = C e C = C e rnk Gnk ! Gnk N rnk FFT r XG X FFT real space reciprocal space

G cut

τ 2

b2 01 23N−1 0 5 −4012345−3 −2 −1 τ 1 b1 −N/2+1 N/2 x = n / N τ g = n 2 π / τ 1 1 1 1 1 1

iGr FFT 1 iGr C = C e C = C e rnk Gnk ! Gnk N rnk FFT r XG X The charge density

Gcut

FFT

ψ ψ ψr G 2 G r cut

FFT

ρ G ρ r The action of the Hamiltonian

The action H | nki 1 + V (r) (r) 2 nk ✓ ◆ Using the convention 1 r G + k = ei(G+k)r G + k = C h | i ⌦1/2 ! h | nki Gnk

• Kinetic energy: 1 1 2 G + k = G + k C NNPLW h | 2 | nki 2| | Gnk

• Local potential: V = VH[⇢]+Vxc[⇢]+Vext • Exchange-correlation: easily obtained in real space Vxc,r = Vxc[⇢r] • FFT to reciprocal space V V { xc,r} ! { xc,G} 4⇡ • Hartree potential: solve Poisson eq. in reciprocal space VH,G = ⇢G G 2 • Add all contributions VG = VH,G + Vxc,G + Vext,G | | • FFT to real space V V { G} ! { r} The action

1 iGr G + k V = V C e N log N h | | nki N r rnk FFT FFT FFT r X The action of the local potential

2Gcut

4π e 2 FFT G 2 V V ρ G G r ψr

3G Gcut cut

add FFT

R R (residual vector) ψG G r The Projector-Augmented-Wave method

The number of plane waves needed to describe • tightly bound (spatially strongly localized) states, • and rapid oscillations (nodal features) of the orbitals near the nucleus exceeds any practical limit, except maybe for Li and H.

The common solution: • Introduce the frozen core approximation: Core electrons are pre-calculated in an atomic environment and kept frozen in the course of the remaining calculations.

• Use of instead of exact potentials: • Norm-conserving pseudopotentials • Ultra-soft pseudopotentials • The Projector-Augmented-Wave (PAW) method [P. E. Blöchl, Phys. Rev. B 50, 17953 (1994)] Pseudopotentials: the general idea

~ Ψ

Ψ rc

~ V

V Pseudopotentials: cont.

2.5 2.0

1.5 s : E= -0.576 R c=1.9 1.0

wave-function 0.5 Al Al p : E= -0.205 R c=1.9 0.0 0 1 2 3 4 R (a.u.)

Exact potential (interstitial) Pseudopotential

Al effective Al PAW Al atom 3p 2p 3p 3s 1s 3s

2p 2p and 1s are nodeless nodal structure retained 2s 12 The PAW orbitals

= + ( ) p | ni | ni | ii| ii h i| ni i X e e e e

p p ˜ | ni | ni | iih i| ni | ni | iih i| ni i i X X+ p e e e e e e e | ieih i| ni i X e e

PW PS-LCAO AE-LCAO = - +

AE pseudopseudo-onsite AE-onsite The PAW orbitals (cont.)

= + ( ) p | ni | ni | ii| ii h i| ni i X e e e • n is the pseudo (PS) orbital, expressed in a plane wave basis sete | i

• ei , , and are atom˜ p˜i -centered localized functions | i | ii | i • The all-electron partial waves are solutions to the radial scalar relativistic non-spinpolarized Schrödinger equation: 1 ( + v ) = ✏ 2 e↵ | ii i| ii • A pseudization procedure yields:

v v p = | ii!| ii e↵ ! e↵ h i| ji ij e e e e The PAW orbitals (cont.)

• The pseudo partial waves obey:

1 + v + p D p = ✏ 1+ p Q p 2 e↵ | ii ijh j| | ki k | ii ijh j| | ki ij ij ⇣ X ⌘ ⇣ X ⌘ e e e e e e e • with the so-called PAW strength parameters and augmentation charges:

1 1 D = + v + v ij h i| 2 e↵ | jih i| 2 e↵ | ji e e e Q = ij h i| jih i| ji e e The all-electron and pseudo eigenvalue spectrum is identical! All-electron scattering properties are reproduced over a wide energy-range. 1 ( + v ) = ✏ 2 e↵ | ii i| ii

1 + v + p D p = ✏ 1+ p Q p 2 e↵ | ii ijh j| | ki k | ii ijh j| | ki ij ij ⇣ X ⌘ ⇣ X ⌘ e e e e e e e Si: Troullier-Martins Si: PAW

@l(r, ✏) 1 @l(r, ✏) 1 @r ⇡ @r (r, ✏) l(r, ✏) l r=rc r=rc e e st • 1 s-channel in Mn: ε1 4s “bound” state

nd • 2 s-channel in Mn: ε2 “non-bound” state

• And we use the frozen core approximation:

2 ve↵ [⇢v]=vH [⇢v]+vH [⇢Zc]+vxc[⇢v + ⇢c] ⇢ (r)= a (r) v i| i | i X

2 ve↵ [⇢v]=vH [⇢v]+vH [⇢Zc]+vxc[⇢v + ⇢c] ⇢ (r)= a (r) v i| i | i X e e e e e e e e The PAW orbitals (cont.)

˜ n lm✏ clm✏ + lm✏ clm✏ | i | ni | i | i X X e

PW PS-LCAO AE-LCAO = - +

AE pseudopseudo-onsite AE-onsite where c = p˜ ˜ lm✏ h lm✏| ni

This decomposition in three contributions can be achieved for all relevant quantities, e.g. orbitals, densities, and energies. The kinetic energy

For instance the kinetic energy: 1 E = f kin nh n| 2 | ni n X Inserting the PAW transformation (where i=lmε):

= ˜ + ( ˜ ) p˜ ˜ | ni | ni | ii| ii h i| ni i X and assuming completeness of the one-center basis, we have

E = E˜ E˜1 + E1 kin 1 1 1 f ˜ ˜ ⇢ ˜ ˜ + ⇢ nh n| 2 | ni ijh i| 2 | ji ijh i| 2 | ji n X Xsite (Xi,j) Xsite (Xi,j) ˜ E E˜1 E1 | {z } Where | {z } | {z } ⇢ = f ˜ p˜ p˜ ˜ ij nh n| iih j| ni n X are the one-center occupancies, or on-site density . Local operators

To any (semi)-local operator A, that acts on the true all-electron orbital, the PAW method associates a pseudo operator:

A˜ = A + p˜ A ˜ A ˜ p˜ | ii h i| | jih i| | ji h j| ij X ⇣ ⌘ that acts on the pseudo-orbital, such that

A = A˜ h | | i h | | i For instance the PS operator associated with the density operator ( )e e r r | ih | r r + p˜ r r ˜ r r ˜ p˜ | ih | | ii h i| ih | jih i| ih | ji h j| ij X ⇣ ⌘ and the density r r = r r + p˜ r r ˜ r r ˜ p˜ h | ih | i h | ih | i h | ii h i| ih | jih i| ih | ji h j| i ij X ⇣ ⌘ = ⇢(er) ⇢1e(r)+⇢1(er) e Non-local operators are more complicated.e e The Hartree energy

• The PS orbitals do not have the same norm as the AE orbitals inside of the PAW spheres. • To correctly describe the long-range electrostatic interactions between the PAW spheres, a soft compensation charge is introduced in the spheres (like in the FLAPW method):

= - +

AE pseudo + compens. pseudo+comp. onsite AE-onsite

E [˜⇢ +ˆ⇢] E [˜⇢1 +ˆ⇢1]+ E [⇢1] H H H sitesX sitesX • This way the Hartree energy (a non-local operator!) decomposes in the same manner as a (semi)-local operator: E = E˜ E˜1 + E1 H H H H The PAW total energy

The same three-way decomposition holds for the total energy

E = E˜ E˜1 + E1 where 1 E˜ = f ˜ ˜ + E [˜⇢ +ˆ⇢ +˜⇢ ]+ nh n| 2 | ni xc c n X 3 EH [˜⇢ +ˆ⇢]+ vH [˜⇢Zc](˜⇢(r)+ˆ⇢(r)) d r + U(R,Zion) Z 1 E˜1 = ⇢ ˜ ˜ + E [˜⇢1 +ˆ⇢ +˜⇢ ]+ ijh i| 2 | ji xc c sitesX ⇢ (Xi,j) 1 1 3 EH [˜⇢ +ˆ⇢]+ vH [˜⇢Zc] ⇢˜ (r)+ˆ⇢(r) d r Z⌦r 1 E1 = ⇢ + E [⇢1 + ⇢ ]+ ijh i| 2 | ji xc c sitesX ⇢ (Xi,j) 1 1 3 EH [⇢ ]+ vH [⇢Zc]⇢ (r) d r Z⌦r The PAW total energy (cont.)

• E˜ is evaluated on a regular grid: The Kohn-Sham functional evaluated in a plane wave basis set with additional compensation charge to account for the incorrect norm of the PS-orbitals and to correctly describe long-range electrostatics

⇢ = fn n n⇤ PS charge density n X ⇢ˆe e e Compensation charges

• E˜1 and are evaluated on atomE1 -centered radial logarithmic grids: The Kohn-Sham energies evaluated using localized basis sets These terms correct for the difference in the shape of the all-electron and pseudo orbitals: ) AE nodal features near the core ) Orthogonality between core and valence states

The essence of the PAW method: there are no cross-terms between quantities on the regular grid (PW part) and the quantities on the radial grids (LCAO part)! The PAW total energy (cont.)

The PS orbitals (plane waves!) are the self-consistent solutions of

1 + V + p (D + ...) p = ✏ 1+ p Q p 2 e↵ | ii ij h j| | ni n | ii ijh j| | ni ij ij ⇣ X ⌘ ⇣ X ⌘ e e e where e e e e 1 1 D = + v1 [⇢1] + v1 [⇢1] ij h i| 2 e↵ v | jih i| 2 e↵ v | ji Q = e e ij h i| jih i| ji e e and e e

1 1 ⇢ (r)= ⇢ r r ⇢ (r)= ⇢ij i r r j v ijh i| ih | ji v h | ih | i ij ij X X with e e e ⇢ = f p p ij nh n| iih j| ni n X e e e e • The PS orbitals are the variational quantity of the PAW method! • If the partial waves constitute a complete (enough) basis inside the PAW spheres, The all-electron orbitals will remain orthogonal to the core states. Accuracy of the PAW method

Δ-evaluation (PAW vs. FLAPW) K. Lejaeghere et al., Critical Reviews in Solid State and Materials Sciences 39,1 (2014) Accuracy of the PAW method (cont.)

Subset of the G2-1 testset of small molecules: deviation of PAW w.r.t. GTO (in kcal/mol) Electronic minimization: Reaching the groundstate

Direct minimization of the DFT functional (e.g. Car-Parrinello): start with a set of trial orbitals (random numbers) and minimize the energy by propagating the orbitals along the gradient:

2 ~ 2 e↵ Gradient: F (r)= + V (r, (r0) ) ✏ (r) n 2m r { n } n n ✓ e ◆

The Self-Consistency-Cycle: start with a trial density, construct the corresponding Hamiltonian. Solve it to obtain a set of orbitals:

2 ~ 2 e↵ + V (r, ⇢(r0) ) (r)=✏ (r) n =1,...,N /2 2m r { } n n n e ✓ e ◆ These orbitals define a new density, that defines a new Hamiltonian, … iterate to self-consistency Direct minimization vs. SCC disordered diamond, insulator disordered fcc Fe, metal energy 2 0 0 n=4 -2 -2 direct 0 0 -4 direct Car−Parrinello Car−Parrinello -4 E-E E-E 10 10 -6 -6 n=1 log n=1,2,4,8 log n=1 n=8 L -8 -8 n=8 1 self.consistent 1 self.consistent 0 0 | |

0 -1 0 -1 F-F F-F | |

-2 -2 10 n=1 10 -3 -3 log log -4 -4 0 5 10 15 20 0 10 20 30 40 iteration forces iteration Direct minimization and charge sloshing The gradient of the total energy with respect to an orbital is given by: 1 g = f 1 Hˆ + H (f f ) | ni n | mih m| | ni 2 nm n m | mi m m where ⇣ X ⌘ X Hnm = m Hˆ n h | | i E unoccupied charge

Consider two states occupied

i(kF k)r i(kF +k)r n = e m = e potential and a small sub-space rotation slowly varying charge 2 (2nd comp. of the gradient): 4 π e / G strong change in potential

0 = + s 0 = s n n m m m n This leads to a long-wavelength change in the density and a very strong change in the electrostatic potential (charge sloshing): 2 i2k r 2s 4⇡e i2k r ⇢(r)=2sRe e · V (r)= Re e · H 2k 2 | | Stable step size Δs (for a simulation box with largest dimension L): k 1/L V L2 s 1/L2 | | / H / / The Self-Consistency-Cycle (cont.)

Two sub-problems:

• Optimization of { n} Iterative Diagonalization e.g. RMM-DIIS or Blocked Davidson

• Construction of ⇢in Density Mixing e.g. Broyden mixer The self-Consistency-Cycle

A naïve algorithm: express the Hamilton matrix in a plane wave basis and diagonalize it:

H = G Hˆ [⇢] G0 diagonalize H , ✏ i =1,..,N h | | i! ! { i i} FFT Self-consistency-cycle:

⇢ H ⇢0 ⇢ = f(⇢ , ⇢0) H ... 0 ! 0 ! ! 1 0 ! 1 ! Iterate until: ⇢ = ⇢0

3 BUT: we do not need NFFT eigenvectors of the Hamiltonian (at a cost of O(NFFT )). Actually we only the Nb lowest eigenstates of H, where Nb is of the order of the number of electrons per unit cell (Nb << NFFT).

Solution: use iterative matrix diagonalization techniques to find the Nb lowest Eigenvector of the Hamiltonian: RMM-DIIS, blocked-Davidson, etc. Key ingredients: Subspace diagonalization and the Residual

• Rayleigh-Ritz: diagonalization of the Nb x Nb subspace

¯ app ¯ HnmBmk = ✏k SnmBmk m m with X X H¯ = Hˆ S¯ = Sˆ nm h n| | mi nm h n| | mi yields N eigenvectors with eigenvalues ¯ = B ε . b | ki mk| mi app m X These eigenstates are the best approximation to the exact Nb lowest eigenstates of H within the subspace spanned by the current orbitals.

• The Residual: ˆ ˆ ˆ n H n R( n) =(H ✏appS) n ✏app = h | | i | i | i Sˆ h n| | ni

(its norm is measure for the error in the eigenvector) Blocked-Davidson • Take a subset of all bands: n =1,..,N 1 k =1,..,n { n| } ) { k| 1} • Extend this subset by adding the (preconditioned) residual vectors to the presently considered subspace: 1/g1 = K(H ✏ S) 1 k =1,..,n { k k app k| 1} • Rayleigh-Ritz optimization (“sub-space rotation”) in the 2n1 dimensional subspace to determine the n1 lowest eigenvectors: diag 1/g1 2 k =1,..,n { k k} { k| 1} • Extend subspace with the residuals of 2 { k} 1/g1/g2 = K(H ✏ S) 2 k =1,..,n { k k k app k| 1} 3 • Rayleigh-Ritz optimization k =1,..,n1 ) { k| } • Etc … • The optimized set replaces the original subset: m k =1,..,n n =1,..,n { k | 1} { n| 1} • Continue with next subset: , 1 k = n +1,..,n etc, … { k| 1 2} After treating all bands: Rayleigh-Ritz optimization of n =1,..,N { n| } Charge density mixing

We want to minimize residual vector

R[⇢ ]=⇢ [⇢ ] ⇢ in out in in with ⇢ (~r)= w f (~r) 2 out k nk| nk | occupiedX

Linearization of the residual around the self-consistent density ⇢sc (linear response theory):

R[⇢]= J(⇢ ⇢sc) J = 1 U 4⇡e2 q2 where J is the charge dielectric function. |{z} Provided we have a good approximation for the charge dielectric function, minimization of the residual is trivial:

1 R[⇢in]=⇢out[⇢in] ⇢in = J(⇢in ⇢sc) ⇢ = ⇢ + J R[⇢ ] sc in in The charge dielectric function

• Use a model dielectric function that is a good initial approximation for most systems

2 1 1 q AMIX J G = max( , AMIN) ⇡ q q2 + BMIX

• This is combined with a convergence accelerator

The initial dielectric function is improved using the information accumulated in each electronic mixing step. The End

Thank you!