Content uploaded by Fernando Nogueira
Author content
All content in this area was uploaded by Fernando Nogueira
Content may be subject to copyright.
6 A Tutorial on Density Functional Theory
Fernando Nogueira
Fernando Nogueira
∗
, Alberto Castro
†
,
and Miguel A.L. Marques
‡
∗
Departamento de F´ısica,
Universidade de Coimbra,
Rua Larga, 3004 – 516, Coimbra, Portugal
fnog@teor.fis.uc.pt
†
Departamento de F´ısica Te´orica,
Universidad de Valladolid,
E–47011 Valladolid, Spain
alberto.castro@tddft.org
‡
Donostia International Physics Center (DIPC),
P. Manuel Lardiz´abal 4,
20080 San Sebasti´an, Spain
marques@tddft.org
6.1 Introduction
The success of density functional theory (DFT) is clearly demonstrated by the
overwhelming amount of research articles describing results obtained within
DFT that were published in the last decades. There is also a fair number of
books reviewing the basics of the theory and its extensions (e.g., the present
volume, [1] and [2]). These works fall mainly into three classes: those dealing
with the theory (proposing extensions, new functionals, etc.), those concerned
with the technical aspects of the numerical implementations, and others – the
vast majority – presenting results. In our opinion, any scientist working in
the ﬁeld should have a sound knowledge of the three classes. For example,
a theorist developing a new functional should be aware of the diﬃculties in
implementing it. Or the applied scientist, performing calculations on speciﬁc
systems, should know the limitations of the theory and of the numerical
implementation she/he is using. The goal of this chapter is to supply the
beginner with a brief pedagogical overview of DFT, combining the above
mentioned aspects. However, we will not review its foundations – we redirect
the reader to the chapter of J. Perdew and S. Kurth that opens this book.
Obviously, we will not be able to provide many details, but we hope that the
beginner obtains a general impression of the capabilities and limitations of
DFT.
This chapter is written in the form of a tutorial, combining basic theoret
ical and numerical aspects with speciﬁc examples, running from the simplest
hydrogen atom to more complex molecules and solids. For the examples we
used only freely available codes [3], so that the reader may easily reproduce
C. Fiolhais, F. Nogueira, M. Marques (Eds.): LNP 620, pp. 218–256, 2003.
c
SpringerVerlag Berlin Heidelberg 2003
6 A Tutorial on Density Functional Theory 219
the calculations. All input and output ﬁles can be found in the web site
http://www.tddft.org/DFT2001/. The chapter follows closely the outline
of the practical sessions held at Caramulo, during the DFT2001 summer
school. Some theoretical or numerical aspects that were required in the prac
tical sessions were, however, not covered by any of the lectures in Caramulo
(e.g., pseudopotentials). To ﬁll this gap we provide in this chapter a brief
account of some of them. We do not intend to discuss every possible numeric
implementation of DFT. In particular, we do not include any explicit exam
ple of a localized basis set DFT calculation. Neither do we intend to present
an extensive survey of the numerical aspects of each technique. We expect,
however, that the technical details given are suﬃcient to enable the reader
to perform himself the simulations presented herein.
The outline of the chapter is the following: We start, in Sect. 6.2, by
giving a technical overview on how to solve the KohnSham equations. The
next section is devoted to pseudopotentials, an essential ingredient of many
DFT calculations. In Sect. 6.4 we present our ﬁrst test case, namely atoms,
before we proceed to some planewave calculations in Sect. 6.5. The ﬁnal
example, methane calculated using a realspace implementation, is presented
in Sect. 6.6. We will use atomic units throughout this chapter, except when
explicitly stated otherwise.
6.2 Solving the Kohn–Sham Equations
6.2.1 Generalities
It is usually stated that the KohnSham equations are “simple” to solve. By
“simple” it is meant that for a given system, e.g., an atom, a molecule, or a
solid, the computational eﬀort to solve the KohnSham equations is smaller
than the one required by the traditional quantum chemistry methods, like
HartreeFock (HF) or conﬁguration interaction (CI)
1
. But it does not mean
that it is easy or quick to write, or even to use, a DFT based computer
program. Typically, such codes have several thousand lines (for example, the
ABINIT [4] package – a planewave DFT code – recently reached 200,000
lines) and hundreds of input options. Even writing a suitable input ﬁle is
often a matter of patience and experience.
In spite of their diﬀerences, all codes try to solve the KohnSham equations
−
∇
2
2
+ v
KS
[n](r)
ϕ
i
(r)=ε
i
ϕ
i
(r) . (6.1)
1
This statement has to be taken with care, for it certainly depends on the ap
proximation for the exchangecorrelation potential. For example, it holds when
using the localdensity approximation or any of the generalized gradient approx
imations. However, if we use the exact exchange functional, the calculations are
at least as computationally demanding as in HartreeFock.
220 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
n
0
(r)
v
KS
(r)
ˆ
H
KS
ϕ
i
(r)=ε
i
ϕ
i
(r)
n(r)=
i
ϕ
i
(r)
2
converged?
yes
no
end
Fig. 6.1. Flowchart depicting a generic KohnSham calculation
The notation v
KS
[n] means that the KohnSham potential, v
KS
, has a func
tional dependence on n, the electronic density, which is deﬁned in terms of
the KohnSham wavefunctions by
n(r)=
occ
i
ϕ
i
(r)
2
. (6.2)
The potential v
xc
is deﬁned as the sum of the external potential (normally
the potential generated by the nuclei), the Hartree term and the exchange
and correlation (xc) potential
v
KS
[n](r)=v
ext
(r)+v
Hartree
[n](r)+v
xc
[n](r) . (6.3)
Due to the functional dependence on the density, these equations form a set of
nonlinear coupled equations. The standard procedure to solve it is iterating
until selfconsistency is achieved. A schematic ﬂow chart of the scheme is
depicted in Fig. 6.1. Usually one supplies some model density, n
0
(r), to start
the iterative procedure. In principle, any positive function normalized to the
total number of electrons would work, but using an educated guess for n
0
(r)
can speedup convergence dramatically. For example, in a molecular or a
6 A Tutorial on Density Functional Theory 221
solidstate system one could construct n
0
(r) from a sum of atomic densities
n
0
(r)=
α
n
α
(r − R
α
) , (6.4)
where R
α
and n
α
represent the position and atomic density of the nucleus
α. For an atom, a convenient choice is the ThomasFermi density.
We then evaluate the KohnSham potential (see 6.3) with this density.
Each of the components of v
KS
is calculated separately and each of them
poses a diﬀerent numerical problem. The external potential is typically a
sum of nuclear potentials centered at the atomic positions,
v
ext
(r)=
α
v
α
(r − R
α
) . (6.5)
In some applications, v
α
is simply the Coulomb attraction between the bare
nucleus and the electrons, v
α
(r)=−Z
α
/r, where Z
α
is the nuclear charge.
In other cases the use of the Coulomb potential renders the calculation un
feasible, and one has to resort to pseudopotentials (see Sect. 6.3.1).
The next term in v
KS
is the Hartree potential,
v
Hartree
(r)=
d
3
r
n(r
)
r − r

