HybriD3 Theory Training Workshop -- organized by Y. Kanai (UNC) and V. Blum (Duke) ***Practical Density Functional Theory with Plane Waves)*** Natalie A. W. Holzwarth, Wake Forest University, Department of , Winston-Salem, NC, USA Acknowledgements: • Cameron Kates, Jamie Drewery, Hannah Zhang, Zachary Pipkorn (former WFU undergrads) • Zachary Hood (WFU chemistry alum, Ga Tech Ph. D) • Jason Howard, Ahmad Al-Qawasmeh, Yan Li, Larry E. Rush, Nicholas Lepley (current and former WFU grad students) • NSF grant DMR-1507942 9/29/2018 HybriD3 2018 1 Perspectives on Materials Simulations

Fundamental Physical Numerical Software Theory approximations approximations packages and tricks

quantum-espresso input (http://www.quantum-espresso.org/) parameters abinit (https://www.abinit.org/) useful results (http://qboxcode.org/) FHI-aims (https://aimsclub.fhi-berlin.mpg.de/)

It is important to know what is inside the box!

9/29/2018 HybriD3 2018 2 Fundamental Physical Numerical Software Theory approximations approximations packages and tricks

Quantum mechanics and electrodynamics as it applies to many particle systems

9/29/2018 HybriD3 2018 3 Fundamental Physical Numerical Software Theory approximations approximations packages and tricks

Born-Oppenheimer approximation [Born & Huang, Dynamical Theory of Crystal Lattices , Oxford (1954)]: Nuclear motions treated classically while electronic motions treated quantum

mechanically because MN>>me

Density functional theory [Kohn, Hohenberg, Sham, PR 136, B864 (1964), PR 140, A1133 (1965)]: Many system approximated by single particle approximation using a self- consistent mean field.

Frozen core approximation[von Barth, Gelatt, PRB 21, 2222 (1980)]: Core assumed to be “frozen” at their atomic values; valence electrons evaluated variationally. 9/29/2018 HybriD3 2018 4 Fundamental Physical Numerical Software Theory approximations approximations packages and tricks

Plane wave representations of electronic wavefunctions and densities

Pseudopotential formulations

9/29/2018 HybriD3 2018 5 Numerical methods more generally --

Plane waves or Grids Muffin tins Muffin Numerical methods Density Functional Theory

9/29/2018 HybriD3 2018 6 ***Practical Density Functional Theory with Plane Waves)*** Outline • Treatment of core and valence electrons; frozen core approximation • Use of plane wave expansions in materials simulations • Pseudopotentials • Norm conserving pseudopotentials • Projector augmented wave formalism • Assessment of the calculations

9/29/2018 HybriD3 2018 7 Summary and conclusions: • Materials simulations is a mature field; there are many great ideas to use, but there still is plenty of room for innovation. • Maintain a skeptical attitude to the literature and to your own results. • Introduce checks into your work. For example, perform at least two independent calculations for a representative sample. • On balance, static lattice results seem to be under good control. The next frontier is more accurate treatment of thermal effects and other aspects of representing macroscopic systems. • Developing first-principles models of real materials to understand and predict their properties continues to challenge computational scientists.

9/29/2018 HybriD3 2018 8 ***Practical Density Functional Theory with Plane Waves)*** Outline • Treatment of core and valence electrons; frozen core approximation • Use of plane wave expansions in materials simulations • Pseudopotentials • Norm conserving pseudopotentials • Projector augmented wave formalism • Assessment of the calculations

9/29/2018 HybriD3 2018 9 9/29/2018 HybriD3 2018 10 Two examples --

Partitioning electrons into core and valence contributions

nr() ncore () r  n vale () r

9/29/2018 HybriD3 2018 11 For spherically symmetric : (r)   ()r Y () rˆ nlmiii nl ii lm ii P( r )  (r )  nli i nli i r

Example for carbon 2 nr() w () r  niil n ii l i 2 =4 2()r2 2  () r 2  2  ( r )  1s 2 s 2 p 

4 2 2 2 = 2 Pr() 2 Pr ( ) 2 P () r 2  1s 2 s 2 p  9/29/2018r HybriD3 2018 12 Radial wavefunctions for carbon

1s

(r) 2p nl P

2s

r (Bohr)

9/29/2018 HybriD3 2018 13 Electron density of C atom

2 ncore(r) [1s ]  /4 2

r n 2 2 nval(r) [2s 2p ]

r (Bohr)

