algorithms for total energy and forces in condensed-matter dft codes
Post on 03-Jan-2016
17 Views
Preview:
DESCRIPTION
TRANSCRIPT
Algorithms for Total Energy and Forces in Condensed-Matter DFT codes
IPAM workshop “Density-Functional Theory Calculations for Modeling Materials and Bio-Molecular Properties and Functions”
Oct. 31 – Nov. 5, 2005
P. KratzerFritz-Haber-Institut der MPG
D-14195 Berlin-Dahlem, Germany
DFT basics
Kohn & Sham (1966)
[ –2/2m + v0(r) + Veff[] (r) ]j,k(r) = j,k j,k(r)
(r) = j,k | j,k( r) |2 in daily practice:Veff[] (r) Veff((r)) (LDA) Veff[] (r) Veff((r), (r) ) (GGA)
Kohn & Hohenberg (1965)For ground state properties, knowledge of the electronic density (r) is sufficient. For any given external potential v0(r), the ground state energy is the stationary point of a uniquely defined functional
)()(][][ 00rvrdrEv F
Outline
• flow chart of a typical DFT code• basis sets used to solve the Kohn-Sham equations• algorithms for calculating the KS wavefunctions and KS
band energies• algorithms for charge self-consistency• algorithms for forces, structural optimization and
molecular dynamics
for all k determine wavefunctions spanning the occupied space
initialize charge density
initialize wavefunctions
forces converged ?
forces small ?
construct new charge density
determine occupancies of states
energy converged ?
move ions STOP
STOPyesstatic run
yesrelaxation run or molecular dynamicsno
no
yes
yes
no
DFT methods for Condensed-Matter Systems
• All-electron methods
• Pseudopotential / plane wave method: only valence electrons (which are involved in chemical bonding) are treated explicitly
1) ‘frozen core’ approximation
2) fixed ‘pseudo-wavefunction’ approximation
projector-augmented wave (PAW) method
Pseudopotentials and -wavefunctions
• idea: construct ‘pseudo-atom’ which has the valence states as its lowest electronic states
• preserves scattering properties and total energy differences
• removal of orbital nodes makes plane-wave expansion feasible
• limitations: Can the pseudo-atomcorrectly describe the bonding in different environments ? → transferability
1. All-electron: atomic orbitals + plane waves in interstitial region (matching condition)
2. All-electron: LMTO (atomic orbitals + spherical Bessel function tails, orthogonalized to neighboring atomic centers)
3. PAW: plane waves plus projectors on radial grid at atom centers (additive augmentation)
4. All-electron or pseudopotential: Gaussian orbitals5. All-electron or pseudopotential: numerical atom-centered
orbitals6. pseudopotentials: plane waves
Basis sets used to represent wavefuntions
LCAOsLCAOs
LCAOsLCAOs
PWs
Implementations, basis set sizes
implementation(examples)
bulk compound
surface,oligo-peptide
1 WIEN2K ~200 ~20,000
2 TB-LMTO ~50 ~1000
3 CP-PAW, VASP, abinit 100..200 5x103…5x105
4 Gaussian,Quickstep, …
50-500 103…104
5 Dmol3 ~50 ~1000
6 CPMD, abinit, sfhingx, FHImd
100..500 104…106
Eigenvalue problem: pre-conditioning
• spectral range of H: [Emin, Emax]in methods using plane-wave basis functions dominated by
kinetic energy; • reducing the spectral range of H: pre-conditioning
H → H’ = (L†)-1(H-E1)L-1 or H → H’’ = (L†L)-1(H-E1)
C:= L†L ~ H-E1• diagonal pre-conditioner (Teter et al.)
;2718128
27181281623
234
xxx
xxxxC cutETx /ˆ
)2(~ 22max ecutcut mkEE
Eigenvalue problem: ‘direct’ methods
• suitable for bulk systems or methods with atom-centered orbitals only
• full diagonalization of the Hamiltonian matrix• Householder tri-diagonalization followed by
– QL algorithm or– bracketing of selected eigenvalues by Sturmian sequence
→ all eigenvalues j,k and eigenvectors j,k • practical up to a Hamiltonian matrix size of ~10,000
basis functions
Eigenvalue problem: iterative methods
• Residual vector • Davidson / block Davidson methods
(WIEN2k option runlapw -it)– iterative subspace (Krylov space)– e.g., spanned by joining the set of occupied states {j,k} with
pre-conditioned sets of residues {C―1(H-E1) j,k}– lowest eigenvectors obtained by diagonalization in the
subspace defines new set {j,k}
mmmR )( SH
Eigenvalue problem: variational approach
• Diagonalization problem can be presented as a minimization problem for a quadratic form (the total energy)
(1)
(2)• typically applied in the context of very large basis sets (PP-PW)• molecules / insulators: only occupied subspace is required
→ Tr[H ] from eq. (1)• metals:
→ minimization of single residua required
ionionHartreeHartreej
jtot
ionionj
jxcHartreeionjtot
EEEE
EVVVTE
kk
kkk
.,
.,, ||
kk ,, iif 1,, 1)/exp( Tkf Bii k
Algorithms based on the variational principle for the total energy
• Single-eigenvector methods: residuum minimization, e.g. by Pulay’s method
• Methods propagating an eigenvector system {m}:(pre-conditioned) residuum is added to each m– Preserving the occupied subspace
(= orthogonalization of residuum to all occupied states):• conjugate-gradient minimization• ‘line minimization’ of total energy
Additional diagonalization / unitary rotation in the occupied subspace is needed ( for metals ) !
– Not preserving the occupied subspace: • Williams-Soler algorithm• Damped Joannopoulos algorithm
Conjugate-Gradient Method
• It’s not always best to follow straight the gradient→ modified (conjugate) gradient
• one-dimensional mimi-mization of the total energy (parameter j )
)1()1(
)()(
|
|
mm
mm
mRR
RR
)1()()( mm
mm dRd
)()()1( sincos ijj
ijj
ij d
Charge self-consistency
• separate loop in the hierarchy (WIEN2K, VASP, ..)• combined with iterative diagonalization loop (CASTEP,
FHImd, …)‘charge sloshing’
lines of fixed
Two possible strategies:
Two algorithms for self-consistency
construct new charge density and potential
|| (i) –(i-1) ||= ?
(-< ?
iterative diagonalization step of for fixed
construct new charge density and potential
|| (i) –(i-1) ||= ?
|| (i) –(i-1) ||< ?
{(i-1)}→ {(i)}
STOPSTOP
YesYes
No
No
No
No
Achieving charge self-consistency
• Residuum:• Pratt (single-step) mixing:• Multi-step mixing schemes:
– Broyden mixing schemes: iterative update of Jacobian J
idea: find approximation to during runtimeWIEN2K: mixer
– Pulay’s residuum minimization
inj
jjin fR 2
,,,][
kkk
][ )()()1( iin
iin
iin R
i
Nij
jinj
iin
iin R ][ )()()1(
;
,
1
1
kllk
llj
j A
A ][|][ )()( l
inkinlk RRA
);(][ scR J ]);[][(1 XCHartree VVJ
Total-Energy derivatives
• first derivatives– Pressure – stress– forces
Formulas for direct implementation available !• second derivatives
– force constant matrix, phonons
Extra computational and/or implementation work needed !
)()()( 2nOnEnnE SCFSCF
VEp
ijij E
REF
Hellmann-Feynman theorem
• Pulay forces vanish if the calculation has reached self-consistency and if basis set orthonormality persists independent of the atomic positions
1st + 3rd term =
• FIBS=0 holds for pure plane-wave basis sets (methods 3,6), not for 1,2,3,5.
k
kkkkk
k HH
H,
,,,,,
, ||||||j
jjjjj
j
dR
d
dR
d
dR
ddR
dEF
kkk
k ,,,
, | jjj
j
IBS
dRdF
Forces in LAPW
FACTIBScoreHF FFFFFF
R
E
R
VF ionion
jj
effj
HF
k
kk,
,, ||
dSTdSTFMTr
jjj MTr
jjT
kk
kkk ,,
,,,
ˆˆ
rrr dVnF effcorecore )()(
0FACF
Combining DFT with Molecular Dynamics
• Born-Oppenheimer MD • Car-Parrinello MD
construct new charge density and potential
|| (i) –(i-1) ||=0 ?
|| (i) –(i-1) ||=0 ?
{(i-1)}→ {(i)}
move ions
Forces converged?
construct new charge density and potential
|| (i) –(i-1) ||=0 ?
|| (i) –(i-1) ||=0 ?
{(i-1)}→ {(i)}
move ions
Forces converged?
Car-Parrinello Molecular Dynamics• treat nuclear and atomic coordinates on the same footing:
generalized Lagrangian
• equations of motion for the wavefunctions and coordinates
• conserved quantity• in practical application: coupling to thermostat(s)
kkk ,,,, nn
njjj H
RE jtotjjj
,,,,,
kkkk
REL jtotjjj
,,,,,
kkkk
FRM
Schemes for damped wavefunction dynamics
• Second-order with damping
numerical solution: integrate diagonal part (in the occupied subspace) analytically, remainder by finite-time step integration scheme (damped Joannopoulos), orthogonalize after advancing all wavefunctions
• Dynamics modified to first order (Williams-Soler)
kkkk ,,,, )( jjjj H
kkk ,,, )( jjj H
)(,
)(,,
)1(, )ˆ()]ˆ(exp[ i
javgijjavg
ij VVVT kkkk
Comparison of Algorithms (pure plane-waves)
bulk semi-metal (MnAs), SFHIngx code
Summary
• Algorithms for eigensystem calculations: preferred choice depends on basis set size.
• Eigenvalue problem is coupled to charge-consistency problem, hence algorithms inspired by physics considerations.
• Forces (in general: first derivatives) are most easily calculated in a plane-wave basis; other basis sets require the calculations of Pulay corrections.
Literature
• G.K.H. Madsen et al., Phys. Rev. B 64, 195134 (2001) [WIEN2K].• W. E. Pickett, Comput. Phys. Rep. 9, 117(1989) [pseudopotential
approach].• G. Kresse and J. Furthmüller, Phys. Rev. B 54, 11169 (1996)
[comparison of algorithms].• M. Payne et al., Rev. Mod. Phys. 64, 1045 (1992) [iterative
minimization].• R. Yu, D. Singh, and H. Krakauer, Phys. Rev. B 43, 6411 (1991)
[forces in LAPW]. • D. Singh, Phys. Rev. B 40, 5428(1989) [Davidson in LAPW].
top related