. (6.6)
There are several diﬀerent techniques to evaluate this integral, either by direct
integration (as it is done when solving the atomic KohnSham equations), or
by solving the equivalent diﬀerential (Poisson’s) equation,
∇
2
v
Hartree
(r)=−4πn(r) . (6.7)
As the choice of the best technique depends on the speciﬁc problem, we defer
further discussion on the Hartree term to Sects. 6.2.2–6.2.4.
Finally, we have the xc potential, which is formally deﬁned through the
functional derivative of the xc energy,
v
xc
(r)=
δE
xc
δn(r)
. (6.8)
Perhaps more than a hundred approximate xc functionals have appeared in
the literature over the past 30 years. The ﬁrst to be proposed and, in fact,
the simplest of all, is the localdensity approximation (LDA). It is written as
E
LDA
xc
=
d
3
rε
HEG
(n)
n=n(r )
; v
LDA
xc
(r)=
d
dn
ε
HEG
(n)
n=n(r )
, (6.9)
where ε
HEG
(n) stands for the xc energy per unit volume of the homogeneous
electron gas (HEG) of (constant) density n. Note that ε
HEG
(n) is a simple
function of n, which was tabulated for several densities using Monte Carlo
222 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
methods by Ceperley and Alder [5]. A number of diﬀerent parameterizations
exist for this function, like the PZ81 [6] and PW92 [7]. It is clear from these
considerations that evaluating the LDA xc potential is as simple (and fast) as
evaluating any rational or transcendental function. In the case of the gener
alized gradient approximations (GGA) the functional has a similar form, but
now ε does not depend solely on the density n, but also on its gradient ∇n.
The evaluation of the GGA xc potential is also fairly straightforward. Finally,
we mention the third generation of density functionals, the orbitaldependent
functionals (see the chapter by E. Engel in this book) like the exact exchange
(EXX). In order to obtain the xc potential in this case, one is required to solve
an integral equation
2
. This equation is quite complex, and its solution can
easily become the most timeconsuming part of the KohnSham calculation.
We should also notice that functionals like the EXX involve the evaluation of
the socalled Coulomb integrals. These twocenter integrals, that also appear
in HartreeFock theory, pose another diﬃcult problem to the computational
physicist or chemist.
Now that we have the KohnSham potential, we can solve the KohnSham
equation (6.1). The goal is to obtain the p lowest eigenstates of the Hamilto
nian H
KS
, where p is half the number of electrons (for a spinunpolarized cal
culation). For an atom, or for any other case where the KohnSham equations
can be reduced to a onedimensional diﬀerential equation, a very eﬃcient in
tegration method is commonly employed (see below). In other cases, when
using basis sets, planewaves, or realspace methods, one has to diagonalize
the Hamiltonian matrix,
ˆ
H
KS
. We have to keep in mind that fully diago
nalizing a matrix is a q
3
problem, where q is the dimension of the matrix
(which is roughly proportional to the number of atoms in the calculation).
Moreover, the dimension of the Hamiltonian is sometimes of the order of
10
6
× 10
6
=10
12
elements
3
. It is clearly impossible to store such a matrix
in any modern computer. To circumvent these problems, one usually resorts
to iterative methods. In these methods it is never necessary to write the full
Hamiltonian – the knowledge of how
ˆ
H
KS
applies to a test wavefunction is
suﬃcient. These methods also scale much better with the dimension of the
matrix. Nonetheless, diagonalizing the KohnSham Hamiltonian is usually
the most timeconsuming part of an ordinary KohnSham calculation.
We have now all the ingredients to obtain the electronic density from (6.2).
The selfconsistency cycle is stopped when some convergence criterion is
reached. The two most common criteria are based on the diﬀerence of to
tal energies or densities from iteration i and i − 1, i.e., the cycle is stopped
when
E
(i)
− E
(i−1)
<η
E
or
d
3
r
n
(i)
− n
(i−1)
<η
n
, where E
(i)
and n
(i)
are the total energy and density at iteration i, and η
E
and η
n
are user deﬁned
tolerances. If, on the contrary, the criteria have not been fulﬁlled, one restarts
2
Or choose to apply the Krieger, Lee and Iafrate approximation [8].
3
However,
ˆ
H
KS
is usually a very sparse matrix. For example, in a typical realspace
calculation only less than.1 % of the elements of
ˆ
H are diﬀerent from 0.
6 A Tutorial on Density Functional Theory 223
the selfconsistency cycle with a new density. It could simply be the output
density of the previous cycle – unfortunately this would almost certainly lead
to instabilities. To avoid them, one usually mixes this output density with
densities from previous iterations. In the simplest scheme, linear mixing, the
density supplied to start the new iteration, n
(i+1)
is a linear combination of
the density obtained from (6.2), n
, and the density of the previous iteration,
n
(i)
,
n
(i+1)
= βn
+(1− β)n
(i)
, (6.10)
where the parameter β is typically chosen to be around 0.3. More sophisti
cated mixing schemes have been proposed (e.g., Anderson or Broyden mix
ing [9,10,11,12,13]), in which n
(i+1)
is an educated extrapolation of the den
sities of several previous iterations.
At the end of the calculation, we can evaluate several observables, the
most important of which is undoubtedly the total energy. From this quantity,
one can obtain, e.g., equilibrium geometries, phonon dispersion curves, or
ionization potentials. In KohnSham theory, the total energy is written as
E = −
occ
i
d
3
rϕ
∗
i
(r)
∇
2
2
ϕ
i
(r)+
d
3
rv
ext
(r)n(r)+
+
1
2
d
3
r
d
3
r
n(r)n(r
)
r − r

+ E
xc
, (6.11)
where the terms are respectively the noninteracting (KohnSham) kinetic
energy, the external potential, the Hartree and the xc energies. This formula
can be further simpliﬁed by using the KohnSham equation, (see 6.1), to yield
E =
occ
i
ε
i
−
d
3
r
1
2
v
Hartree
(r)+v
xc
(r)
n(r)+E
xc
. (6.12)
This is the formula implemented in most DFT codes. Note that, when per
forming geometry optimization or nuclear dynamics, one needs to add to
the total energy a repulsive Coulomb term that accounts for the interactions
between the ions
E
nn
=
α,β
Z
α
Z
β
R
α
− R
β