9/29/2018 HybriD3 2018 14 Electron density of copper Example for Cu 1s22s22p63s23p63d104s1

ncore(r)  /4 2 r n

nvale(r)

r (Bohr)

9/29/2018 HybriD3 2018 15 Radial wavefunctions for Cu

3s 3d 4p (r) nl P 4s

3p Note that in this case, the “semi-core” states 3s23p63d10 are included as “valence” r (Bohr)

9/29/2018 HybriD3 2018 16 Frozen core approximation

n( r)  ncore()r n vale () r Example for Cu Variationally optimize energy wrt nvale ( r) 1s22s22p63s23p63d104s1

ncore(r)  /4 2 r n

nvale(r)

r (Bohr) 9/29/2018 HybriD3 2018 17 Systematic study of frozen core approximation in DFT

http://journals.aps.org/prb/abstract/10.1103/PhysRevB.21.2222

9/29/2018 HybriD3 2018 18 ***Practical Density Functional Theory with Plane Waves)*** Outline • Treatment of core and valence electrons; frozen core approximation • Use of plane wave expansions in materials simulations • Pseudopotentials • Norm conserving pseudopotentials • Projector augmented wave formalism • Assessment of the calculations

9/29/2018 HybriD3 2018 19 Consider a periodic material with a unit cell described by primitive lattice vectors a1,a2, and a3: a 3 Multiple

a2 unit cells

a1

Any position r in the material is related to an infinite number of

other points in the material r T r  n1 a 1  n 2 a 2 n 3 a 3 because of its periodic symmetry. Because of Bloch's theorem, any wavefunction of the system having wavevector k , ikT i kr  has the property: k(rT )e k ( r ). This means that  kk ( rr ) e u ( ),

where uk (r ) is a periodic function. All directly measurable properties of the system also reflect the periodic nature of the system. For example, the electron density: n (rT )  n ( r ) 9/29/2018 HybriD3 2018 20 Mathematical relationships – The Fourier transform of a periodic function results in a discrete summation based on the reciprocal lattice. iGr For the electron density: n (r ) ne ( G ) , where Gbb  mmm1 1 2 2 3b3 G The reciprocal lattice vectors are related to the primitive translation

a j ak vectors according to bija =2 ij ; b i  2  ai (a j ak )

1 3 iGr  Here n (G )  d r e n (r ).  unit cell  Fourier transforms are a natural basis for periodic functions. For example, the periodic part of the Bloch : iGr ik G   r uuekk(r ) (G ) and  kk ( rG )   ue  ( ) G G This works well, provided the summation converges in the sense thta uk (G )  fo r k+G  Kmax . 9/29/2018 HybriD3 2018 21 ***Practical Density Functional Theory with Plane Waves)*** Outline • Treatment of core and valence electrons; frozen core approximation • Use of plane wave expansions in materials simulations • Pseudopotentials • Norm conserving pseudopotentials • Projector augmented wave formalism • Assessment of the calculations

9/29/2018 HybriD3 2018 22 The notion of pseudopotential has been attributed To in the 1930’s. “First principles” pseudopotentials were developed by Hamann, Schlüter, and Chiang, PRL 43, 1494 (1979) and J. Kerker, J. Phys. C 13, L189 (1980). Cs effective potential Cs 5s orbital r c rc Pseudo Pseudo V all-Electron

VrVPseudo() all-Electron () r Potential(Ry)  r r c Pseudo()r  all-Electron () r all-Electron  V r rc

r (bohr) r (bohr) 9/29/2018 HybriD3 2018 23 Justification for pseudopotential formalism

Valence electron orthogonality to core electrons provide a repulsive effective potential, resulting in an effective smooth “pseudopotential” for valence electrons.

Norm-conserving pseudopotential construction schemes

9/29/2018 HybriD3 2018 24 Norm-conserving pseudopotentials -- continued Constructed from all-electron treatments of spherical or ions: 2  2 all-Electron  all-Electron  V( r ) nl   nl (r )  0 2m  2  2Pseudo  Pseu d o   Vr( ) nl  nl ( r ) 0  2m  Require: Pseudo all-Electron V( rV ) ( r ) for rr c Pseudo all-Electron nl(r )   nl (r ) for rr c Also require: 2 2 Norm conservation d3r Pseudo() rd 3r  all-Electron () r nl  nl condition; has several rrcr  r c benefits

Procedure can be carried out for one orbital nl at a time VPseudo()rV Pseudo () r  V Pseudo () r P loc  nl nl Non-local projector operator nl 9/29/2018 HybriD3 2018 25 Recent improvements to norm-conserving pseudopotentials

