Implementing DFT in PlaneWave basis Fabien Bruneval Service de Recherches de Métallurgie Physique CEA Saclay France
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
DFT for periodic systems
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Outline A DFT code adapted to periodic systems:
●
Selfconsistency in KS equations
●
Crystal structure
●
kpoints
●
PlaneWaves
●
Supercells
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Solving KS equations depends on the density non linear equations 2
∇ h r =− v ion r v H [] r v xc []r 2 h r i r =i i r
r =∑ ∣ i r ∣
2
i occ
Energy, Forces, Band structure, Electronic density F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Solving KS equations depends on the density non linear equations 2
−∇ h r = v ion r v H [ ]r v xc [] r 2 h i=i i
r =∑ ∣ i r ∣
2
i occ
Energy, Forces, Band structure, Electronic density F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Solving KS equations depends on the density non linear equations
0
r First guess for 2
∇ h r =− v ion r v H [] r v xc []r 2
h i=i i if
n
n−1
≠
Diagonalization
2
r =∑ ∣i r ∣ i occ
Energy, Forces, Band structure, Electronic density F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Outline A DFT code adapted to periodic systems:
●
Selfconsistency in KS equations
●
Crystal structure
●
kpoints
●
PlaneWaves
●
Supercells
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Crystal structure Crystal axis: a1, a2, a3 Direct lattice vector:
Periodic potential:
Reciprocal lattice axis:
R=n1 a 1n 2 a2 n3 a 3 V r R=V r 2 b 1= a 2×a3 2 b 2= a 3×a 1 2 b 3= a 1×a2
G=n1 b 1n 2 b2n3 b 3 Reciprocal lattice: F. Bruneval
iG. R
e
=1
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Bloch theorem and kpoints Bloch theorem:
k i r =e where
i k .r
u k i r
k is in the first Brillouin zone uki(r) is a periodic function with crystal periodicity
Any periodic operator and, in particular, the Hamiltonian, is diagonal in k.
〈 k i∣h∣k ' j〉=∫ d r e
i k ' −k . r
∗ ki
h r u r u k ' j r
V
=∑ ∫ d r e R
i k ' − k . r R
∗ ki
×h r R u r Ru k ' j r R F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
kpoints allow to split the calculations
〈 k i∣h∣k ' j〉= k k ' 〈 k i∣h∣k j〉 The Hamiltonian has blocks of non interacting kpoints:
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Solving KS equations with kpoints depends on the density non linear equations
0
r First guess for 2
∇ h r =− v ion r v H [] r v xc []r 2 Diagonalizations
h k k i=k i k 1
if
1
n
≠
1
n−1
1
i
h k k i =k i k 2
2
2
2
i
h k k i =k i k 3
3
3
1 2 r = ∣ k i r ∣ ∑ N k k ,i occ
Energy, Forces, Band structure, Electronic density F. Bruneval
Coimbra, 14/04/08
3
i
Implementing DFT in PlaneWave Basis
Brillouin Zone integration Many quantities of the scheme require averaging in the BZ, e.g. kinetic term, electronic density:
r =
to be exact, it should be
r =
1 ∑ N k k ∈BZ
∑∣k i r ∣
2
i occ
1 dk ∫ V BZ V BZ
2
∣k i r ∣ ∑ i occ
We have to find a set of points in the BZ, which makes the limit as fast as possible:
1 ∑ N k k ∈BZ F. Bruneval
1 V BZ
∫dk V BZ
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Brillouin Zone integration 1 ∑ Nk k
1 dk ∫ V BZ V BZ
MonkhorstPack technique, Phys. Rev. B 13, 5188 (1976)
2x2 with shift 0.5 0.5 F. Bruneval
2x2 with shift 0. 0. Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Equivalence kpoints/larger cells 1 unit cell
F. Bruneval
2 unit cells
4 unit cells
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Outline A DFT code adapted to periodic systems:
●
Selfconsistency in KS equations
●
Crystal structure
●
kpoints
●
PlaneWaves
●
Supercells
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Bloch theorem again
k i r =e where
i k .r
u k i r
k is in the first Brillouin zone uki(r) is a periodic function with crystal periodicity
uki(r) is periodic and can be expanded in a Fourier series
1 iG. r u k i r = c k i G e ∑ G where G is on the reciprocal lattice:
G=n1 b 1n 2 b2n3 b 3
1 i k G .r k i r = c k i G e ∑ G F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Potentials in planewaves Example of the ionic potential:
Rspace: V(r)
Z V ion r = ∣r∣ Z V ion G=4 2 ∣G∣ Gspace: V(G)
|G| F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Plane Waves Reciprocal lattice:
G=n1 b 1n 2 b2n3 b 3
Volume of the sphere containing all PW:
4 3 V sphere= G max 3
Volume of occupied by 1 single PW: 3
2 V PW =
2 max
G E cutoff = 2 N G ∝ E F. Bruneval
3 /2 cutoff
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Cutoff for the density 1 ∗ r = k i r k i r ∑ N k k i occ 1 ∗ i G −G ' . r = c k i G c k i G ' e ∑ ∑ ∑ N k k i occ G G G ' G max
=
∑
G0 2G max
F. Bruneval
max
i G 0. r
G 0 e
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
PW: an orthogonal basis set The wavefunctions are a linear combination of orthogonal basis functions:
∣k i 〉 = and
∑
c k i G ∣kG 〉
∣G∣Gmax
1 i G ' −G .r ∣ 〈 kG k G ' 〉= ∫ d r e =G G ' Variational principle:
E ground state E Ecutoff = x Ha
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
PW: an orthogonal basis set Adding more PW or increasing the cutoff energy makes ALWAYS the result more accurate
Silicon
Eexact
F. Bruneval
EPW(Ecutoff)
Gaussian basis sets of quantumchemisrty: STO3G STO6G 321G 631G 631+G* 6311+G* 6311++G** ccpVDZ ccpVTZ ccpVQZ augccpVDZ augccpVTZ augccpVQZ Dünning SVP Dünning DVP Dünning TVP Dünning TVPP Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
PW makes life easier thanks to the FFTs iG. r f r =∑ f G e G
f G= 1 ∫ d r e−i G . r f r 1 −i G . r = e f r i ∑ N r r ∈ i
Discrete Fourier Transform
i
It is exact as long as NG = Nr This means that
f G=DFT −1 [ DFT [ f G ] ] The fast version of DFT is the famous Fast FT with scales as O( N log N ) instead of N2. This enforces the use of regular grid in real space. F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Illustration of the use FFTs We need to calculate the Hartree potential:
c k i G
FFT
r ' v H r =∫ d r ' ∣r −r '∣ uki r r =
G vH G=4
r
G ∣G∣2
vH G F. Bruneval
FFT
1 ∣u k i r ∣2 ∑ N k ki
FFT
vHr Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Supercell technique How to simulate a finite system with periodic boundary conditions? The cost of the calculation can be problematic, since
N G ∝ E
3 /2 cutoff
Still useful for slabs, wires, etc.
L
F. Bruneval
Coimbra, 14/04/08
Implementing DFT in PlaneWave Basis
Recap ●
Selfconsistent loop
●
kpoints:
●
–
MonkhorstPack grid (like 4x4x4 shift 0.5 0.5 0.5)
–
Equivalence between kpoints and larger cells
PlaneWaves
F. Bruneval
–
PW are an orthogonal basis set
–
Cutoff energy for wavefunctions
–
Intensive use of FFT's to increase efficiency Coimbra, 14/04/08