. (6.13)
Calculating the sum over all atoms is fairly straightforward for ﬁnite systems,
but nontrivial for extended systems: As the Coulomb interaction is very
long ranged, the (inﬁnite) sum in (6.13) is very slowly convergent. There is,
however, a technique due to Ewald that allows us to circumvent this problem
and evaluate (6.13) (see Sect. 6.2.3).
224 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
6.2.2 Atoms
In order to solve the KohnSham equations (6.1) for atoms, one normally
performs a spherical averaging of the density
4
. This averaging leads to a
spherically symmetric KohnSham potential. The Hartree potential is then
trivially evaluated as
v
Hartree
(r)=
4π
r
r
0
dr
r
2
n(r
)+4π
∞
r
dr
r
n(r
) . (6.14)
and the KohnSham wavefunctions can be written as the product of a radial
wavefunction, R
nl
(r), and a spherical harmonic, Y
lm
(θ, φ):
ϕ
i
(r)=R
nl
(r)Y
lm
(θ, φ) . (6.15)
The wavefunctions are labeled using the traditional atomic quantum num
bers: n for the principal quantum number and l, m for the angular momen
tum. The KohnSham equation then becomes a “simple” onedimensional
secondorder diﬀerential equation
−
1
2
d
2
dr
2
−
1
r
d
dr
+
l(l +1)
2r
2
+ v
KS
(r)
R
nl
(r)=ε
nl
R
nl
(r) , (6.16)
that can be transformed into two coupled ﬁrstorder diﬀerential equations
df
nl
(r)
dr
= g
nl
(r)
dg
nl
(r)
dr
+
2
r
g
nl
(r) −
l(l +1)
r
2
f
nl
(r)+2{ε
nl
− v
KS
(r)}f
nl
(r)=0,
(6.17)
where f
nl
(r) ≡ R
nl
(r).
When r →∞, the coupled equations become
df
nl
(r)
dr
= g
nl
(r)
dg
nl
(r)
dr
+2ε
nl
f
nl
(r) 0 ,
(6.18)
provided that the KohnSham potential goes to zero at large distances from
the atom (which it does, see Fig. 6.6). This indicates that the solutions of
(6.17) should behave asymptotically as
f
nl
(r)
r→∞
−→ e
−
√
−2ε
nl
r
(6.19)
g
nl
(r)
r→∞
−→ −
√
−2ε
nl
f
nl
(r) .
4
Although the assumption of a spherically symmetric potential (density) is only
strictly valid in a closed shell system, the true manybody potential is indeed
spherically symmetric. For open shell systems this assumption implies an identical
ﬁlling of all degenerate atomic orbitals.
6 A Tutorial on Density Functional Theory 225
At the origin (r → 0) the solutions are of the form
f
nl
(r)
r→0
−→ Ar
α
(6.20)
g
nl
(r)
r→0
−→ Br
β
.
Substituting (6.20) into (6.17) gives B = lA, α = l, and β = l − 1.
For a ﬁxed ε
nl
and A it is a simple task to integrate (6.17) from r =0to∞
using (6.20) to provide the initial values. However, if ε
nl
is not an eigenvalue
of (6.16), the solution will diverge (i.e., it will not obey boundary conditions
at inﬁnity (6.19)). Fortunately, there is a simple procedure to obtain the
ε
nl
that yield solutions with the correct asymptotic behavior. The technique
involves integrating (6.20) from r = 0 to a conveniently chosen point r
m
(e.g.,
the classical turning point), and at the same time integrating (6.20) starting
from a point very far away (“practical inﬁnity”, r
∞
)tor
m
. From the two
values of f
nl
(r
m
) and g
nl
(r
m
) obtained in this way, it is then possible to
improve our estimate of ε
nl
.
The technique for simultaneously ﬁnding the eigenvalues ε
nl
and the wave
functions proceeds as follows:
i) Choose an arbitrary value for ε
nl
and f
nl
(r
∞
);
ii) Calculate g
nl
(r
∞
) using the boundary conditions (6.19);
iii) Integrate (6.17) from r
∞
to r
m
(to get f
in
nl
(r) and g
in
nl
(r));
iv) Choose an arbitrary value for A, calculate B = lA, and use the boundary
conditions (6.20) to get f
nl
(0) and g
nl
(0);
v) Integrate (6.17) from 0 to r
m
(to get f
out
nl
(r) and g
out
nl
(r));
vi) Calculate γ = g
in
nl
(r
m
)/g
out
nl
(r
m
) and scale f
out
nl
(r) and g
out
nl
(r) by this factor
–nowg
nl
(r) is continuous at the matching point (˜g
out
nl
(r
m
) ≡ γg
out
nl
(r
m
)=
g
in
nl
(r
m
)) but f
nl
(r) is not;
vii) Compute δ(ε
nl
)=f
out
nl
(r
m
) − f
in
nl
(r
m
): The zeros of this function are the
eigenvalues, so one can ﬁnd them using, e.g., the bisection method (one
has to provide an educated guess for the minimum and maximum value of
the eigenvalues).
6.2.3 PlaneWaves
To calculate the total energy of solids, a planewave expansion of the Kohn
Sham wavefunctions is very useful, as it takes advantage of the periodicity of
the crystal [14,15,16]. For ﬁnite systems, such as atoms, molecules and clus
ters, planewaves can also be used in a supercell approach
5
. In this method,
5
The supercell technique is restricted in its usual form to neutral systems due
to the longrange interaction between a charged cluster and its periodic images:
the Coulomb energy for charged periodic systems diverges and must be removed.
Some common methods used to circumvent this diﬃculty are: i) To introduce a
compensating jellium background that neutralizes the supercell [17]; ii) To use
a cutoﬀ in the Coulomb interaction [18]; iii) To shield each charged cluster with
a spherical shell having a symmetric charge which neutralizes the supercell and
cancels the electric dipole of the charged cluster [19].
226 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
the ﬁnite system is placed in a unit cell of a ﬁctitious crystal, and this cell
is made large enough to avoid interactions between neighboring cells. The
KohnSham equations can then be solved, for any system, in momentum
space. However, for ﬁnite systems a very large number of planewaves is
needed as the electronic density is concentrated on a small fraction of the
total volume of the supercell.
The valence wavefunctions of the large Z atoms oscillate strongly in the
vicinity of the atomic core due to the orthogonalization to the inner electronic
wavefunctions. To describe these oscillations a large number of planewaves
is required, diﬃculting the calculation of the total energy. However, the inner
electrons are almost inert and are not signiﬁcantly involved in bonding. This
suggests the description of an atom based solely on its valence electrons,
which feel an eﬀective potential including both the nuclear attraction and
the repulsion of the inner electrons. This approximation, the pseudopotential
approximation, will be presented in more detail in Sect. 6.3.1.
When using the pseudopotential approximation, the external potential,
v
ext
, is simply the sum of the pseudopotentials of all the atoms in the system.
If atom α is located in the unit cell at τ
α
and its pseudopotential is w
α
(r, r
),
the external potential is
w(r, r
)=
j,α
w
α
(r − R
j
− τ
α
, r
− R
j
− τ
α
) , (6.21)
where R
j
are the lattice vectors. The pseudopotential is considered in its
more general nonlocal form, which implies that the second term of the right
hand side of (6.11) is rewritten as
d
3
rv
ext
(r)n(r) −→
N
i=1
d
3
r
d
3
r
ϕ
i
(r)w(r, r
)ϕ
∗
i
(r
) . (6.22)
According to Bloch’s theorem, the KohnSham wavefunctions, ϕ
k,n
(r),
can be written as
ϕ
k,n
(r)=e
ik·r
G
c
k,n
(G)e
iG·r
, (6.23)
where k is the wave vector, n the band index, and G are the reciprocal lattice
vectors. The KohnSham energies are ε
k,n
, and the electronic density is
n(r)=
k,n
G,G
f(ε
k,n
)c
∗
k,n
(G
)c
k,n
(G)e
i(G−G
)·r
, (6.24)
where the f(ε
k,n
) denote the occupation numbers. The Fourier transform of
the density is
n(G)=
k,n
G
f(ε
k,n
)c
∗
k,n
(G
− G)c
k,n
(G
) . (6.25)
6 A Tutorial on Density Functional Theory 227
The sums over k are performed over all Brillouin zone vectors, but can be
reduced to sums on the irreducible Brillouin zone by taking advantage of the
space group of the lattice
6
.
There are thus two convergence parameters that need to be ﬁnetuned for
every calculation: the Brillouin zone sampling and a cutoﬀ radius in reciprocal
space to truncate the sums over reciprocal lattice vectors (we cannot perform
inﬁnite summations!)
The kinetic energy is rewritten as
T =
1
2
k,n
G
f(ε
k,n
) c
k,n
(G)
2
k + G
2
, (6.26)
and the Hartree energy is given by
E
Hartree
=
Ω
2
G
v
Hartree
(G)n(G) , (6.27)
where Ω is the unit cell volume and the Hartree potential, v
Hartree
(G), is
obtained using Poisson’s equation
v
Hartree
(G)=4π
n(G)
G
2
. (6.28)
The electronion interaction energy, (6.22), is given by
E
ei
=
k,n
G,G
f(ε
k,n
)c
∗
k,n
(G)c
k,n
(G
)w(k + G, k + G
) , (6.29)
and the Fourier transform of the total pseudopotential is
w(k + G, k + G
)=
α
w
α
(k + G, k + G
)e
i(G−G
)·τ
α
. (6.30)
The Fourier transform of the individual pseudopotentials, v
α
(k, k
), can be
written in a simple form if the separable Kleinmnan and Bylander form is
used (see Sect. 6.3.8).
Both E
ei
(due to the local part of the pseudopotential) and the Hartree
potential diverge at G = 0. The ionion interaction energy, E
nn
, also diverges.
However, the sum of these three divergent terms is a constant, if the system
is electrically neutral. This constant is [14,15,16]
lim
G,G
→0
k,n
f(ε
k,n
)c
∗
k,n
(G)c
k,n
(G
)w(k + G, k + G
)+
+
Ω
2
v
Hartree
(G)n(G)
+ E
nn
= E
rep
+ E
Ewald
, (6.31)
6
To further simplify these sums, it is possible to do a smart sampling of the
irreducible Brillouin zone, including in the sums only some special k vec
tors [20,21,22,23].
228 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
where
E
rep
= Z
total
1
Ω
α
Λ
α
(6.32)
and
Λ
α
=
1
Ω
d
3
r
v
α,local
(r)+
Z
α
r
. (6.33)
In these expressions Z
α
is the electric charge of ion α, and v
α,local
(r)isthe
local part of the pseudopotential of atom α (equations (6.74) and (6.75)).
The nondivergent part of the ionion interaction energy, E
Ewald
, is calculated
using a trick due to Ewald [24]. One separates it in two parts, one shortranged
that is summed in real space, and a longrange part that is treated in Fourier
space. By performing this splitting, one transforms a slowly convergent sum
into two rapidly convergent sums
E
Ewald
=
1
2
α,α
Z
α
Γ
α,α
Z
α
, (6.34)
with the deﬁnition
Γ
α,α
=
4π
Ω
G=0
cos [G · (τ
α
− τ
α
)]
G
2
e
−
G
2
4η
2
+
+
j
erfc (η R
j
+ τ
α
− τ
α
)
R
j
+ τ
α
− τ
α