Improves the accuracy of the norm conserving formulation and allows for accurate plane wave representations of the wavefunctions: ik Gr  k()r   u k () G e G for k+G Kmax

9/29/2018 HybriD3 2018 26 Other plane wave compatible schemes --

(1) (2)

(3)

Muffin tins Muffin References: 1. P. E. Blöchl, PRB 50, 17953 (1994) 2. D. Vanderbilt, PRB 41, 7892 (1990); K. Laasonen, A. Pasquarello, R. Car, C. Lee, D. Vanderbilt, PRB 47, 10142 (1993) 3. D. R. Hamann, M. Schlüter, C. Chiang, PRL 43, 1494 (1979); D. R. Hamann, PRB 88, 085117 (2013) Numerical methods Density Functional Theory

9/29/2018 HybriD3 2018 27 Basic ideas of the Projector Augmented Wave (PAW) method Peter Blöchl, Institute of Theoretical Physics TU Clausthal, Germany Blöch presented his ideas at ES93 --“PAW: an all- electron method for first-principles molecular dynamics” Reference: P. E. Blöchl, PRB 50, 17953 (1994) Features • Operationally similar to other pseudopotential methods, particularly to the ultra-soft pseudopotential method of D. Vanderbilt; often run within frozen core approximation • Can retrieve approximate ‘’all-electron” wavefunctions from the results of the calculation; useful for NMR analysis for example • May have additional accuracy controls particularly of the higher multipole Coulombic contributions. 9/29/2018 HybriD3 2018 28 Basic ideas of the Projector Augmented Wave (PAW) method

• Valence electron wavefunctions are approximated by the form a a a nkk()()r n rb rR a   b rR a p b  rR  a   n k () r ab

All-electron Pseudowavefunction, wavefunction optimized in solving Kohn-Sham equations

Atom-centered functions: All electron basis functions Pseudo basis functions Projector functions

 nk (r ) : determined self-consistently within calculation a a a b(r ),  b ( r ),p b ( r )  : part of pseudopotential construction; stored in PAW dataset 9/29/2018 HybriD3 2018 29 Basic ideas of the Projector Augmented Wave (PAW) method

• Evaluation of the total electronic energy:

Etotal  E total   Ea a Pseudoenergy One-center atomic (evaluated in plane contributions wave basis or on (evaluated within regular grid) augmentation spheres) 9/29/2018 HybriD3 2018 30 Comment on one center energy contributions • Norm-conserving pseudopotential scheme using the Kleinman-Bylander method (PRL 48, 1425 (1982)): The non-local pseudopotential contributions for site a :

a a a a Ea Wnkk n b  b  n k ,where   b (r  R ) are nk, b fixed functions depending on the non-local pseudopotentials

and corresponding pseudobasis functions; Wnk are occupancy and sampling weights. • PAW and USPS :

a a a a a Ea  Wnkk  n p b M bb' p  b '   n k ,where p  b (r  R ) are nk, bb' a projector functions, M bb' are matrix elements depending on

all-electron and pseudobasis functions, and Wnk are occupancy and Brillouin zone sampling weights. 9/29/2018 HybriD3 2018 31 Comment on one center energy contributions -- continued for PAW and USPS a M bb' matrix elements (different for USPS and PAW) are evaluated within the augmentation spheres. For example, the kinetic energy term: 2  rc a a a a  a  db() rd b' () r d  b () rd   b ' () r Kbb'  l lmm   dr    b b'b b ' 2m  dr dr dr dr  0   rc dr  +l (l 1)a ()() rrrr a   a ()()  a  b b r 2  b b' b b '   0  a()r  a () r where a (r )bY ( rrˆ ) and  a ( )  b Y ( r ˆ ) br lmb b b r lm b b a a a a a Note that for USPS, the operator Qbb' ( r ) b()rr b' ()   b () rr  b ' () is pseudized, while for PAW it is evaluated within matrix elements and "compensation charges" are added. In both cases, multipole moments are conserved.

9/29/2018 HybriD3 2018 32 Summary of properties of norm-conserving (NC), ultra-soft-pseudopotential (USPS) and projector augmented wave (PAW) methods

NC USPS PAW Conservation of charge Multipole moments in Hartree interaction Retrieve all-electron wavefunction

9/29/2018 HybriD3 2018 33 Some details – use of “compensation charge” PAW approximation to valence all-electron wave function

