The Machinery of Plane-Wave ab initio Simulation

The Machinery of Plane-Wave ab initio Simulation
Keith Refson
Royal Holloway, University of London
18 July 2015
CCP5 Summer School 2011:First-Principles Simulation
1 / 43
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
Hartree approximation
• The Hartree-Fock
approximation
• Kohn-Sham DFT
• Exchange and Correlation in
DFT
Total-energy calculations
Basis sets
Introduction
Plane-waves and
Pseudopotentials
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
2 / 43
Synopsis
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
Hartree approximation
• The Hartree-Fock
approximation
• Kohn-Sham DFT
• Exchange and Correlation in
DFT
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
A guided tour inside the “black box” of plane-wave ab-initio simulation.
•
•
•
•
•
Density-functional theory (DFT)
Quantum theory in periodic boundaries
Plane-wave and other basis sets
SCF solvers
Molecular Dynamics
Recommended Reading and Further Study
•
•
How to solve the equations
•
•
•
Feliciano Giustino, Materials Modelling using Density Functional Theory, OUP; ISBN:
978-0-19-966244-9
Jorge Kohanoff Electronic Structure Calculations for Solids and Molecules, Theory and
Computational Methods, Cambridge, ISBN-13: 9780521815918
Dominik Marx, Jürg Hutter Ab Initio Molecular Dynamics: Basic Theory and Advanced Methods
Cambridge University Press, ISBN: 0521898633
Richard M. Martin Electronic Structure: Basic Theory and Practical Methods: Basic Theory and
Practical Density Functional Approaches Vol 1 Cambridge University Press, ISBN: 0521782856
C. Pisani (ed) Quantum Mechanical Ab-Initio Calculation of the properties of Crystalline
Materials, Springer, Lecture Notes in Chemistry vol.67 ISSN 0342-4901.
CCP5 Summer School 2011:First-Principles Simulation
3 / 43
Some ab initio codes
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
Hartree approximation
• The Hartree-Fock
approximation
• Kohn-Sham DFT
• Exchange and Correlation in
DFT
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
Planewave
CASTEP
VASP
PWscf
Abinit
Qbox
PWPAW
DOD-pw
Octopus
PEtot
PARATEC
Da Capo
CPMD
fhi98md
SFHIngX
NWchem
JDFTx
LMTO
LMTART
LMTO
FPLO
Gaussian
CRYSTAL
CP2K
AIMPRO
DFT
(r), n(r)
O(N)
ONETEP
Conquest
BigDFT
Numerical
FHI-Aims
SIESTA
Dmol
ADF-band
OpenMX
GPAW
PARSEC
LAPW
WIEN2k
Fleur
exciting
Elk
http://www.psi-k.org/codes.shtml
CCP5 Summer School 2011:First-Principles Simulation
4 / 43
The Schrödinger equation
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
•
Hartree approximation
• The Hartree-Fock
approximation
1 2
− ∇ + V̂ext ({RI }, {ri }) + V̂e-e ({ri }) Ψ({ri }) = EΨ({ri })
2
1 2
where − 2
∇ is the kinetic-energy operator,
• Kohn-Sham DFT
• Exchange and Correlation in
Zi
is the Coulomb potential of the nuclei,
|R
−
r
|
i
I
i
I
X
X
1
1
is the electron-electron Coulomb interaction
V̂e-e =
2 i j6=i |rj − ri |
V̂ext = −
DFT
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
Ignoring electron spin for the moment and using atomic units (h̄ = me = e = 1)
•
•
•
•
XX
and Ψ({ri }) = Ψ(r1 , . . . rn ) is a 3N-dimensional wavefunction.
This is a 3N-dimensional eigenvalue problem.
E-e term renders even numerical solutions impossible for more than a handful of electrons.
Pauli Exclusion principle Ψ({ri }) is antisymmetric under interchange of any 2 electrons.
Ψ(. . . ri , rj , . . .) = −Ψ(. . . rj R, ri , . R. .)
Total electron density is n(r) = . . . dr2 . . . drn |Ψ({ri })|2
CCP5 Summer School 2011:First-Principles Simulation
5 / 43
Approximations 1. The Hartree approximation
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
•
• Kohn-Sham DFT
• Exchange and Correlation in
DFT
Basis sets
Plane-waves and
Pseudopotentials
1 2
− ∇ + V̂ext ({RI }, r) + V̂H (r) φn (r) = En φn (r)
2
Z
n(r ′ )
′
where the Hartree potential: V̂H (r) =
dr
is Coulomb interaction of an
′ − r|
|r
P
2
electron with average electron density n(r) =
i |φi (r)| . Sum is over all occupied states.
φ(rn ) is called an orbital.
Now a 3-dimensional wave equation (or eigenvalue problem) for φ(rn ).
Hartree approximation
• The Hartree-Fock
approximation
Total-energy calculations
Substituting Ψ(r1 , . . . rn ) = φ(r1 ) . . . φ(rn ) into the Schrödinger equation yields
•
•
•
•
How to solve the equations
•
This is an effective 1-particle wave equation with an additional term, the Hartree potential
But solution φi (r) depends on electron-density n(r) which in turn depends on φi (r).
Requires self-consistent solution.
This is a very poor approximation because Ψ({ri }) does not have necessary antisymmetry
and violates the Pauli principle.
CCP5 Summer School 2011:First-Principles Simulation
6 / 43
The Hartree-Fock approximation
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
•
Approximate wavefunction by a slater determinant which guarantees antisymmetry under
electron exchange
1 Ψ(r1 , . . . rn ) = √ n! Hartree approximation
• The Hartree-Fock
approximation
• Kohn-Sham DFT
• Exchange and Correlation in
DFT
Total-energy calculations
Basis sets
•
φ1 (r1 , σ1 )
φ2 (r1 , σ1 )
φ1 (r2 , σ2 )
φ2 (r2 , σ2 )
...
...
.
.
.
.
.
.
..
φn (r1 , σ1 )
φn (r2 , σ1 )
...
.
Substitution into the Schrödinger equation yields
Plane-waves and
Pseudopotentials
φ1 (rn , σn ) φ2 (rn , σn ) .
.
.
φn (rn , σn ) 1 2
− ∇ + V̂ext ({RI }, r) + V̂H (r) φn (r)
2
Z
∗
′
′
X
′ φm (r )φn (r )
−
dr
φm (r) = En φn (r)
′ − r|
|r
m
How to solve the equations
•
•
(1)
(2)
Also an effective 1-particle wave equation. The extra term is called the exchange potential
and creates repulsion between electrons of like spin.
Involves orbitals with co-ordinates at 2 different positions. Therefore expensive to solve.
CCP5 Summer School 2011:First-Principles Simulation
7 / 43
Kohn-Sham DFT
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
•
Replace system of interacting electrons with a fictitious system of non-interacting electrons of
the same density.
We introduce a set of fictitious orbitals φi (r) with density given by
Hartree approximation
• The Hartree-Fock
approximation
n(r) =
• Kohn-Sham DFT
• Exchange and Correlation in
occ
X
i
DFT
|φi (r)|2
and the effective Hamiltonian
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
•
1 2
− ∇ + V̂ext ({RI }, r) + V̂H (r) + v̂xc (r) φn (r) = En φn (r)
2
Kinetic energy of non-interacting system is given by:
1
EK [n(r)] = −
2
Z
dr φ∗i (r)∇2 φi (r)
Use this as approximation for kinetic energy functional (defined implicitly via non-interacting
effective Hamiltonian).
CCP5 Summer School 2011:First-Principles Simulation
8 / 43
Exchange and Correlation in DFT
Introduction
• Synopsis
• Some ab initio codes
• The Schrödinger equation
• Approximations 1. The
•
v̂xc =
Hartree approximation
• The Hartree-Fock
approximation
• Kohn-Sham DFT
• Exchange and Correlation in
DFT
Total-energy calculations
Exchange-correlation potential given by functional derivative.
•
Basis sets
δExc [n(r)]
δn
and contains all remaining “uncertainty” about F [n(r)]. By comparison with Hartree-Fock
effective Hamiltonians, this must include (a) Exchange energy, (b) Correlation energy and (c) the
difference between kinetic energies of non-interacting and interacting systems.
All we have done so far is swept our ignorance of the form of F [n(r)] into one single term.
How does this help?
Plane-waves and
Pseudopotentials
How to solve the equations
•
•
Exchange is small contribution, correlation even
smaller. Therefore a reasonable approximation to
Exc is a very good approximation to F .
Although Kohn-Sham DFT uses effective Hamiltonian very reminiscent of Hartree-Fock, no
claim at all is made about the form of wavefunction.
CCP5 Summer School 2011:First-Principles Simulation
9 / 43
Introduction
Total-energy calculations
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
Conditions
• Cell-periodic Formulation
• Brillouin-Zone integration
Basis sets
Plane-waves and
Pseudopotentials
Total-energy calculations
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
10 / 43
Total Energy Calculations
Introduction
•
Need to compute ground state energy, not just bandstructure. Given by
Total-energy calculations
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
E
=
dr φ∗i (r)∇2 φi (r) +
i
Conditions
• Cell-periodic Formulation
• Brillouin-Zone integration
+
Basis sets
Plane-waves and
Pseudopotentials
N
occ Z
X
•
1
2
Z Z
drdr
′
Z
dr Vext (r)n(r)
n(r)n(r ′ )
+ Exc [n(r)] + EII ({RI })
|r ′ − r|
The aufbau principle is implicit in DFT formalism. Each occupied KS orbital contains 2
“electrons”, so Nocc = Ne /2. Density is
How to solve the equations
n(r) =
N
occ
X
i
•
KS Orbitals subject to orthogonality and normalization conditions
Z
•
|φi (r)|2
dr φ∗i (r)φj (r) = δij
Integrals run over all 3D space, KE term is not cell-periodic.
CCP5 Summer School 2011:First-Principles Simulation
11 / 43
Ion-Ion term
Introduction
Total-energy calculations
•
Additional term EII ({RI }) is usual electrostatic interaction energy between ions. Computed in
usual way, using Ewald Sum for periodic systems.
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
Conditions
• Cell-periodic Formulation
• Brillouin-Zone integration
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
12 / 43
Forces
Introduction
•
Total-energy calculations
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
•
Assuming we have some scheme to generate KS orbitals and energy, we will also need to
evaluate forces acting on ions. (Numerical derivatives of E inadequate and expensive.)
Forces given by derivative of total energy
FIα
Conditions
• Cell-periodic Formulation
• Brillouin-Zone integration
Basis sets
Plane-waves and
Pseudopotentials
•
•
How to solve the equations
X δE ∂φi
X δE ∂φ∗
∂E
dE
i
=−
−
−−
=−
∗
dRIα
∂RIα
δφi ∂RIα
δφi ∂RIα
i
i
The Hellman-Feynmann theorem allows easy calculation of forces. Provided that the φi are
eigenstates of the Hamiltonian the second two terms vanish.
In plane-wave basis the only terms which depend explicitly on ionic co-ordinates are the external
potential and EII ({RI }).
FI = −
•
Z
dr
dVext
dVII
n(r) −
dRI
dRI
The ions feel only the electrostatic forces due to the electrons and the other ions.
In atom-centred basis (LAPW, GTO, etc) additional terms in force from derivative of orbital basis
wrt ionic position - “Pulay forces”.
CCP5 Summer School 2011:First-Principles Simulation
13 / 43
Periodic Boundary Conditions
Introduction
•
Total-energy calculations
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
Conditions
• Cell-periodic Formulation
• Brillouin-Zone integration
Basis sets
Periodic boundary conditions necessary for same reasons as with parametrized potentials.
Vext (r + T ) = Vext (r)
where T is a lattice translation of the simulation cell.
•
observables must also be periodic in simulation cell, so
•
•
•
wavefunctions are NOT observable so φ(r) are NOT cell-periodic.
can multiply φ by arbitrary complex function c(r) with |c| = 1.
Bloch’s Theorem gives form of wavefunctions in periodic potential (see any solid state physics
text for proof).
Plane-waves and
Pseudopotentials
How to solve the equations
•
•
n(r + T ) = n(r)
φk (r + T ) = exp(ik.T )φk (r)
φk (r) = exp(ik.r)uk (r)
where uk (r) is a periodic function u(r + T ) = u(r)
The Bloch functions u(r) are easily representable on a computer program, unlike φ(r).
Bloch states have 2 labels, eigenstate m and wavevector k.
CCP5 Summer School 2011:First-Principles Simulation
14 / 43
Cell-periodic Formulation
Introduction
•
Total-energy calculations
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
Conditions
•
• Cell-periodic Formulation
• Brillouin-Zone integration
Smallest geometric volume with full space-group symmetry and which can be periodically repeated to fill
wavevector space reciprocal-space known as Brillouin
Zone.
Kinetic energy term in total energy rewritten in terms of
Bloch functions
Basis sets
T =
Plane-waves and
Pseudopotentials
Z
BZ
How to solve the equations
R
•
dr u∗k (r) (−i∇ + k)2 uk (r)
Ω
Ω is over one cell rather than all space.
Charge density can also be expressed in terms of uk (r).
n(r) =
XZ
m
•
dk
Z
dk u∗mk (r)umk (r)
BZ
All terms in Hamiltonian now expressed in terms of cell-periodic quantities. Need only store
values of umk (r) for a single simulation cell in computer representation.
CCP5 Summer School 2011:First-Principles Simulation
15 / 43
Brillouin-Zone integration
Introduction
Example Integration
Total-energy calculations
• Total Energy Calculations
• Ion-Ion term
• Forces
• Periodic Boundary
•
Conditions
• Cell-periodic Formulation
• Brillouin-Zone integration
Basis sets
Plane-waves and
Pseudopotentials
•
How to solve the equations
In a realR calculation replace integral bz dk with sum over
discrete set of wavevectors
PBZ
k (“k-points”).
In practice, use points on a
regular grid for 3d integration
(Monkhorst and Pack, Phys.
Rev. B 13,5188 (1976)
Nuts and Bolts 2001
•
•
Lecture 6: Plane waves etc.
25
Fineness of grid is a convergence parameter. Number needed for convergence varies
inversely with simulation cell volume.
In metals, where bands are partially filled, need much finer k-point grid spacing to represent
Fermi surface.
CCP5 Summer School 2011:First-Principles Simulation
16 / 43
Introduction
Total-energy calculations
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Sets
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
17 / 43
How to represent wavefunctions
Introduction
1
Total-energy calculations
Fe 3d orbital
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
Sets
Plane-waves and
Pseudopotentials
How to solve the equations
0.6
ψ(r)
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
0.8
Numerical representation of orbitals / wavefunctions on computer should be
•
•
•
compact
efficient
accurate
Simple discretization insufficiently accurate derivatives needed to compute K.E: −∇2 φ
CCP5 Summer School 2011:First-Principles Simulation
0.4
0.2
0
0
2
4
6
8
10
r/a0
18 / 43
Mathematical representation of basis sets
Introduction
Total-energy calculations
•
•
Need way of representing KS orbitals (in fact the Bloch functions umk (r)) in the computer.
Usually represent as sum of selected basis functions
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
N
umk (r) =
How to solve the equations
cmk,i fi (r)
i=1
•
•
Sets
Plane-waves and
Pseudopotentials
f
X
•
•
fi (r) chosen for convenience in evaluating integrals, which are rewritten entirely in terms of
coefficients cmk,i .
Basis functions form a finite set (Nf ), so number of coefficients cmk,i is finite and can be
stored in computer.
Truncation of basis set to Nf members constitutes an approximation to Bloch functions. Nf
is another convergence parameter.
K-S or H-F Hamiltonians take form of matrix of basis coefficients and equations become
matrix-eigenvalue equations
Hk,ij cmk,j = ǫmk cmk,i
and possible computer algorithms to solve them are suggested.
CCP5 Summer School 2011:First-Principles Simulation
19 / 43
Gaussian basis set
Introduction
1
Total-energy calculations
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
Sets
Plane-waves and
Pseudopotentials
How to solve the equations
0.8
0.6
ψ(r)
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Exact orbital
1 gaussian
2 gaussians
3 gaussians
4 Gaussians
5 Gaussians
0.4
0.2
0
CCP5 Summer School 2011:First-Principles Simulation
0
2
4
r
6
8
10
20 / 43
Gaussian Basis Sets
Introduction
ψi (r) =
Total-energy calculations
X
2
Cij,lm e−αi r Ylm (r̂)
jlm
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Sets
Plane-waves and
Pseudopotentials
How to solve the equations
Pros
•
•
•
Compact: only small number of Cij,lm needed
Integrals (needed to evaluate Hamiltonian) are analytic
Huge literature describing sets of diverse quality.
Cons
•
•
•
•
•
Over complete: risk of linear dependence
Non-orthogonal: overlap gives risk of Basis Set Superposition Error
Awkward to systematically improve - somewhat of a dark art - experience needed.
Need to master arcane terminology, 3-21G, 6-21G∗∗ , DZVP ("double-zeta+polarization"),
"diffuse"
Atom-centred ⇒ difficult "Pulay" terms in forces, stresses and force-constants.
CCP5 Summer School 2011:First-Principles Simulation
21 / 43
Numerical Basis Sets
Introduction
ψi (r) =
Total-energy calculations
X
flm (r)Ylm (r̂)
lm
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Sets
Plane-waves and
Pseudopotentials
where flm is stored on a radial numerical grid. e.g. DMOL, FHI-Aims, SIESTA
Pros
•
Better completeness than with Gaussians.
Cons
•
•
•
Integrals must be evaluated numerically
Harder to control integration accuracy
Harder to evaluate kinetic energy accurately.
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
22 / 43
Plane-wave basis set
Introduction
1
Total-energy calculations
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
Sets
Plane-waves and
Pseudopotentials
How to solve the equations
0.8
0.6
ψ(r)
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Fe 3d
Npw=1
Npw=2
Npw=4
Npw=8
Npw=16
Npw=32
Npw=64
0.4
0.2
0
-0.2
CCP5 Summer School 2011:First-Principles Simulation
0
2
4
r
6
8
10
23 / 43
Plane-Wave Basis Sets
|G|<Gmax
Introduction
ψi,k (r) =
Total-energy calculations
X
cik,G ei(k+G).r)
G
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Sets
Plane-waves and
Pseudopotentials
Pros
•
•
•
•
•
•
•
Fourier Series expansion of ψ(r) : Fourier coefficients cik,G stored on regular grid of G.
Can use highly efficient FFT algorithms to transform between r -space and G-space
representations.
O(N 2 ) scaling of CPU time and memory allows for 100s of atoms.
Complete and Orthonormal. No BSSE or linear dependence.
Simple to evaluate forces, stresses and force-constants.
Not atom-centred ⇒ unbiased
Systematically improvable to convergence with single parameter Gmax .
How to solve the equations
Cons
•
•
•
Very large number of basis coefficients needed (10000 upwards). Impossible to store
Hamiltonian matrix.
Sharp features and nodes of ψ(r) of core electron prohibitively expensive to represent ⇒ need
pseudopotentials
Vacuum as expensive as atoms.
CCP5 Summer School 2011:First-Principles Simulation
24 / 43
Summary of Popular Basis Sets
Introduction
Total-energy calculations
Basis sets
• How to represent
wavefunctions
• Mathematical representation
of basis sets
• Gaussian basis set
• Gaussian Basis Sets
• Numerical Basis Sets
• Plane-wave basis set
• Plane-Wave Basis Sets
• Summary of Popular Basis
Sets
Plane-waves and
Pseudopotentials
GTOs “Gaussian-type orbitals” Very widely used in molecular calculations, also periodic because
integrals are analytic and can be tabulated. Atom-centering can be a disadvantage, giving rise to
additional terms in forces and biassing the calculation. Only small numbers of basis functions
needed per atom.
STOs: “Slater-type orbitals” atom-centred but uses eigenfunctions of atomic orbitals.
MTOs: “Muffin-Tin orbitals”. Atom centred using eigenfunctions in spherically-symmetric,
truncated potential (muffin-tin).
Plane Waves: Very widely used in solid-state calculations.
Formally equivalent to a Fourier series. Can use powerful Fourier methods including FFTs to
perform integrals. Ideally suited to periodic system. Unbiased by atom position. Systematically
improvable convergence by increasing Gmax .
APW “Augmented Plane Waves” a mixed basis set of spherical harmonics centred on atoms and
plane-waves in interstitial region. LAPW methods highly accurate but restricted to small systems.
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
25 / 43
Introduction
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
Plane-waves and Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
26 / 43
Plane-wave basis sets
Introduction
Total-energy calculations
•
•
See M. Payne et al Rev. Mod. Phys. 64, (1045) 1992
Expressed in terms of plane-wave coefficients cmk (G) the total KS energy is
Basis sets
EKS
Plane-waves and
Pseudopotentials
k
• Plane-wave basis sets
• The FFT Grid
• Advantages and
+
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
=
XXX
•
•
m
G
2
2
|G + k| |cmk (G)| +
X |n(G)|2
+
2
|G|
G6=0
Z
X
Vext (G)n(G)
G6=0
drn(r)εxc (n(r)) + EII ({RI })
There are only single sums over G or r which can therefore be evaluated in O(NG ) operations.
P
G runs over all |G + k| < Gmax . Assuming that cmk (G) decreases rapidly with G,
accuracy can be systematically improved by increasing Gmax .
It is common to quote plane-wave cutoff energy
h̄2 G2max
Ec =
2me
How to solve the equations
instead of Gmax .
CCP5 Summer School 2011:First-Principles Simulation
27 / 43
The FFT Grid
Introduction
•
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
•
Store cmk (G) and n(r) on 3-dimensional grid, and can use FFTs to map between real and
reciprocal-space. Example, density n(r) constructed as
P P
P
2 where u
n(r) = k occ
|u
(r)|
(r)
=
mk
mk
m
G cmk (G) exp(iG.r)
which requires 1 FFT for each band and k-point to transform umk (G) into real-space. To
P
compute Hartree and local, potential terms, we need n(G) =
r n(r) exp(−iG.r)
Need twice maximum grid dimension to store charge density as orbitals.
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
The FFT Grid
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
How to solve the equations
grid_scale
*2Gmax
2Gmax
≈ 4Gmax
CCP5 Summer School 2011:First-Principles Simulation
28 / 43
Advantages and disadvantages of plane-waves
Introduction
Total-energy calculations
•
Basis sets
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
•
•
•
•
•
Can systematically improve basis
set to full or desired level of convergence.
Unbiased basis set, independent of
nature of bonding.
Highly efficient Fourier methods
available for implementation.
O(N 2 ) scaling of CPU time and
memory allows for 100s of atoms.
Many plane-waves needed to model
rapid variations in electron density.
Vacuum is as expensive as atoms.
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
29 / 43
Pseudopotentials
Introduction
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
•
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
•
How to solve the equations
•
Steep
V (r) =
ionic
potential
near ion
− Ze
r
causes rapid oscillations
of φ(r).
High-frequency
Fourier
components need very
high energy plane-wave
cutoff.
Filled shells of core electrons are unperturbed by
crystalline environment.
All chemical bonding involves valence electrons
only.
CCP5 Summer School 2011:First-Principles Simulation
30 / 43
Pseudopotentials II
Introduction
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
•
• Plane-wave basis sets
• The FFT Grid
• Advantages and
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
How to solve the equations
•
•
•
•
•
Replace strong ionic potential with weaker
pseudopotential which gives identical valence electron wavefunctions outside core region, r > rc . This gives identical scattering
properties.
Pseudo-wavefunction has no nodes for r <
rc unlike true wavefunction.
Smooth φpseudo can be represented with few
plane waves.
Pseudopotentials imply the Frozen Core approximation
Ab-initio pseudopotentials are calculated
from all-electron DFT calculations on a single
atom.
Can be calculated using relativistic Dirac
equation incorporating relativity of core electrons into PSP. Valence electrons usually nonrelativistic.
CCP5 Summer School 2011:First-Principles Simulation
Ψps
Ψv10
10r
c
r
Vps
Z/r
31 / 43
Pseudopotential Technicalities
Introduction
Ionic pseudopotential: Ti
Total-energy calculations
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
•
•
Simple “local” potential VPS (r) insufficient for accurate description of most elements.
Almost always use nonlocal pseudopotential operator
VPS =
disadvantages of plane-waves
l,m
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
How to solve the equations
X
•
•
•
10
0
|Ylm > Vl (r) < Yl m|
where |Ylm > are spherical harmonics of angular momentum l.
Several
prescriptions
to
generate
pseudopotentials;
Hamman-Schluter,Chang,
Kerker,
TrouillerMartins,Optimised (Rappe), Vanderbilt.
Additional technicalities lead to norm-conserving vs ultrasoft.
Goal has been to get “smoothest” pseudo-wavefunctions to
reduce plane-wave cutoff energy. Vanderbilt ultrasoft pseudopotentials give lowest cutoff energies and high accuracy.
CCP5 Summer School 2011:First-Principles Simulation
20
-10
V_ion (Ryd)
Basis sets
-20
-30
-40
3s
3p
3d
2Z_eff/r
V_loc
-50
-60
-70
-80
0
1
2
3
R (Bohr)
4
32 / 43
Ultrasoft Pseudopotentials
Introduction
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
✬
•
•
Norm conservation ⇒ nodeless 2p, 3d, 4f states inevitably “hard”
Vanderbilt [PRB 41,7892(1990)] relax normconservation.
• Plane-wave basis sets
• The FFT Grid
• Advantages and
NL
V̂I
=
X
jk
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
✩
Fe 3d USP
Djk |βj i hβk |
with
Djk = Bjk + ǫj qjk
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
and
Qjk (r) = ψj∗,AE (r)ψkAE (r) − φj∗,PS (r)φPS
k (r)
How to solve the equations
✫
•
AE
AE
D
PS
qjk = ψj |ψk − φj |φk
Z rc
=
Qjk (r)dr
0
Qjk (r) are augmentation functions
CCP5 Summer School 2011:First-Principles Simulation
PS
E
✪
0
1
r (Bohr)
2
33 / 43
Ultrasoft Pseudopotentials
Introduction
With overlap operator Ŝ defined as
Total-energy calculations
Ŝ = 1̂ +
Basis sets
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
disadvantages of plane-waves
jk
qjk |βj i hβk |
orthonormality of ψ AE ⇒ S-orthonormality of ψ PS
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
X
AE
PS
= φj S φk = δjk
X
X
AE
ψj |ψk
D
PS The density acquires additional augmentation term
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
n(r) =
X
i
2
|φi (r)| +
ρjk Qjk (r); ρjk =
jk
i
hφi |βj i hβk |φi i
How to solve the equations
The K-S equations are transformed into generalised eigenvalue equations
Ĥφi = ǫi Ŝφi
What gain does this additional complexity give?
CCP5 Summer School 2011:First-Principles Simulation
34 / 43
Ultrasoft Pseudopotentials
Introduction
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
•
•
•
•
•
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
•
•
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
How to solve the equations
•
•
•
φPS can be made much smoother by dropping norm-conservation.
Charge density restored by augmentation.
Transferability restored by use of 2 or 3 projectors for each l
Quantities qjk , Bjk are just numbers and |βj (r)i required to construct Ŝ are similar to
norm-conserving projectors.
Only functions Qjk (r) have fine r-dependence, and they only appear when constructing
augmented charge density.
Everything except Qjk (r) easily transferred from atomic to grid-based plane wave code.
Vanderbilt USP ⇒ pseudize Qjk (r) at some rinner ≈ rc /2, preserving norm and higher
moments of charge density.
Blöchl PAW ⇒ add radial grids around each atom to represent Qjk (r) and naug (r)
In PW code add 2nd , denser FFT grid for naug (r) (and VH (r) - specified by parameter
fine_grid_scale.
Set fine_grid_scale= 2..4 depending on rc and rinner ; good guess is rc /rinner
CCP5 Summer School 2011:First-Principles Simulation
35 / 43
More Projectors
Introduction
Total-energy calculations
Basis sets
Multiple projectors ⇒ per angular momentum gives superior transferability.
d
log φ(r)) with is diagnostic
Comparison of all-electron- vs pseudo-atom logarithmic derivative ( dr
of transferability.
Plane-waves and
Pseudopotentials
• Plane-wave basis sets
• The FFT Grid
• Advantages and
disadvantages of plane-waves
• Pseudopotentials
• Pseudopotentials II
• Pseudopotential
Technicalities
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• Ultrasoft Pseudopotentials
• More Projectors
How to solve the equations
CCP5 Summer School 2011:First-Principles Simulation
36 / 43
Introduction
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
• Calculation Schemes 3:
Total Energy Minimization
• Calculation Schemes 4:
How to solve the equations
Car-Parrinelo Molecular
Dynamics
• Ab-initio MD Comparison
• Summary of important
concepts
CCP5 Summer School 2011:First-Principles Simulation
37 / 43
Calculation Schemes 1: SCF methods
Introduction
Choose initial
density n(r)
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
•
• Calculation Schemes 3:
Total Energy Minimization
• Calculation Schemes 4:
Car-Parrinelo Molecular
Dynamics
• Ab-initio MD Comparison
• Summary of important
•
concepts
•
K-S Hamiltonian is effective Hamiltonian
as Hartree term depends on electron
density n(r). But density depends on
orbitals, which in turn are eigenvectors of
Hamiltonian.
Need to find self-consistent solution
where cmk,i are eigenvalues of Hamiltonian matrix whose electron density is
constructed from cmk,i .
In practice never converges.
Construct
Hamiltonian
Hij
Eigenvalues
Converged?
Finished
Construct new
density n(r)
CCP5 Summer School 2011:First-Principles Simulation
38 / 43
Calculation Schemes 2: SCF with density mixing
Introduction
Choose initial
density n(r)
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
•
•
• Calculation Schemes 3:
Total Energy Minimization
• Calculation Schemes 4:
Car-Parrinelo Molecular
Dynamics
•
• Ab-initio MD Comparison
• Summary of important
concepts
•
•
Convergence may be stabilised by mixing
fraction of “new” density with density from
previous iteration.
Variety of more sophisticated mixing algorithms available, due to Pulay, Kerker,
Broyden.
Commonly used in Quantum Chemistry,
LAPW, LMTO, LCAO-GTO codes with
small basis set.
A plane-wave basis set contains 10,000+
coefficients ⇒ Hij is far too large to
store.
Don’t actually construct Hij ; use iterative solver to find only lowest-lying eigenvalues of occupied states(plus a few extra).
Construct
Hamiltonian
Hij
Eigenvalues
Converged?
Finished
Construct new
density n′ (r)
mix densities
n(n+1) = (1 − β)n(n) + βn′
CCP5 Summer School 2011:First-Principles Simulation
39 / 43
Calculation Schemes 3: Total Energy Minimization
Introduction
Total-energy calculations
•
•
Instead of solving matrix eigenvalue problem, exploit variational character of total energy.
Ground-state energy is function of plane-wave coefficients cmk (G) the total energy KS is
Basis sets
E
Plane-waves and
Pseudopotentials
k
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
• Calculation Schemes 3:
Total Energy Minimization
=
XXX
+
•
• Calculation Schemes 4:
Car-Parrinelo Molecular
Dynamics
m
G
2
2
|G + k| |cmk (G)| +
X |n(G)|2
+
2
|G|
G6=0
Z
X
Vext (G)n(G)
G6=0
drn(r)εxc (n(r)) + EII ({RI })
Vary coefficients to minimize energy using conjugate-gradient or other optimization methods
subject to constraint that orbitals are orthogonal
X
• Ab-initio MD Comparison
• Summary of important
c∗mk (G)cnk (G) = δmn
G
concepts
•
Can vary one band at a time, or all coefficients simultaneously, giving a all-bands method. See
M. Payne et al Rev. Mod. Phys. 64, 1045 (1992); M. Gillan J. Phys Condens. Matt. 1 689-711
(1989)
CCP5 Summer School 2011:First-Principles Simulation
40 / 43
Calculation Schemes 4: Car-Parrinelo Molecular Dynamics
Introduction
•
Total-energy calculations
Basis sets
•
In ground-breaking paper (Phys. Rev. Lett. 55, 2471 (1985) Car and Parrinello introduced an
extended-system method.
Add fictitious electron KE term to Hamiltonian. µ is fictitious mass.
Plane-waves and
Pseudopotentials
H
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
+
• Calculation Schemes 4:
concepts
X
X
m,n
Total Energy Minimization
• Ab-initio MD Comparison
• Summary of important
µ
m,k,G
• Calculation Schemes 3:
Car-Parrinelo Molecular
Dynamics
=
•
•
•
•
•
•
•
|ċnk (G)|2 +
Λmn
(
X
G
X1
Mi Ṙ2 + EKS (cnk (G, {Ri })
2
i
)
c∗mk (G)cnk (G) − δmn
Λm,n are Lagrange multipliers used to enforce orthogonality.
Treat cnk (G) as dynamic co-ordinates and time evolve using MD.
Nuclear and electronic co-ordinates are integrated simultaneously.
Fictitious mass µ is small compared to ion mass Mi , so electron and ion dynamics are
decoupled and exchange energy very slowly.
Electronic and ionic temperatures maintained in disequilibrium by separate thermostats.
Can apply damping to electronic KE to converge to ground-state.
If stable integrator such as Verlet used, procedure is stable enough to perform true
first-principles molecular dynamics simulations!
CCP5 Summer School 2011:First-Principles Simulation
41 / 43
Ab-initio MD Comparison
Introduction
•
Total-energy calculations
Two varieties of ab-initio molecular-dynamics
Born-Oppenheimer At each time-step solve for ground-state and evaluate forces.
Basis sets
•
•
Plane-waves and
Pseudopotentials
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
•
Car-Parrinello Evolve electronic system using fictitious MD
• Calculation Schemes 3:
Total Energy Minimization
•
•
•
• Calculation Schemes 4:
Car-Parrinelo Molecular
Dynamics
• Ab-initio MD Comparison
• Summary of important
concepts
Can use large timestep, eg 1fs to integrate ionic motion.
Use wavefunction “projection” methods to give good initial guess for next timestep based
on previous stored wavefunctions.
works for both insulating and metallic systems.
•
•
•
Need much smaller timestep to integrate electronic motion.
Computational effort at each timestep small - one evaluation of Hamiltonian.
Works poorly for metals.
Both methods can achieve comparable results if used carefully.
Can combine with barostats and thermostats to model our favourite ensembles.
Simulation times are 1000 times longer than using classical potentials!
CCP5 Summer School 2011:First-Principles Simulation
42 / 43
Summary of important concepts
Introduction
•
Total-energy calculations
Basis sets
Plane-waves and
Pseudopotentials
How to solve the equations
• Calculation Schemes 1:
SCF methods
• Calculation Schemes 2:
SCF with density mixing
•
•
•
•
•
The single-particle equations of Hartree, Hartree-Fock and Kohn-Sham density-functional
theory.
Electrons in periodic boundary conditions; reciprocal space and Brillouin-Zones.
Basis sets – atomic and plane-wave
Pseudopotentials
SCF methods.
ab-initio MD: Born-Oppenheimer vs Car-Parrinello
• Calculation Schemes 3:
Total Energy Minimization
• Calculation Schemes 4:
Car-Parrinelo Molecular
Dynamics
• Ab-initio MD Comparison
• Summary of important
concepts
CCP5 Summer School 2011:First-Principles Simulation
43 / 43