−
π
η
2
Ω
−
2η
√
π
δ
αα
. (6.35)
(erfc(x) is the complimentary error function.) Note that this term has only
to be evaluated once at the beginning of the selfconsistency cycle, for it does
not depend on the density. The parameter η is arbitrary, and is chosen such
that the two sums converge quickly.
In momentum space, the total energy is then
E
tot
= T + E
Hartree
+ E
ei
+ E
xc
+ E
Ewald
+ E
rep
, (6.36)
with the terms G, G
= 0 excluded from the Hartree and pseudopotential
contributions. Finally, the KohnSham equations become
G
ˆ
H
G,G
(k)c
k,n
(G
)=ε
k,n
c
k,n
(G) , (6.37)
where
ˆ
H
G,G
(k)=
1
2
k + G
2
δ
G,G
+
+ w(k + G, k + G
)+v
Hartree
(G − G
)+v
xc
(G − G
) , (6.38)
and are solved by diagonalizing the Hamiltonian.
6 A Tutorial on Density Functional Theory 229
6.2.4 RealSpace
In this scheme, functions are not expanded in a basis set, but sampled in
a realspace mesh [25]. This mesh is commonly chosen to be uniform (the
points are equally spaced in a cubic lattice), although other options are pos
sible. Convergence of the results has obviously to be checked against the grid
spacing. One big advantage of this approach is that the potential operator
is diagonal. The Laplacian operator entering the kinetic energy is discretized
at the grid points r
i
using a ﬁnite order rule,
∇
2
ϕ(r
i
)=
j
c
j
ϕ(r
j
) . (6.39)
For example, the lowest order rule in one dimension, the three point rule
reads
d
2
dr
2
ϕ(r)
r
i
=
1
4
[ϕ(r
i−1
) − 2ϕ(r
i
)+ϕ(r
i+1
)] . (6.40)
Normally, one usesa7or9pointrule.
Another important detail is the evaluation of the Hartree potential. It
cannot be eﬃciently obtained by direct integration of (6.6). There are however
several other options: (i) solving Poisson’s equation, (6.7), in Fourier space –
as in the planewave method; (ii) recasting (6.7) into a minimization problem
and applying, e.g., a conjugate gradients technique; (iii) using multigrid
methods [25,26,27]. The last of the three is considered to be the most eﬃcient
technique.
In our opinion, the main advantage of realspace methods is the simplic
ity and intuitiveness of the whole procedure. First of all, quantities like the
density or the wavefunctions are very simple to visualize in real space. Fur
thermore, the method is fairly simple to implement numerically for 1, 2,
or 3dimensional systems, and for a variety of diﬀerent boundary conditions.
For example, one can study a ﬁnite system, a molecule, or a cluster without
the need of a supercell, simply by imposing that the wavefunctions are zero
at a surface far enough from the system. In the same way, an inﬁnite system,
a polymer, a surface, or bulk material can be studied by imposing the appro
priate cyclic boundary conditions. Note also that in the realspace method
there is only one convergence parameter, namely the gridspacing.
Unfortunately, realspace methods suﬀer from a few drawbacks. For ex
ample, most of the realspace implementations are not variational, i.e., we
may ﬁnd a total energy lower than the true energy, and if we reduce the grid
spacing the energy can actually increase. Moreover, the grid breaks transla
tional symmetry, and can also break other symmetries that the system may
possess. This can lead to the artiﬁcial lifting of some degeneracies, to the
appearance of spurious peaks in spectra, etc. Of course all these problems
can be minimized by reducing the gridspacing.
230 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
6.3 Pseudopotentials
6.3.1 The Pseudopotential Concept
The manyelectron Schr¨odinger equation can be very much simpliﬁed if elec
trons are divided in two groups: valence electrons and inner core electrons.
The electrons in the inner shells are strongly bound and do not play a sig
niﬁcant role in the chemical binding of atoms, thus forming with the nucleus
an (almost) inert core. Binding properties are almost completely due to the
valence electrons, especially in metals and semiconductors.
This separation suggests that inner electrons can be ignored in a large
number of cases, thereby reducing the atom to a ionic core that interacts
with the valence electrons. The use of an eﬀective interaction, a pseudo
potential, that approximates the potential felt by the valence electrons, was
ﬁrst proposed by Fermi in 1934 [28]. Hellmann in 1935 [29] suggested that
the form
w(r)=−
1
r
+
2.74
r
e
−1.16r
(6.41)
could represent the potential felt by the valence electron of potassium. In
spite of the simpliﬁcation pseudopotentials introduce in calculations, they
remained forgotten until the late 50’s. It was only in 1959, with Phillips and
Kleinman [30,31,32], that pseudopotentials began to be extensively used.
Let the exact solutions of the Schr¨odinger equation for the inner electrons
be denoted by ψ
c
, and ψ
v
those for the valence electrons. Then
ˆ
Hψ
n
= E
n
ψ
n
, (6.42)
with n = c, v. The valence orbitals can be written as the sum of a smooth
function (called the pseudo wavefunction), ϕ
v
, with an oscillating function
that results from the orthogonalization of the valence to the inner core orbitals
ψ
v
= ϕ
v
+
c
α
cv
ψ
c
, (6.43)
where
α
cv
= −ψ
c
ϕ
v
. (6.44)
The Schr¨odinger equation for the smooth orbital ϕ
v
leads to
ˆ
Hϕ
v
= E
v
ϕ
v
+
c
(E
c
− E
v
)ψ
c
ψ
c
ϕ
v
. (6.45)
This equation indicates that states ϕ
v
satisfy a Schr¨odingerlike equation
with an energydependent pseudoHamiltonian
ˆ
H
PK
(E)=
ˆ
H −
c
(E
c
− E)ψ
c
ψ
c
 . (6.46)
6 A Tutorial on Density Functional Theory 231
It is then possible to identify
ˆw
PK
(E)=ˆv −
c
(E
c
− E)ψ
c
ψ
c
 , (6.47)
where ˆv is the true potential, as the eﬀective potential in which valence
electrons move. However, this pseudopotential is nonlocal and depends on
the eigenenergy of the electronic state one wishes to ﬁnd.
At a certain distance from the ionic core ˆw
PK
becomes ˆv due to the decay
of the core orbitals. In the region near the core, the orthogonalization of the
valence orbitals to the strongly oscillating core orbitals forces valence elec
trons to have a high kinetic energy (The kinetic energy density is essentially a
measure of the curvature of the wavefunction.) The valence electrons feel an
eﬀective potential which is the result of the screening of the nuclear potential
by the core electrons, the Pauli repulsion and xc eﬀects between the valence
and core electrons. The second term of (6.47) represents then a repulsive po
tential, making the pseudopotential much weaker than the true potential in
the vicinity of the core. All this implies that the pseudo wavefunctions will
be smooth and will not oscillate in the core region, as desired.
A consequence of the cancellation between the two terms of (6.47) is
the surprisingly good description of the electronic structure of solids given
by the nearlyfree electron approximation. The fact that many metal and
semiconductor band structures are a small distortion of the free electron gas
band structure suggests that the valence electrons do indeed feel a weak
potential. The Phillips and Kleinman potential explains the reason for this
cancellation.
The original pseudopotential from Hellmann (6.41) can be seen as an
approximation to the Phillips and Kleinman form, as in the limit r →∞the
last term can be approximated as Ae
−r/R
, where R is a parameter measuring
the core orbitals decay length.
The Phillips and Kleinman potential was later generalized [33,34] to
ˆw =ˆv +
c
ψ
c
ξ
c
 , (6.48)