a a a nkk()()r n rb rR  a   b rR a   p b  rR  a   n k () r ab PAW approximation to all-electron density 2 nvalence ()rWnk  n k () r nk 2 Wnk  n k (r ) nk a a a a a a  Wnk   nkpb p  b' n k  brR a   b ' rR  a   b rR a   b ' rR  a  nk a, bb '

2 a a a  Wnkk n (r )     n kpbp  b'   n k Q bb '  rR  a   nk a, bb '  a a  n (r ) n rR a  n rR a   a ˆa a a a nˆar  R a = n (r )   n  r  R n rRrRa   n  a     a a 9/29/2018 HybriD3 2018 34 Some details – use of “compensation charge” -- continued Compensation charge is designed to have the same multipole moments of one-center charge differences: d3r rL Y ()()rrˆ nˆ a d 3r r L Y ()() rrr ˆ n a  n a () LM  LM   a a rrc rr  c

L  0 Typical shape of compensation charge for L=0 component --

rc

9/29/2018 HybriD3 2018 35 Some details – use of “compensation charge” -- continued

The inclusion of the "compensation" charge ensures 1. Hartree energy of smooth charge density represents correct charge 2. Hartree energy contributions of one-center charge is confined within augmentation sphere: na ()rna () r  nˆ a ( r) Va(r ) for rr a d 3r '   Hartree c   a a r r ' 0 fro r r rrc  c

9/29/2018 HybriD3 2018 36 Some details – form of exchange-correlation contributions

non-linear core correction (S. G. For E [ n (r )] d3r K ( n ( r )) : xc  xc Louie et al. PRB 26, 1738 (1982))

Smooth contribution: E xc E xc [ n (r )  n core ( r )] a a a a a a One-center contributions: Exc E xcxc = E [ n (r )  ncore ( r )] E xc [ n ( rr ) n  core ( )]

Note that VASP and Quantum-Espresso use

E xc[() nr n core () rr  nˆ ()] aa a and E xc [ n (r ) n core ( r )  nˆ ( r )] which can cause trouble occasionally.

9/29/2018 HybriD3 2018 37 Pseudopotential schemes enable the accurate use of plane wave and regular grid based numerical methods Convergence of plane wave expansions: ik G   r nk(r)  u n k ( G ) e k G Kmax  G

2 Electron density: n (r ) wnk  n k ( r ) nk (occ) 2 ik Gr   iGr n (r )  wuenk n k ( G ) =  ne  ( G ) nkG (occ) G

k+GK G  2 K max max

9/29/2018 HybriD3 2018 38 Some convenient numerical “tricks” involved with Fourier transforms using discrete Fourier transforms ik G  r nk(r )  u n k ( G ) e G Discrete summation due

k G Kmax  to lattice periodicity

Discrete Fourier transforms  Fast Fourier transforms FFT equations http://www.fftw.org/

nm1 1 nm2 2 n3 m 3  i2    N1 N2 N 3  fnnn1,,,, 2 3  fmmme  1 2 3  mm1,, 2 m 3

n1m 1 nm 2 2 n3 m 3  i2    1  N1 N2N 3  fmmm 1,,,, 2 3    fnnen 1 2 3  N1N 2 N 3 n1,,n 2 n 3

9/29/2018 HybriD3 2018 39 FFT grid size Reciprocal space

G  Kmax

Enclosing parallelepiped

Gbn11  n2 b 2  n 3 b 3

0 ni  N i

Real space grid point s

m1 m2 m3 ra1  a2 a 3 N1 N2 N 3 nm nm nm  G r  2 1 1  2 2  3 3   N1 N2 N 3 

9/29/2018 HybriD3 2018 40 ***Practical Density Functional Theory with Plane Waves)*** Outline • Treatment of core and valence electrons; frozen core approximation • Use of plane wave expansions in materials simulations • Pseudopotentials • Norm conserving pseudopotentials • Projector augmented wave formalism • Assessment of the calculations

9/29/2018 HybriD3 2018 41 Assessment of the calculations Science 25 MARCH 2016 VOL 351 ISSUE 6280 http://science.sciencemag.org/content/sci/351/6280/aad3000.full.pdf

9/29/2018 HybriD3 2018 42 Webpage for standardized comparison of codes

https://molmod.ugent.be/deltacodesdft

9/29/2018 HybriD3 2018 43 Assessment of your specific calculations