where ξ
c
is some set of functions.
The pseudopotential can be cast into the form
w(r, r
)=
l
l
m=−l
Y
∗
lm
(ˆr)w
l
(r, r
)Y
lm
(ˆr
) , (6.49)
where Y
lm
are the spherical harmonics. This expression emphasizes the fact
that w as a function of r and r
depends on the angular momentum. The most
usual forms for w
l
(r, r
) are the separable Kleinman and Bylander form [35]
w
l
(r, r
)=v
l
(r)v
l
(r
) , (6.50)
232 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
and the semilocal form
w
l
(r, r
)=w
l
(r)δ(r −r
) . (6.51)
6.3.2 Empirical Pseudopotentials
Until the late 70’s the method employed to construct a pseudopotential
was based on the Phillips and Kleinman cancellation idea. A model analytic
potential was constructed and its parameters were ﬁtted to experimental
data. However, these models did not obey condition (6.43).
One of the most popular model potentials was introduced by Heine and
Abarenkov in 1964 [36,37,38]. The HeineAbarenkov potential is
w
HA
(r)=
−z/r ,ifr>R
−A
l
ˆ
P
l
,ifr ≤ R,
(6.52)
with
ˆ
P
l
an angular momentum projection operator. The parameters A
l
were
adjusted to the excitation energies of valence electrons and the parameter
R is chosen, for example, to make A
0
and A
1
similar (leading to a local
pseudopotential for the simple metals).
A simpliﬁcation of the HeineAbarenkov potential was proposed in 1966
by Ashcroft [39,40]
w
A
(r)=
−z/r ,ifr>R
0,ifr ≤ R.
(6.53)
In this model potential it is assumed that the cancellation inside the core is
perfect, i.e., that the kinetic term cancels exactly the Coulomb potential for
r<R. To adjust R, Ashcroft used data on the Fermi surface and on liquid
phase transport properties.
The above mentioned and many other model potentials are discontinuous
at the core radius. This discontinuity leads to longrange oscillations of their
Fourier transforms, hindering their use in planewave calculations. A recently
proposed model pseudopotential overcomes this diﬃculty: the evanescent
core potential of Fiolhais et al. [41]
w
EC
(r)=−
z
R
1
x
1 − (1 + βx) exp
−αx
− A exp
−x
, (6.54)
with x = r/R, where R is a decay length and α>0. Smoothness of the
potential and the rapid decay of its Fourier transform are guaranteed by
imposing that the ﬁrst and third derivatives are zero at r = 0, leaving only two
parameters to be ﬁtted (α and R). These are chosen by imposing one of several
conditions [41,42,43,44,45,46]: total energy of the solid is minimized at the
observed electron density; the average interstitial electron density matches
the allelectron result; the bulk moduli match the experimental results; etc.
6 A Tutorial on Density Functional Theory 233
Although not always bringing great advances, several other model poten
tials were proposed [47,48,49]. Also, many diﬀerent methods for adjusting
the parameters were suggested [50]. The main application of these model
potentials was to the theory of metallic cohesion [51,52,53,54,55].
6.3.3 Abinitio Pseudopotentials
A crucial step toward more realistic pseudopotentials was given by Topp
and Hopﬁeld [49,56], who suggested that the pseudopotential should be ad
justed such that they describe the valence charge density accurately. Based
on that idea, modern pseudopotentials are obtained inverting the free atom
Schr¨odinger equation for a given reference electronic conﬁguration [57], and
forcing the pseudo wavefunctions to coincide with the true valence wave
functions beyond a certain distance r
l
. The pseudo wavefunctions are also
forced to have the same norm as the true valence wavefunctions.
These conditions can be written as
R
PP
l
(r)=R
AE
nl
(r),ifr>r
l
r
l
0
dr
R
PP
l
(r)
2
r
2
=
r
l
0
dr
R
AE
nl
(r)
2
r
2
,ifr<r
l
,
(6.55)
where R
l
(r) is the radial part of the wavefunction with angular momentum l,
and PP and AE denote, respectively, the pseudo wavefunction and the true
(allelectron) wavefunction. The index n in the true wavefunctions denotes
the valence level. The distance beyond which the true and the pseudo wave
functions are equal, r
l
, is also ldependent.
Besides (6.55), there are still two other conditions imposed on the pseudo
potential: the pseudo wavefunctions should not have nodal surfaces and the
pseudo energyeigenvalues should match the true valence eigenvalues, i.e.,
ε
PP
l
= ε
AE
nl
. (6.56)
The potentials thus constructed are called normconserving pseudopoten
tials, and are semilocal potentials that depend on the energies of the reference
electronic levels, ε
AE
l
.
In summary, to obtain the pseudopotential the procedure is: i) The free
atom KohnSham radial equations are solved taking into account all the
electrons, in some given reference conﬁguration
−
1
2
d
2
dr
2
+
l(l +1)
2r
2
+ v
AE
KS
n
AE
(r)
rR
AE
nl
(r)=ε
AE
nl
rR
AE
nl
(r) , (6.57)
where a spherical approximation to Hartree and exchange and correlation
potentials is assumed and relativistic eﬀects are not considered. The Kohn
Sham potential, v
AE
KS
, is given by
v
AE
KS
n
AE
(r)=−
Z
r
+ v
Hartree
n
AE
(r)+v
xc
n
AE
(r) . (6.58)
234 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
ii) Using normconservation (6.55), the pseudo wavefunctions are deter
mined. Their shape in the region r<r
l
needs to be previously deﬁned, and
it is here that many modern potentials diﬀer from one another. iii) Knowing
the pseudo wavefunction, the pseudopotential results from the inversion of
the radial KohnSham equation for the pseudo wavefunction and the valence
electronic density
w
l,scr
(r)=ε
PP
l
−
l(l +1)
2r
2
+
1
2rR
PP
l
(r)
d
2
dr
2
rR
PP
l
(r)
. (6.59)
The resulting pseudopotential, w
l,scr
, still includes screening eﬀects due to
the valence electrons that have to be subtracted to yield
w
l
(r)=w
l,scr
(r) − v
Hartree
n
PP
(r) − v
xc
n
PP
(r) . (6.60)
The cutoﬀ radii, r
l
, are not adjustable pseudopotential parameters. The
choice of a given set of cutoﬀ radii establishes only the region where the
pseudo and true wavefunctions coincide. Therefore, the cutoﬀ radii can be
considered as a measure of the quality of the pseudopotential. Their smallest
possible value is determined by the location of the outermost nodal surface of
the true wavefunctions. For cutoﬀ radii close to this minimum, the pseudo
potential is very realistic, but also very strong. If very large cutoﬀ radii are
chosen, the pseudopotentials will be smooth and almost angular momentum
independent, but also very unrealistic. A smooth potential leads to a fast
convergence of planewave basis calculations [58]. The choice of the ideal
cutoﬀ radii is then the result of a balance between basisset size and pseudo
potential accuracy.
6.3.4 Hamann Potential
One of the most used parameterizations for the pseudo wavefunctions is
the one proposed in 1979 by Hamann, Schl¨uter, and Chiang [59] and later
improved by Bachelet, Hamann and Schl¨uter [60] and Hamann [61].
The method proposed consists of using an intermediate pseudopotential,
¯w
l
(r), given by
¯w
l
(r)+v
Hartree
n
PP
(r)+v
xc
n
PP
(r)=
= v
AE
KS
n
AE
(r)
1 − f
r
r
l
+ c
l
f
r
r
l
, (6.61)
where f (x)=e
−x
λ
, and λ =4.0 [59] or λ =3.5 [60,61]. The KohnSham
equations are solved using this pseudopotential, and the constants c
l
are
adjusted in order to obey (6.56). Notice that the form of the wavefunctions
implies that (6.55) is veriﬁed for some ˜r
l
>r
l
. As the two eﬀective potentials
are identical for r>˜r
l
, and given the fast decay of f(x), the intermediate
6 A Tutorial on Density Functional Theory 235
1.00 2.00 3.00 4.00
r (bohr)
0.40
0.00
0.40
0.80
rR(r)
True wave function (l=0)
True wave function (l=1)
True wave function (l=2)
Pseudo wave function (l=0)
Pseudo wave function (l=1)
Pseudo wave function (l=2)
0.00 1.00 2.00 3.00
r (bohr)
2.00
1.50
1.00
0.50
0.00
0.50
V
l
(r) (hartree)
Pseudopotential (l=0)
Pseudopotential (l=1)
Pseudopotential (l=2)
z/r
Fig. 6.2. Hamann pseudopotential for Al, with r
0
=1.24, r
1
=1.54, and
r
2
=1.40 bohr: pseudo wavefunctions vs. true wavefunctions (left) and pseudo
potentials (right)
pseudo wavefunctions,
¯
R
l
(r), coincide, up to a constant, with the true wave
functions in that region.
In the method proposed by Hamann [61], the parameters c
l
are adjusted
so that
d
dr
ln
rR
AE
nl
(r)
r=˜r
l
=
d
dr
ln
r
¯
R
l
(r)
r=˜r
l
. (6.62)
This way, the method is not restricted to bound states.
To impose normconservation, the ﬁnal pseudo wavefunctions, R
PP
l
(r),
are deﬁned as a correction to the intermediate wavefunctions
R
PP
l
(r)=γ
l
¯
R
l
(r)+δ
l
g
l
(r)
, (6.63)
where γ
l
is the ratio R
AE
nl
(r)/
¯
R
l
(r) in the region where r>˜r
l
and g
l
(r)=
r
l+1
f(r/r
l
). The constants δ
l
are adjusted to conserve the norm.
Figure 6.2 shows the Hamann pseudopotential for Al, with r
0
=1.24,
r
1
=1.54 and r
2
=1.40 bohr. Note that the true and the pseudo wave
functions do not coincide at r
l
– this only happens at r>˜r
l
.
6.3.5 Troullier–Martins Potential
A diﬀerent method to construct the pseudo wavefunctions was proposed by
Troullier and Martins [58,62], based on earlier work by Kerker [63]. This
method is much simpler than Hamann’s and emphasizes the desired smooth
ness of the pseudopotential (although it introduces additional constraints to
obtain it). It achieves softer pseudopotentials for the 2p valence states of the
ﬁrst row elements and for the d valence states of the transition metals. For
other elements both methods produce equivalent potentials.
The pseudo wavefunctions are deﬁned as
R
PP
l
(r)=
R
AE
nl
(r),ifr>r
l
r
l
e
p(r)
,ifr<r
l
,
(6.64)
236 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
1.00 2.00 3.00 4.00
r (bohr)
0.40
0.20
0.00
0.20
0.40
0.60
rR(r)
True wave function (l=0)
True wave function (l=1)
Pseudo wave function (l=0)
Pseudo wave function (l=1)
0.00 1.00 2.00 3.00
r (bohr)
3.00
2.00
1.00
0.00
V
l
(r) (hartree)
Pseudopotential (l=0)
Pseudopotential (l=1)
Pseudopotential (l=2)
z/r
Fig. 6.3. TroullierMartins pseudopotential for Al, with r
0
= r
1
= r
2
=2.60 bohr:
pseudo wavefunctions vs. true wavefunctions (left) and pseudopotentials (right)
with
p(r)=c
0
+ c
2
r
2
+ c
4
r
4
+ c
6
r
6
+ c
8
r
8
+ c
10
r
10
+ c
12
r
12
. (6.65)
The coeﬃcients of p(r) are adjusted by imposing normconservation, the con
tinuity of the pseudo wavefunctions and their ﬁrst four derivatives at r = r
l
,
and that the screened pseudopotential has zero curvature at the origin. This
last condition implies that
c
2
2
+ c
4
(2l +5)=0, (6.66)
and is the origin of the enhanced smoothness of the Troullier and Martins
pseudopotentials.
Figure 6.3 shows the Troullier and Martins pseudopotential for Al, with
r
0
= r
1
= r
2
=2.60 bohr. The 3d wavefunctions are not shown since the
state is unbound for this potential.
There are many other not so widely used normconserving pseudopo
tentials [64,65,66,67,68]. Note that, in some cases, normconservation was
abandoned in favor of increased pseudopotential smoothness [69].
6.3.6 Nonlocal Core Corrections
It is tempting to assume that the KohnSham potential depends linearly on
the density, so that the unscreening of the pseudopotential can be performed
as in (6.60). Unfortunately, even though the Hartree contribution is indeed
linearly dependent on the density, the xc term is not
v
xc
n
AE
(r) ≡ v
xc
n
core
+ n
PP
(r) (6.67)
= v
xc
[n
core
](r)+v
xc
n
PP
(r) .
In some cases, like the alkali metals, the use of a nonlinear corevalence xc
scheme may be necessary to obtain a transferable pseudopotential. In these
6 A Tutorial on Density Functional Theory 237
cases, the unscreened potential is redeﬁned as
w
l
(r)=w
l,scr
(r) − v
Hartree
n
PP
(r) − v
xc
˜n
core
+ n
PP
(r) , (6.68)
and the core density is supplied together with the pseudopotential. In a code
that uses pseudopotentials, one has simply to add the valence density to the
given atomic core density to obtain the xc potential. To avoid spoiling the
smoothness of the potential with a rugged core density, usually a partial core
density [70,71], ˜n
core
, is built and supplied instead of the true core density
˜n
core
(r)=
n
core
(r) for r ≥ r
nlc
P (r) for r<r
nlc
. (6.69)
The polynomial P (r) decays monotonically and has vanishing ﬁrst and second
derivatives at the origin. At r
nlc
it joins smoothly the true core density (it is
continuous up to the third derivative). The core cutoﬀ radius, r
nlc
, is typically
chosen to be the point where the true atomic core density becomes smaller
that the atomic valence density. It can be chosen to be larger than this value
but if it is too large the description of the nonlinearities may suﬀer. Note
that, as the word partial suggests,
r
nlc
0
dr ˜n
core
(r) r
2
<
r
nlc
0
drn
core
(r) r
2
. (6.70)
These corrections are more important for the alkali metals and other
elements with few valence electrons and core orbitals extending into the tail
of the valence density (e.g., Zn and Cd).
In some cases, the use of the generalized gradient approximation (GGA)
for exchange and correlation leads to the appearance of very shortranged
oscillations in the pseudopotentials (see Fig. 6.4). These oscillations are ar
tifacts of the GGA that usually disappear when nonlocal core corrections
are considered. Nevertheless, they do not pose a real threat for planewave
calculations, since they are mostly ﬁltered out by the energy cutoﬀ.
6.3.7 Pseudopotential Transferability
A useful pseudopotential needs to be transferable, i.e., it needs to describe
accurately the behavior of the valence electrons in several diﬀerent chemical
environments. The logarithmic derivative of the pseudo wavefunction deter
mines the scattering properties of the pseudopotential. Normconservation
forces these logarithmic derivatives to coincide with those of the true wave
functions for r>r
l
. In order for the pseudopotential to be transferable, this
equality should hold at all relevant energies, and not only at the energy, ε
l
,
for which the pseudopotential was adjusted. Normconservation assures that
this is fulﬁlled for the nearby energies, as [49,72]
d
dε
l
d
dr
ln R
l
(r)
r=R
= −
2
r
2
R
2
l
(r)
R
0
dr R
l
(r)
2
r
2
. (6.71)
238 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
0.50
1.00
1.50
2.00
r (bohr)
30
20
10
0
V
l
(r) (hartree)
LDA
GGA
l=0
l=1
l=2
Fig. 6.4. TroullierMartins pseudopotential for Cu, with r
0
= r
2
=2.2 and r
1
=
2.4 bohr. Notice that the LDA and GGA pseudopotential are essentially identical,
the main diﬀerence being the GGA potential oscillations near the origin
It is however necessary to take into account that the environment sur
rounding the electrons can be diﬀerent from the one in the reference situation.
Thus, although the pseudopotential remains the same, the eﬀective potential
changes (the Hartree and xc potentials depend on the density). Therefore,
the logarithmic derivative is not an absolute test of the transferability of a
pseudopotential [73]. The ideal method to assess the transferability of a po
tential consists in testing it in diverse chemical environments. The most usual
way of doing this is to test its transferability to other atomic conﬁgurations
and even to the ionized conﬁgurations. The variation of the total energy of
the free atom with the occupancy of the valence orbitals is another test of
transferability [74]. As the potential is generated for a given reference elec
tronic conﬁguration, it can be useful to choose the conﬁguration that best
resembles the system of interest [61]. However, the potential does not (should
not) depend too much on the reference conﬁguration.
6.3.8 Kleinman and Bylander Form of the Pseudopotential
The semilocal form of the pseudopotentials described above leads to a com
plicated evaluation of their action on a wavefunction
r  ˆwΨ =
d
3
r
w(r, r
)Ψ(r
)=
=
l
l
m=−l
Y
lm
(ˆr)w
l
(r)
d
3
r
δ(r −r
)Y
∗
lm
(ˆr
)Ψ(r
) . (6.72)
Unfortunately, the last integral must be calculated for each r. In a planewave
expansion, this involves the product of an N
PW
×N
PW
matrix with the vector
6 A Tutorial on Density Functional Theory 239
representing the wavefunction. This operation is of order N
PW
×N
PW
, and
N
PW
, the number of planewaves in the basis set, can be very large.
The semilocal potential can be rewritten in a form that separates long and
short range components. The long range component is local, and corresponds
to the Coulomb tail. Choosing an arbitrary angular momentum component
(usually the most repulsive one) and deﬁning
∆w
l
(r)=w
l
(r) − w
local
(r) . (6.73)
the pseudopotential can be written as
w(r, r
)=w
local
(r)+
l
∆w
l
(r)
l
m=−l
Y
∗
lm
(ˆr
)Y
lm
(ˆr)δ(r −r
) . (6.74)
Kleinman and Bylander [35] suggested that the nonlocal part of (6.74) are
written as a separable potential, thus transforming the semilocal potential
into a truly nonlocal pseudopotential. If ϕ
lm
(r)=R
PP
l
(r)Y
lm
(ˆr) denotes
the pseudo wavefunctions obtained with the semilocal pseudopotential, the
Kleinman and Bylander (KB) form is given by
w
KB
(r, r
)=w
local
(r)+
l
∆w
KB
l
(r, r
)=
= w
local
(r)+
l
l
m=−l
ϕ
lm
(r)∆w
l
(r)∆w
l
(r
)ϕ
lm
(r
)
d
3
r∆w
l
(r) ϕ
lm
(r)
2
, (6.75)
which is, in fact, easier to apply than the semilocal expression.
The KB separable form has, however, some disadvantages, leading some
times to solutions with nodal surfaces that are lower in energy than solutions
with no nodes [75,76]. These (ghost) states are an artifact of the KB proce
dure. To eliminate them one can use a diﬀerent component of the pseudo
potential as the local part of the KB form or choose a diﬀerent set of core radii
for the pseudopotential generation. As a rule of thumb, the local component
of the KB form should be the most repulsive pseudopotential component.
For example, for the Cu potential of Fig. 6.4, the choice of l = 2 as the local
component leads to a ghost state, but choosing instead l = 0 remedies the
problem.
6.4 Atomic Calculations
As our ﬁrst example we will present several atomic calculations. These sim
ple systems will allow us to gain a ﬁst impression of the capabilities and
limitations of DFT. To solve the KohnSham equations we used the code of
J. L. Martins [77]. The results are then compared to HartreeFock calculations
performed with GAMESS [78]. As an approximation to the xc potential, we
240 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
Table 6.1. Ionization potentials calculated either by taking the diﬀerence of to
tal energies between the neutral and the singly ionized atom (diﬀ.), or from the
eigenvalue of the highest occupied orbital (HOMO). We note that in the case of
HartreeFock, −ε
HOMO
is only an approximation to the ionization potential
LDA GGA HartreeFock
atom diﬀ. −ε
HOMO
diﬀ. −ε
HOMO
diﬀ. −ε
HOMO
expt.
H 0.479 0.269 0.500 0.279 0.500 0.500 0.500
Ar 0.586 0.382 0.581 0.378 0.543 0.590 0.579
Hg 0.325 0.205 0.311 0.194 0.306 0.320 0.384
Hg (rel) 0.405 0.261 0.391 0.249 0.320 0.384
took the LDA, in the parameterization of Perdew and Zunger [6], and one
GGA, ﬂavor Perdew, Becke and Ernzerhof [79]. Furthermore, all calculations
were done within the spinpolarized version of DFT.
The simplest atom one can study is hydrogen. As hydrogen has only one
electron, its groundstate can be obtained analytically. One could expect that
DFT yields precise results for such a trivial case. Surprisingly this is not true
for several of the functionals currently in use, such as the LDA or most of the
GGAs. In Table 6.1 we present calculations of the ionization potential (IP)
for hydrogen. We note that in KohnSham theory there are at least two
ways to determine this quantity: (i) The eigenvalue of the highest occupied
KohnSham state is equal to minus the ionization potential, IP = −ε
HOMO
;
(ii) By using the deﬁnition of the IP as the diﬀerence of total energies, IP =
E(X
+
)−E(X), where X is the atomic species. Even though the IPs calculated
from (ii) come out fairly well for both LDA and GGA (the GGA are, in fact,
slightly better), the −ε
HOMO
are far too small, almost by a factor of two.
On the other hand, HartreeFock is exact for this oneelectron problem. To
explain this discrepancy we have to take a closer look at the xc potential. As
hydrogen has only one electron, the KohnSham potential has to reduce to
the external potential, −1/r. This implies that the xc for hydrogen is simply
v
xc
(r)=−v
Hartree
(r). More precisely, it is the exchange potential that cancels
the Hartree potential, while the correlation is zero. In the LDA and the GGA,
neither of these conditions is satisﬁed. It is, however, possible to solve the
hydrogen problem exactly within DFT by using some more sophisticated
xc potentials, like the exact exchange [80], or the selfinteraction corrected
LDA [6] functionals.
Our ﬁrst manyelectron example is argon. Argon is a noble gas with the
closed shell conﬁguration 1s
2
2s
2
2p
6
3s
2
3p
6
, so its groundstate is spherical.
In Fig. 6.5 we plot the electron density for this atom as a function of the dis
tance to the nucleus. The function n(r) decays monotonically, with very little
structure, and is therefore not a very elucidative quantity to behold. However,
if we choose to represent r
2
n(r), we can clearly identify the shell structure
of the atom: Three maxima, corresponding to the center of the three shells,
6 A Tutorial on Density Functional Theory 241
0.001 0.01 0.1 1
r (bohr)
0.2
0.4
0.6
0.8
1
4π r
2
n(r)/N
Ar (GGA)
Hg (GGA)
Hg (Rel. GGA)
Fig. 6.5. Radial electronic density of the argon and mercury atoms versus the
distance to the nucleus. Both the solid and dashed curves were obtained using the
GGA to approximate the xc potential. For comparison the density resulting from a
relativistic GGA calculation for mercury is also shown. The density is normalized
so that the area under each curve is 1
0.01 0.1 1 10 100
r (bohr)
100
50
0
Energy (hartree)
v
xc
(LDA)
v
xc
(GGA)
v
Hartree
v
ext
v
KS
Fig. 6.6. LDA and GGA xc potentials for the argon atom. The dasheddotted line
corresponds to minus the Hartree potential evaluated with the GGA density. The
LDA Hartree potential is however indistinguishable from this curve. Furthermore,
the dashed line represents the argon nuclear potential, −18/r, and the solid line
the total KohnSham potential
and two minima separating these regions. The xc correlation potential used
in the calculation was the GGA, but the LDA density looks almost indis
tinguishable from the GGA density. This is a fairly general statement – the
LDA and most of the GGAs (as well as other more complicated functionals)
yield very similar densities in most cases. The potentials and the energies can
nevertheless be quite diﬀerent.
242 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
24
6
8 101214
r (bohr)
0.04
0.2
1
5
25
Energy (hartree)
v
xc
(LDA)
v
xc
(GGA)
1/r
Fig. 6.7. LDA and GGA xc potentials for the argon atom in a logarithmic scale.
For the sake of comparison we also plot the function 1/r
Having the density it is a simple task to compute the Hartree and xc
potentials. These, together with the nuclear potential v
ext
(r)=−Z/r, are
depicted in Fig. 6.6. The Hartree potential is always positive and of the same
order as the external potential. On the other hand, the xc potential is always
negative and around 5 times smaller. Let us now suppose that an electron is
far away from the nucleus. This electron feels a potential which is the sum
of the nuclear potential and the potential generated by the remaining N − 1
electrons. The further away from the nucleus, the smaller will be the dipole
and highermoment contributions to the electric ﬁeld. It is evident from these
considerations that the KohnSham potential has to decay asymptotically as
−(Z −N +1)/r. As the external potential decays as −Z/r, and the Hartree
potential as N/r, one readily concludes that the xc potential has to behave
asymptotically as −1/r. In fact it is the exchange part of the potential that
has to account for this behavior, whilst the correlation potential decays with
a higher power of 1/r. To better investigate this feature, we have plotted,
in logarithmic scale, −v
xc
, in the LDA and GGA approximations, together
with the function 1/r (see Fig. 6.7). Clearly both the LDA and the GGA
curve have a wrong (exponential) asymptotic behavior. From the deﬁnition
of the LDA, (see 6.9), it is quite simple to derive this fact. The electronic
density for a ﬁnite system decays exponentially for large distances from the
nucleus. The quantity ε
HEG
entering the deﬁnition is, as mentioned before,
a simple function, not much more complicated than a polynomial. By simple
inspection, it is then clear that inserting an exponentially decaying density
in (6.9) yields an exponentially decaying xc potential.
The problem of the exponential decay can yet be seen from a diﬀerent
perspective. For a manyelectron atom the Hartree energy can be written, in
6 A Tutorial on Density Functional Theory 243
terms of the KohnSham orbitals, as
E
Hartree
=
1
2
d
3
r
d
3
r
occ
ij
ϕ
i
(r)
2
ϕ
j
(r
)
2
r − r