• You can expect that even well-converged calculations will differ between pseudopotential datasets and code packages. It is incumbent on us to trace and document these differences. • There is some error cancelation in a set of calculations using a given set of pseudopotential datasets and a single code package. • On the other hand, the best way to validate your results, is to compare two or more independent calculations for a representative sample.

9/29/2018 HybriD3 2018 44 Various code packages

Code for generating PAW datasets http://pwpaw.wfu.edu

9/29/2018 HybriD3 2018 45 Various code packages ABINIT -- Electron structure code package mainly based on plane waves https://www.abinit.org/

9/29/2018 HybriD3 2018 46 Various code packages Quantum Espresso – Electron structure code package mainly based on plane waves

http://www.quantum-espresso.org/

9/29/2018 HybriD3 2018 47 General advice about generating PAW datasets

• ATOMPAW code* available at http://pwpaw.wfu.edu • Develop and test atomic datasets for the full scope of your a project  determine rc , define frozen core • Determine local pseudopotential from self-consistent all- electron potential • Determine basis functions for valence (and perhaps semicore) states; usually 2 sets of basis functions and projectors for each l channel. • Test binding energy curves for a few binary compounds related to your project. • Check plane wave (or grid spacing) convergence of your data sets before starting production runs.

*With major modification by Marc Torrent and other Abinit developers. 9/29/2018 HybriD3 2018 48 Recipes for constructing projector and basis functions

a()r  a () r pr a () a(r )bY ( rrˆ )  a ( )  b YpY ( rr ˆ ) a ( )   b ( r ˆ ) br lbbm b r lb b m b r l b m b a a a Constraints: bb (r )  ( r ) for rr  c a a prb ( ) 0 for rr  c a a pb b' = bb '

Peter Blöchl’s scheme (set #1) David Vanderbilt’s scheme (set #2) a Choose pseudo bases  a (r ) * Choose projectors pb ( r )* b a  Derive pa ( r )  Derive b (r ) b *Typically Bessel-like function *Polynomial or Bessel function with zero value and derivative form following RRKJ, PRB 41, a at rc 1227 (1990) 9/29/2018 HybriD3 2018 49 Example projector and basis functions Br 4s orbital

a pb ( r ) a pa ( r ) b (r ) b a b (r ) a b (r ) a b (r )

From set #1 From set #2

9/29/2018 HybriD3 2018 50 Set of basis and projector functions for set #1 Cs Br 5s 6s 4s es

5p ep 4p ep

4d ed x1/2 x1/2 3d ed

9/29/2018 HybriD3 2018 51 Sources of pseudopotential and paw datasets on the web https://www.abinit.org/psp-tables http://www.quantum-espresso.org/pseudopotentials

If you use datasets from the web, it is still your responsibility to test them for accuracy wrt to your project.

9/29/2018 HybriD3 2018 52 Measure of accuracy Sometimes, calculations can surprise!! Binding energy curve for CsBr

Set #2 fails to converge in QE!

9/29/2018 HybriD3 2018 53 Mystery – Why does the Cs dataset #1 do well in abinit but fail in espresso?? Binding energy curves for CsBr

Answer -- Set #2’ now converges in QE and abinit! Treatments of the exchange-correlation energies Compensation charge; does Abinit : E E [ n (r ) n ( r )] xc xc   core not logically belong in this expression and can cause QE & VASP: E xc E xc [() nr  n core () r  nˆ vale ()] r argument to be negative. 9/29/2018 HybriD3 2018 54 Densities fo Cs -- Binding energy curve for CsBr

ncore ncore nˆ vale

Set #2’

ncore radial densityradial Set #2 ncore nˆ vale

r (bohr)

9/29/2018 HybriD3 2018 55 Other surprises due to the same issue For NaCl, the electronic structure calculations performed with both QE and Abinit agreed well, but the density functional perturbation theory step resulted in incorrect phonon densities of states. Phonon densities of states for NaCl

Original dataset for Cl Corrected dataset for Cl

QE QE

Abinit Abinit

n (cm)-1 n (cm)-1

9/29/2018 HybriD3 2018 56 Summary and conclusions: • Materials simulations is a mature field; there are many great ideas to use, but there still is plenty of room for innovation • Maintain a skeptical attitude to the literature and to your own results • Introduce checks into your work. For example, perform at least two independent calculations for a representative sample. • On balance, static lattice results seem to be under good control. The next frontier is more accurate treatment of thermal effects and other aspects of representing macroscopic systems. • Developing first-principles models of real materials to understand and predict their properties continues to challenge computational scientists.

9/29/2018 HybriD3 2018 57