. (6.76)
Note that in the sum the term with i = j is not excluded. This diagonal
represents the interaction of one electron with itself, and is therefore called
the selfinteraction term. It is clearly a spurious term, and is exactly canceled
by the diagonal part of the exchange energy. It is easy to see that neither
the LDA nor the GGA exchange energy cancel exactly the selfinteraction.
This is, however, not the case in more sophisticated functionals like the exact
exchange or the selfinteractioncorrected LDA.
The selfinteraction problem is responsible for some of the failures of the
LDA and the GGA, namely (i) the too small ionization potentials when calcu
lated from ε
HOMO
; (ii) the nonexistence of Rydberg series; (iii) the incapacity
to bind extra electrons, thus rendering almost impossible the calculation of
electronaﬃnities (EA).
In Table 6.1 we show the IPs calculated for the argon atom. It is again
evident that −ε
HOMO
is too small [failure (i)], while the IPs obtained through
total energy diﬀerences are indeed quite close to the experimental values, and
in fact better than the HartreeFock results. Note that the LDA result is too
large, but is corrected by the gradient corrections. This is again a fairly
universal feature of the LDA and the GGA: The LDA tends to overestimate
energy barriers, which are then corrected by the GGA to values closer to the
experimental results.
Up to now we have disregarded relativistic corrections in our calculations.
These, however, become important as the atomic number increases. To illus
trate this fact, we show in Fig. 6.5 the radial electronic density of mercury
(Z = 80) and in Table 6.1 its IP obtained from both a relativistic and a
nonrelativistic calculation. From the plot it is clear that the density changes
considerably when introducing relativistic corrections, especially close to the
nucleus, where these corrections are stronger. Furthermore, the relativistic IP
is much closer to the experimental value. But, what do we mean by “relativis
tic corrections”? Even though a relativistic version of DFT (and relativistic
functionals) have been proposed (see the chapter by R. Dreizler in this vol
ume), very few calculations were performed within this formalism. In the
context of standard DFT, “relativistic” calculation normally means the so
lution of a: (a) Diraclike equation but adding a nonrelativistic xc potential;
(b) Pauli equation, i.e., including the mass polarization, Darwin and spin
orbit coupling terms; (c) Scalarrelativistic Pauli equation, i.e., including the
mass polarization, Darwin and either ignoring the spinorbit term, or aver
aging it; (d) ZORA equation (see [81,82]). Our calculations were performed
with the recipe (a).
To complete this section on atomic calculations, we would like to take a
step back and look at the diﬃculty in calculating electronic aﬃnities (EA)
244 Fernando Nogueira, Alberto Castro, and Miguel A.L. Marques
0 0.2 0.4 0.6 0.8
Charge (a.u.)
0
0.04
0.08
0.12
0.16
∆ E (hartree)
F
Cl
Br
I
0.2 0.4 0.6 0.8 1
0.01
0.0
2
0.03
Li
Na
K
Rb
Cs
Fig. 6.8. E(X) − E(X
−α
) versus α for the halogen and alkali atoms
within the LDA and the GGA. For that purpose we performed GGA cal
culations for several atomic species, namely the halogen and alkali series,
that we charged with a fraction, α, of an extra electron. The results are
summarized in Fig. 6.8, where we depicted the diﬀerence of total energies be
tween the charged and the neutral species, E(X)−E(X
−α
). Only Iodine was
able to accept a full extra electron, while all other atoms bounded between
0.5 and 0.7 electrons. Even though a “proper” calculation of the EA is not
possible in these cases, practical recipes do exist. We can, e.g., extrapolate
E(X) − E(X
−α
)toα = 1, and use this value as an estimation of the EA.
In Table 6.2 we show the EAs obtained through a very simple polynomial
extrapolation. The results compare fairly well for the halogens, while for the
alkali atoms they exhibit errors of around 30%. However, we would like to
stress that the situation is far from satisfactory from the theoretical point of
view, and can only be solved by using better xc functionals.
Table 6.2. Electronic aﬃnities for the halogen and alkali atoms. All values were
obtained from extrapolation of E(X) − E(X
−α
)toα = 1, except in the case of
iodine (the only of this set of atoms able to bind an extra electron)
F Cl Br I Li Na K Rb Cs
DFT 0.131 0.139 0.131 0.123 0.0250 0.0262 0.0240 0.0234 0.0222
expt. 0.125 0.133 0.124 0.112 0.0227 0.0201 0.0184 0.0179 0.0173
6.5 PlaneWave Calculations
In this section we will present some simple calculations using a planewave
expansion of the KohnSham orbitals [4]. The planewave basis set is or