Numerical Methods in Quantum Mechanics: Lecture Notes
Numerical Methods in Quantum Mechanics: Lecture Notes
Numerical Methods in
Quantum Mechanics
Paolo Giannozzi
University of Udine
Introduction 1
0.1 About Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
0.1.1 Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
0.1.2 Visualization Tools . . . . . . . . . . . . . . . . . . . . . . 2
0.1.3 Mathematical Libraries . . . . . . . . . . . . . . . . . . . 2
0.1.4 Pitfalls in C-Fortran interlanguage calls . . . . . . . . . . 3
0.2 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
i
3.3.1 Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6 Self-consistent field 47
6.1 The Hartree-Fock method . . . . . . . . . . . . . . . . . . . . . . 47
6.1.1 Slater determinants . . . . . . . . . . . . . . . . . . . . . 48
6.1.2 Hartree-Fock equations . . . . . . . . . . . . . . . . . . . 48
6.1.3 Hartree and exchange potentials . . . . . . . . . . . . . . 50
6.1.4 Hartree-Fock and correlation energy . . . . . . . . . . . . 51
6.1.5 Helium atom . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.2 Code: helium hf radial . . . . . . . . . . . . . . . . . . . . . . . . 53
6.2.1 Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7 Molecules 55
7.1 Born-Oppenheimer approximation . . . . . . . . . . . . . . . . . 55
7.2 Potential Energy Surface . . . . . . . . . . . . . . . . . . . . . . . 56
7.3 Diatomic molecules . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.4 Rothaan-Hartree-Fock equations . . . . . . . . . . . . . . . . . . 58
7.4.1 Multi-center Gaussian integrals . . . . . . . . . . . . . . . 60
7.5 Code: h2 hf gauss . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.5.1 Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . 62
ii
8.1.5 Plane-wave basis set . . . . . . . . . . . . . . . . . . . . . 67
8.2 Code: periodicwell . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.2.1 Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9 Pseudopotentials 72
9.1 Three-dimensional crystals . . . . . . . . . . . . . . . . . . . . . . 72
9.2 Plane waves, core states, pseudopotentials . . . . . . . . . . . . . 73
9.3 Code: cohenbergstresser . . . . . . . . . . . . . . . . . . . . . . . 74
9.3.1 Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . 76
11 Density-Functional Theory 83
11.1 Hohenberg-Kohn theorem . . . . . . . . . . . . . . . . . . . . . . 83
11.2 Kohn-Sham equations . . . . . . . . . . . . . . . . . . . . . . . . 84
11.3 Approximated functionals . . . . . . . . . . . . . . . . . . . . . . 85
11.4 Structure of a DFT code . . . . . . . . . . . . . . . . . . . . . . . 86
11.4.1 Matrix elements of the potential . . . . . . . . . . . . . . 87
11.4.2 FFT and FFT grids . . . . . . . . . . . . . . . . . . . . . 88
11.4.3 Computing the charge density . . . . . . . . . . . . . . . . 89
11.4.4 Computing the potential . . . . . . . . . . . . . . . . . . . 90
11.4.5 Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . 90
iii
Introduction
0.1.1 Compilers
In order to run a code written in any programming language, we must first
translate it into machine language, i.e. a language that the computer can
understand. The translation is done by an interpreter or by a compiler: the
former translates and immediately executes each instruction, the latter takes
the file, produces the so-called object code that together with other object codes
1
and with libraries is finally assembled into an executable file. Python, Java, or at
an higher level, Matlab, Mathematica, are examples of “interpreted” language.
Fortran, C, C++ are “compiled” languages.
Our codes are written in Fortran 90 (or 95, or later). This is a sophisti-
cated and complex language offering dynamical memory management, arrays
operations (e.g. matrix-vector products), modular and object-based structure.
Fortran 90 maintains a wide compatibility with existing Fortran 77 codes, while
remaining as efficient as Fortran 77 was. It is worth mentioning that the first
applications of computers to physics date back to well before the birth of mod-
ern computer languages like C++, python, or even C: there is a large number
of codes and libraries written in Fortran 77 (or even Fortran 66!) and still
widely used in physics. Even among physicists, however, Fortran is no longer
as common and widespread as it used to be, but online resources are still easy to
find1 . The codes themselves are very simple and make little usage of advanced
language features. In any case, there is no problem if a student prefers to use
a more widespread language like C/C++. A version of all codes in C is also
available, with no warranty about the quality of the C code in terms of elegance
and good coding practice.
In all cases, you need a C or Fortran compiler. The C compiler gcc is
free and can be installed on all operating systems (in Linux PCs it is always
present). Less-then-archaic versions of gcc include a Fortran compiler, called
gfortran.
2
solution of linear systems, eigenvalue problems, etc.. LAPACK calls BLAS rou-
tines for all CPU-intensive calculations. Highly optimized versions of the latter
are available for many different operating systems and architectures.
The original BLAS and LAPACK routines are written in Fortran 77. They
are often found precompiled on many machines and can be linked directly by
the compiler by adding -llapack -lblas. If called by a C code, it may be
needed to add an underscore ( ) in the calling program, as in: dsyev , dgemm .
This is due to different, and machine-dependent, C-Fortran conventions for the
naming of “symbols” (i.e. compiled routines). Note that the C compiler may
also need -lm to link general mathematical libraries (i.e. operations like the
square root).
3
0.2 Bibliography
4
Chapter 1
One-dimensional Schrödinger
equation
h̄2 d2 ψ
− + V (x)ψ(x) = Eψ(x), (1.1)
2m dx2
where ψ(x) is the wave function, that can be chosen to be real, and h̄ is the
Planck constant h divided by 2π. In the following we are focusing on the discrete
spectrum: the set of isolated energy values for which Eq.(1.1) has normalizable
solutions, localized in space.
5
quadratic, interaction potential. This allows to study problems that, unlike the
harmonic oscillator, do not have a simple analytical solution.
1.1.1 Units
The Schrödinger equation for a one-dimensional harmonic oscillator is, in usual
notations:
d2 ψ 2m 1
2
= − 2 E − Kx ψ(x) (1.2)
dx2 h̄ 2
where K is the force constant. The force on the mass is F = −Kx, proportional
to the displacement x and directed towards the origin. Classically such an
oscillator has a frequency (angular frequency)
s
K
ω= . (1.3)
m
It is convenient to work with adimensional units, the same that are used by the
codes presented at the end of this chapter. Let us introduce an adimensional
variable ξ and a length λ such that x = λξ. By substituting into Eq.(1.2), one
finds !
d2 ψ 2mEλ2 mKλ4 2
= − + ξ ψ. (1.4)
dξ 2 h̄2 h̄2
The natural choice is to set mKλ4 /h̄2 = 1, leading to λ = (h̄2 /mK)1/4 and,
using Eq.(1.3), to
mω 1/2
ξ= x (1.5)
h̄
By further introducing an adimensional “energy” ε such that
E
ε= , (1.6)
h̄ω
one finally rewrites Eq.(1.2) in adimensional units:
!
d2 ψ ξ2
= −2 ε − ψ(ξ). (1.7)
dξ 2 2
where n is any finite value. The + sign in the exponent must however be
discarded: it would give raise to diverging, non-physical solutions (in which the
particle would tend to leave the ξ = 0 point, instead of being attracted towards
it by the elastic force). It is thus convenient to extract the asymptotic behavior
and assume
2
ψ(ξ) = H(ξ)e−ξ /2 (1.9)
6
where H(ξ) is a well-behaved function for large ξ (i.e. the asymptotic behavior
2
is determined by the second factor e−ξ /2 ). In particular, H(ξ) must not grow
2
like eξ , or else we fall back into a undesirable non-physical solution.
Under the assumption of Eq.(1.9), Eq.(1.7) becomes an equation for H(ξ):
d2 H dH
2
(ξ) − 2ξ (ξ) + (2ε − 1)H(ξ) = 0. (1.10)
dξ dξ
we derive the series to find dH/dξ and d2 H/dξ 2 , plug the results into Eq.(1.10)
and regroup terms with the same power of ξ. We find an equation
∞
X
[(n + 2)(n + 1)An+2 + (2ε − 2n − 1)An ] ξ n = 0 (1.12)
n=0
that can be satisfied for any value of ξ only if the coefficients of all the orders
are zero:
(n + 2)(n + 1)An+2 + (2ε − 2n − 1)An = 0. (1.13)
Thus, once A0 and A1 are given, Eq.(1.13) allows to determine by recursion the
solution under the form of a power series.
For large n, the coefficient of the series behave like An+2 ∼ 2An /n, that is:
1
An+2 ∼ . (1.14)
(n/2)!
This asymptotic behavior is the same as for the series expansion exp(ξ 2 ) =
P 2n
n ξ /n!, indicating that the recursion relation Eq.(1.13) produces a function
H(ξ) that grows like exp(ξ 2 ) and yields a diverging nonphysical solution.
The only way to prevent this from happening is to have in Eq.(1.13) all
coefficients beyond a given n vanish, so that the infinite series reduces to a
finite-degree polynomial. This happens if and only if
1
ε=n+ (1.15)
2
where n is a non-negative integer.
Allowed energies for the harmonic oscillator are thus quantized:
1
En = n + h̄ω n = 0, 1, 2, . . . (1.16)
2
7
Figure 1.1: Wave functions and probability density for the harmonic oscillator.
2
[Hn (−ξ) = −Hn (ξ)] for odd n. Since e−ξ /2 is node-less and even, the complete
wave function corresponding to the energy En :
2 /2
ψn (ξ) = Hn (ξ)e−ξ (1.17)
has n nodes and the same parity as n. The fact that all solutions of the
Schrödinger equation are either odd or even functions is a consequence of the
symmetry of the potential: V (−x) = V (x).
The lowest-order Hermite polynomials are
1
ρ(x) ∝ q . (1.20)
x20 − x2
8
The quantum probability density for the ground state is completely different:
has a maximum for x = 0, decreases for increasing x. At the classical inversion
point its value is still ∼ 60% of the maximum value: the particle has a high
probability to be in the classically forbidden region (for which V (x) > E).
In the limit of large quantum numbers, i.e., large n values, the quantum
density tends however to look similar to the quantum one, but it still displays
the oscillatory behavior in the allowed region, typical for quantum systems.
d2 ψ
= k 2 ψ(x) (1.21)
dx2
where k 2 is a positive quantity. This in turns implies an exponential behavior,
with both ψ(x) ' exp(kx) and ψ(x) ' exp(−kx) satisfying (1.21). As a rule
only one of these two possibilities has a physical meaning: the one that gives
raise to a wave function that decreases exponentially at large |x|.
It is very easy to distinguish between the “good” and the “bad” solution for
a human, much less so for a numerical code that produces whatever comes out
from the equations. If even a tiny amount of the “bad” solution, for instance
due to numerical noise, is present, the integration algorithm will inexorably
9
make it grow in the classically forbidden region. As the integration goes on,
the “bad” solution will dominate the “good” one and eventually produce crazy
numbers (or crazy NaN’s: Not a Number). Thus a nice-looking wave function
in the classically allowed region, smoothly decaying in the classically forbidden
region, may suddenly start to diverge at some point, unless a wise strategy is
employed to prevent it. The second code presented at the end of this chapter
implements such a strategy.
+O[(∆x)6 ]
yn+1 = yn + yn0 ∆x + 21 yn00 (∆x)2 + 16 yn000 (∆x)3 + 1 0000
24 yn (∆x)
4 + 1 00000
120 yn (∆x)
5
+O[(∆x)6 ].
(1.24)
10
We have switched to notation y 0 (x) = dy/dx etc. for compactness. If we sum
the two equations, we obtain:
1 0000
yn+1 + yn−1 = 2yn + yn00 (∆x)2 + y (∆x)4 + O[(∆x)6 ]. (1.25)
12 n
Eq.(1.22) tells us that
yn00 = −gn yn + sn ≡ zn . (1.26)
The quantity zn above is introduced to simplify the notations. The following
relation holds:
zn+1 + zn−1 = 2zn + zn00 (∆x)2 + O[(∆x)4 ]. (1.27)
This is the simple formula for the discretized second derivative, that can be
obtained in a straightforward way by Taylor expansion up to third order. Thus:
zn+1 + zn−1 − 2zn
yn0000 ≡ zn00 = + O[(∆x)2 ]. (1.28)
(∆x)2
By inserting back these results into Eq.(1.25) one finds
yn+1 = 2yn − yn−1 + (−gn yn + sn )(∆x)2
1
+ 12 (−gn+1 yn+1 + sn+1 − gn−1 yn−1 + sn−1 + 2gn yn − 2sn )(∆x)2
+O[(∆x)6 ]
(1.29)
and finally the Numerov’s formula
2 2 2
h i h i h i
yn+1 1 + gn+1 (∆x)
12 = 2yn 1 − 5gn (∆x)
12 − yn−1 1 + gn−1 (∆x)
12
2 (1.30)
+(sn+1 + 10sn + sn−1 ) (∆x) 6
12 + O[(∆x) ]
that allows to obtain yn+1 starting from yn and yn−1 , and recursively the func-
tion in the entire box.
The value of the function in the first two points are needed in order to start
the recurrence. We remark that such initial conditions differ from the more
traditional ones for second-order differential equations:
y(x0 ) = y0 , y 0 (x0 ) = y00 , (1.31)
in which the value at one point and the derivative in the same point are specified.
It is of course possible to integrate both in the direction of positive x and
in the direction of negative x. In the presence of inversion symmetry, it will be
sufficient to integrate in just one direction.
In our case—Schrödinger equation—the sn terms are absent. It is convenient
to introduce an auxiliary array fn , defined as
(∆x)2 2m
fn ≡ 1 + gn , where gn = [E − V (xn )], (1.32)
12 h̄2
and to rewrite Numerov’s formula as
(12 − 10fn )yn − fn−1 yn−1
yn+1 = . (1.33)
fn+1
The value of the energy is now hidden into gn and fn .
11
1.3.1 Code: harmonic0
Code harmonic0.f901 (or harmonic0.c2 ) solves the Schrödinger equation for
the quantum harmonic oscillator, Eq.(1.7) in adimensional units. using the
Numerov’s algorithm above described for integration, and searching eigenvalues
with a pre-determined number n of nodes using the “shooting method”.
The shooting method is quite similar to the bisection procedure for the
search of the zero of a function. We define an initial energy range [Emin , Emax ]
that must contain the eigenvalue En . We start with an energy E equal to the
mid-point of the energy range, E = (Emax + Emin )/2. The wave function is
integrated starting from x = 0 in the direction of positive x; at the same time,
the number of nodes (i.e. of changes of sign of the function) is counted. If the
number of nodes is larger than n, E is too high; if the number of nodes is smaller
than n, E is too low. We then choose the lower half-interval [Emin , Emax = E],
or the upper half-interval [Emin = E, Emax ], respectively, select a new trial
eigenvalue E in the mid-point of the new interval, iterate the procedure. When
the energy interval is smaller than a pre-determined threshold, we assume that
convergence has been reached.
For negative x the function is constructed using symmetry, since ψn (−x) =
(−1)n ψn (x). This is of course possible only because V (−x) = V (x), otherwise
integration would have to be performed on the entire interval. The parity of the
wave function determines the choice of the starting points for the recursion. For
n odd, the two first points can be chosen as y0 = 0 and an arbitrary finite value
for y1 . For n even, y0 is arbitrary and finite, y1 is determined by Numerov’s
formula, Eq.(1.33), with f1 = f−1 and y1 = y−1 :
• the number N of grid points (typical values range from hundreds to a few
thousand); note that the grid point index actually runs from 0 to N , so
that ∆x = xmax /N ;
Finally the code prompts for a trial energy. You should answer 0 in order to
search for an eigenvalue with n nodes. The code will start iterating on the
energy, printing on standard output (i.e. at the terminal): iteration number,
number of nodes found (on the positive x axis only), the current energy eigen-
value estimate. It is however possible to specify an energy, not necessarily an
eigenvalue, to force the code to perform an integration at fixed energy and see
1
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/F90/harmonic0.f90
2
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/C/harmonic0.c
12
the resulting wave function. It is useful for testing purposes and to better un-
derstand how the eigenvalue search works (or doesn’t work). Note that in this
case the required number of nodes will not be honored; however the integra-
tion will be different for odd or even number of nodes, because the parity of n
determines how the first two grid points are chosen.
The output file contains five columns: respectively, x, ψ(x), |ψ(x)|2 , ρcl (x)
and V (x). ρcl (x) is the classical probability density (normalized to 1) of the
harmonic oscillator, given in Eq.(1.20). All these quantities can be plotted as a
function of x using any plotting program, such as gnuplot, shortly described in
the introduction. Note that the code will prompt for a new value of the number
of nodes after each calculation of the wave function: answer -1 to stop the code.
If you perform more than one calculation, the output file will contain the result
for all of them in sequence. Also note that the wave function are written for
the entire box, from −xmax to xmax .
It will become quickly evident that the code “sort of” works: the results
look good in the region where the wave function is not vanishingly small, but
invariably, the pathological behavior described in Sec.(1.2.2) sets up and wave
functions diverge at large |x|. As a consequence, it is impossible to normalize
the ψ(x). The code definitely needs to be improved. The proper way to deal
with such difficulty is to find an inherently stable algorithm.
13
matching point is also positive. The value dx is arbitrary: the solution is
anyway rescaled in order to be continuous at the matching point. The code
stops the same index icl corresponding to xc . We thus get a function ψR (x)
defined in [xc , xmax ].
In general, the two parts of the wave function have different values in xc :
ψL (xc ) and ψR (xc ). We first of all re-scale ψR (x) by a factor ψL (xc )/ψR (xc ),
so that the two functions match continuously in xc . Then, the whole function
ψ(x) is renormalized in such a way that |ψ(x)|2 dx = 1.
R
Now comes the crucial point: the two parts of the function will have in
general a discontinuity at the matching point ψR 0 (x ) − ψ 0 (x ). This difference
c L c
should be zero for a good solution, but it will not in practice, unless we are
really close to the good energy E = En . The sign of the difference allows us
to understand whether E is too high or too low, and thus to apply again the
bisection method to improve the estimate of the energy.
In order to calculate the discontinuity with good accuracy, we write the
Taylor expansions:
L = y L − y 0L ∆x + 1 y 00L (∆x)2 + O[(∆x)3 ]
yi−1 i i 2 i (1.35)
R = y R + y 0R ∆x + 1 y 00R (∆x)2 + O[(∆x)3 ]
yi+1 i i 2 i
For clarity, in the above equation i indicates the index icl. We sum the two
Taylor expansions and obtain, noting that yiL = yiR = yi , and that yi00L = yi00R =
yi00 = −gi yi as guaranteed by Numerov’s method:
L
yi−1 R
+ yi+1 = 2yi + (yi0R − yi0L )∆x − gi yi (∆x)2 + O[(∆x)3 ] (1.36)
that is
L + y R − [2 − g (∆x)2 ]y
yi−1 i i
yi0R − yi0L = i+1
+ O[(∆x)2 ] (1.37)
∆x
or else, by using the notations as in Eq.(1.32),
L + y R − (14 − 12f )y
yi−1 i i
yi0R − yi0L = i+1
+ O[(∆x)2 ] (1.38)
∆x
In this way the code calculated the discontinuity of the first derivative. If the
sign of yi0R −yi0L is positive, the energy is too high (can you give an argument for
this?) and thus we move to the lower half-interval; if negative, the energy is too
low and we move to the upper half interval. As usual, convergence is declared
when the size of the energy range has been reduced, by successive bisection, to
less than a pre-determined tolerance threshold.
During the procedure, the code prints on standard output a line for each
iteration, containing: the iteration number; the number of nodes found (on the
positive x axis only); if the number of nodes is the correct one, the discontinuity
of the derivative yi0R − yi0L (zero if number of nodes not yet correct); the current
estimate for the energy eigenvalue. At the end, the code writes the final wave
function (this time, correctly normalized to 1!) to the output file.
14
1.3.3 Laboratory
Here are a few hints for “numerical experiments” to be performed in the com-
puter lab (or afterward), using both codes:
• Look at what happens when the energy is close to but not exactly an
eigenvalue. Again, compare the behavior of the two codes.
• Examine the effects of the parameters xmax, mesh. For a given ∆x, how
large can be the number of nodes?
• Verify how close you go to the exact results (remember that there is a
convergence threshold on the energy hardwired in the code). What are
the factors that affect the accuracy of the results?
• Modify the potential, keeping inversion symmetry. This will require very
little changes to be done. You might for instance consider a “double-well”
potential described by the form:
" #
x 4
2
x
V (x) = −2 +1 , , δ > 0. (1.39)
δ δ
15
Chapter 2
In this chapter we extend the concepts and methods introduced in the previous
chapter for a one-dimensional problem to a specific and very important class
of three-dimensional problems: a particle of mass m under a central potential
V (r), i.e. depending only upon the distance r from a fixed center. The Schrö-
dinger equation we are going to study in this chapter is thus
" #
h̄2 2
Hψ(r) ≡ − ∇ + V (r) ψ(r) = Eψ(r). (2.1)
2m
The problem of two interacting particles via a potential depending only upon
their distance, V (|r1 − r2 |), e.g. the Hydrogen atom, reduces to this case, with
m equal to the reduced mass of the two particles.
The general solution proceeds via the separation of the Schrödinger equation
into an angular and a radial part. In this chapter we consider the numerical
solution of the radial Schrödinger equation. A non-uniform grid is introduced
and the radial Schrödinger equation is transformed to an equation that can still
be solved using Numerov’s method introduced in the previous chapter.
16
The Hamiltonian can thus be written as
h̄2 1 ∂ ∂ L2
H=− r2 + + V (r). (2.4)
2m r2 ∂r ∂r 2mr2
The term L2 /2mr2 has a classical analogous: the radial motion of a mass having
classical angular momentum Lcl can be described by an effective radial potential
V̂ (r) = V (r) + L2cl /2mr2 , where the second term (the “centrifugal potential”)
takes into account the effects of rotational motion. For high Lcl the centrifugal
potential “pushes” the equilibrium position outwards.
In the quantum case, both L2 and one component of the angular momentum,
for instance Lz :
∂
Lz = −ih̄ (2.5)
∂φ
commute with the Hamiltonian, so L2 and Lz are conserved and H, L2 , Lz have
a (complete) set of common eigenfunctions. We can thus use the eigenvalues of
L2 and Lz to classify the states. Let us now proceed to the separation of radial
and angular variables, as suggested by Eq.(2.4). Let us assume
After some algebra we find that the Schrödinger equation can be split into an
angular and a radial equation. The solution of the angular equations are the
spherical harmonics, known functions that are eigenstates of both L2 and Lz :
Lz Y`m (θ, φ) = mh̄Y`m (θ, φ), L2 Y`m (θ, φ) = `(` + 1)h̄2 Y`m (θ, φ) (2.7)
In general, the energy will depend upon ` because the effective potential does;
moreover, for a given `, we expect to find bound states with discrete energies
and we have indicated with n the corresponding index.
Finally, the complete wave function will be
The energy does not depend upon m. As already observed, m classifies the
projection of the angular momentum on an arbitrarily chosen axis. Due to
spherical symmetry of the problem, the energy cannot depend upon the orien-
tation of the vector L, but only upon his modulus. An energy level En` will
then have a degeneracy 2` + 1 (or larger, if there are other observables that
commute with the Hamiltonian and that we haven’t considered).
17
2.1.1 Radial equation
The probability p(r)dr to find the particle at a distance between r and r + dr
from the center is given by the integration over angular variables only of the
wavefunction squared:
Z
p(r)dr = |ψn`m (r, θ, φ)|2 rdθ r sin θ dφdr = |Rn` |2 r2 dr = |χn` |2 dr (2.10)
Ω
The function |χ(r)|2 can thus be directly interpreted as the radial probability
density. Let us re-write the radial equation for χ(r) instead of R(r). Its is
straightforward to find that Eq.(2.8) becomes
" #
h̄2 d2 χ h̄2 `(` + 1)
− + V (r) + − E χ(r) = 0. (2.14)
2m dr2 2mr2
We note that this equation has the same form as the one-dimensional Schrö-
dinger equation, Eq.(1.1), for a particle under an effective potential and r ≥ 0:
h̄2 `(` + 1)
V̂ (r) = V (r) + . (2.15)
2mr2
As already explained, the second term is the centrifugal potential. The same
methods used to find the solution of Eq.(1.1), and in particular, Numerov’s
method, can be used to find the radial part of the eigenfunctions of the energy.
Ze2
V (r) = − , (2.16)
4π0 r
18
In the following we will use qe2 = e2 /(4π0 ) so as to fall back into the simpler
CGS form.
It is often practical to work with atomic units (a.u.): assuming that h̄ = 1,
me = 1/2, qe2 = 2, the length is expressed in units of Bohr radii (or simply,
“Bohr”), a0 :
h̄2
a0 = = 0.529177 Å = 0.529177 × 10−10 m, (2.18)
me qe2
while energies are expressed in units of Rydberg (Ry):
me qe4
1 Ry = = 13.6058 eV. (2.19)
2h̄2
when me = 9.11 × 10−31 Kg is the electron mass, not the reduced mass of the
electron and the nucleus.
By assuming instead h̄ = 1, me = 1, qe = 1, we obtain another set of atomic
units, in which the Hartree (Ha) is the unit of energy instead of the Ry:
me qe4
1 Ha = 2 Ry = = 27.212 eV. (2.20)
h̄2
Beware! Never talk about ”atomic units” without first specifying which ones.
In the following, the first set (”Rydberg” units) will be occasionally used.
We note first of all that for small r the centrifugal potential is the dominant
term in the potential. The behavior of the solutions for r → 0 will then be
determined by
d2 χ `(` + 1)
2
' χ(r) (2.21)
dr r2
yielding χ(r) ∼ r`+1 , or χ(r) ∼ r−` . The second possibility is not physical
because χ(r) is not allowed to diverge.
For large r instead we remark that bound states may be present only if
E < 0: there will be a classical inversion point beyond which the kinetic energy
becomes negative, the wave function decays exponentially, only some energies
can yield valid solutions. The case E > 0 corresponds instead to a problem of
electron-nucleus scattering, with propagating solutions and a continuum energy
spectrum. Here we deal with bound states; unbound states are the subject of
the next chapter.
The asymptotic behavior of the solutions for large r → ∞ will thus be
determined by
d2 χ 2me
2
' − 2 Eχ(r) (2.22)
dr h̄
√
yielding χ(r) ∼ exp(±kr), where k = −2me E/h̄. The + sign must be dis-
carded as nonphysical. It is thus sensible to assume for the solution a form
like ∞
χ(r) = r`+1 e−kr
X
An r n (2.23)
n=0
which guarantees in both cases, small and large r, a correct behavior, as long
as the series does not diverge exponentially.
19
2.2.1 Energy levels
The radial equation for the Coulomb potential can then be solved along the
same lines as for the harmonic oscillator, Sec.1.1. The expansion of Eq.(2.23)
is introduced into Eq.(2.14), a recursion formula for coefficients An is derived,
one finds that the series in general diverges like exp(2kr) unless it is truncated
to a finite number of terms, and this happens only for some particular values
of E:
Z 2 me qe4 Z2
En = − 2 = − Ry (2.24)
n 2h̄2 n2
where n ≥ ` + 1 is an integer known as main quantum number. For a given `
we find solutions for n = ` + 1, ` + 2, . . .; or, for a given n, possible values for `
are ` = 0, 1, . . . , n − 1.
Although the effective potential appearing in Eq.(2.14) depends upon `,
and the angular part of the wave function also strongly depends upon `, the
energies, Eq.(2.24) depend only upon n. We have thus a degeneracy on the
energy levels with the same n and different `, in addition to the one due to the
2` + 1 possible values of the quantum number m (as implied in Eq.(2.8) where
m does not appear). The total degeneracy (not considering spin) for a given n
is thus
n−1
X
(2` + 1) = n2 . (2.25)
`=0
where s
2Z r 2me En
x≡ =2 − r (2.27)
n a0 h̄2
and L2`+1
n+1 (x) are Laguerre polynomials of degree n − ` − 1. The coefficient has
been chosen in such a way that the following orthonormality relations hold:
Z ∞
χn` (r)χn0 ` (r)dr = δnn0 . (2.28)
0
Z 3/2 −Zr/a0
ψ100 (r, θ, φ) = 3/2 √
e . (2.29)
a0 π
20
The dominating term close to the nucleus is the first term of the series,
χn` (r) ∼ r`+1 . The larger `, the quicker the wave function tends to zero when
approaching the nucleus. This reflects the fact that the function is “pushed
away” by the centrifugal potential. Thus radial wave functions with large ` do
not appreciably penetrate close to the nucleus.
At large r the dominating term is χ(r) ∼ rn exp(−Zr/na0 ). This means
that, neglecting the other terms, |χn` (r)|2 has a maximum about r = n2 a0 /Z.
This gives a rough estimate of the “size” of the wave function, which is mainly
determined by n.
In Eq.(2.26) the polynomial has n − ` − 1 degree. This is also the number of
nodes of the function. In particular, the eigenfunctions with ` = 0 have n − 1
nodes; those with ` = n − 1 are node-less. The form of the radial functions can
be seen for instance on the Wolfram Research site1 or explored via the Java
applet at Davidson College2
21
We make the specific choice
Zr
x(r) ≡ log (2.32)
a0
(note that with this choice x is adimensional) yielding
∆r
∆x = . (2.33)
r
The ∆r/r ratio remains thus constant on the grid of r so defined. This kind of
grid is usually called logarithmic grid, but some people see the thing the other
way round and call it exponential!
There is however a problem: by transforming Eq.(2.14) in the new vari-
able x, a term with first derivative appears, preventing the usage of Numerov’s
method (and of other integration methods as well). The problem can be cir-
cumvented by transforming the unknown function as follows:
1
y(x) = √ χ (r(x)) . (2.34)
r
It is easy to verify that by transforming Eq.(2.14) so as to express it as a
function of x and y, the terms containing first-order derivatives disappear, and
by multiplying both sides of the equation by r3/2 one finds
" 2 #
d2 y 2me 2 1
dx2
+ 2 r (E − V (r)) − ` + 2 y(x) = 0 (2.35)
h̄
where V (r) = −Zqe2 /r for the Coulomb potential. This equation no longer
presents any singularity for r = 0, is in the form of Eq.(1.22), with
2
2me 1
g(x) = 2 r(x)2 (E − V (r(x))) − ` + (2.36)
h̄ 2
and can be directly solved using the numerical integration formulae Eqs.(1.32)
and (1.33) and an algorithm very similar to the one of Sec.1.3.2.
√
Subroutine do mesh computes and stores the values of r, r, r2 for each
grid point. The potential is also calculated and stored in init pot. The grid
is calculated starting from a minimum value, set in the code to x = −8, corre-
sponding to Zrmin ' 3.4 × 10−3 Bohr radii. Note that the grid in r does not
include r = 0: this would correspond to x = −∞. The known analytical behav-
ior for r → 0 and r → ∞ are used to start the outward and inward recurrences,
respectively.
22
whose goal is to give an estimate, to first order in perturbation theory, of the
difference δe between the current estimate of the eigenvalue and its final value.
Reminder: icl is the index corresponding to the classical inversion point.
Integration is made with forward recursion up to this index, with backward
recursion down to this index. icl is thus the index of the matching point
between the two functions. The function at the right is rescaled so that the
total function is continuous, but the first derivative dy/dx will be in general
discontinuous, unless we have reached a good eigenvalue.
In the section of the code shown above, y(icl) is the value given by Nu-
merov’s method using either icl-1 or icl+1 as central point; ycusp is the value
predicted by the Numerov’s method using icl as central point. The problem
is that ycusp6=y(icl).
What about if our function is the exact solution, but for a different problem?
It is easy to find what the different problem could be: one in which a delta func-
tion, v0 δ(x−xc ), is superimposed at xc ≡x(icl) to the potential. The presence
of a delta function causes a discontinuity (a ”cusp”) in the first derivative, as
can be demonstrated by a limit procedure, and the size of the discontinuity is
related to the coefficient of the delta function. Once the latter is known, we
can give an estimate, based on perturbation theory, of the difference between
the current eigenvalue (for the ”different” potential) and the eigenvalue for the
”true” potential.
One may wonder how to deal with a delta function in numerical integration.
In practice, we assume the delta to have a value only in the interval ∆x centered
on y(icl). The algorithm used to estimate its value is quite sophisticated. Let
us look again at Numerov’s formula, Eq.(1.33): note that the formula actually
provides only the product y(icl)f(icl). From this we usually extract y(icl)
since f(icl) is assumed to be known. Now we suppose that f(icl) has a
different and unknown value fcusp, such that our function satisfies Numerov’s
formula also in point icl. The following must hold:
fcusp*ycusp = f(icl)*y(icl)
since this product is provided by Numerov’s method (by integrating from icl-1
to icl+1), and ycusp is that value that the function y must have in order to
satisfy Numerov’s formula also in icl. As a consequence, the value of dfcusp
calculated by the program is just fcusp-f(icl), or δf .
The next step is to calculate the variation δV of the potential V (r) appearing
in Eq.(2.35) corresponding to δf . By differentiating Eq.(2.36) one finds δg(x) =
−(2me /h̄2 )r2 δV . Since f (x) = 1 + g(x)(∆x)2 /12, we have δg = 12/(∆x)2 δf ,
and thus
h̄2 1 12
δV = − δf. (2.37)
2me r2 (∆x)2
First-order perturbation theory gives then the corresponding variation of the
eigenvalue: Z
δe = hψ|δV |ψi = |y(x)|2 r(x)2 δV dx. (2.38)
23
Note that the change of integration variable from dr to dx adds a factor r to
the integral:
Z ∞ Z ∞ Z ∞
dr(x)
f (r)dr = f (r(x)) dx = f (r(x))r(x)dx. (2.39)
0 −∞ dx −∞
We write the above integral as a finite sum over grid points, with a single
non-zero contribution coming from the region of width ∆x centered at point
xc =x(icl). Finally:
h̄2 12
δe = |y(xc )|2 r(xc )2 δV ∆x = − |y(xc )|2 ∆xδf (2.40)
2me (∆x)2
is the difference between the eigenvalue of the current potential (i.e. with a
superimposed Delta function) and that of the true potential. This expression
is used by the code to calculate the correction de to the eigenvalue. Since in
the first step this estimate may have large errors, the line
e = max(min(e+de,eup),elw)
prevents the usage of a new energy estimate outside the bounds [elw,eip]. As
the code proceeds towards convergence, the estimate becomes better and better
and convergence is very fast in the final steps.
2.3.3 Laboratory
• Examine solutions as a function of n and `; verify the presence of acci-
dental degeneracy.
• Compare the numerical solution with the exact solution, Eq.(2.29), for
the 1s case (or other cases if you know the analytic solution).
• Calculate the expectation values of r and of 1/r, compare them with the
known analytical results.
• Consider a different mapping: r(x) = r0 (exp(x) − 1), that unlike the one
we have considered, includes r = 0. Which changes must be done in order
to adapt the code to this mapping?
24
Chapter 3
Until now we have considered the discrete energy levels of simple, one-electron
Hamiltonians, corresponding to bound, localized states. Unbound, delocalized
states exist as well for any physical potential (with the exception of idealized
models like the harmonic potential) at sufficiently high energies. These states
are relevant in the description of scattering from a potential, i.e. processes
of diffusion of an incoming particle. Scattering is a really important subject
in physics: what many experiments measure is how a particle is deflected by
another. The comparison of measurements with calculated results makes it
possible to understand the form of the interaction potential between the par-
ticles. In the following a short reminder of scattering theory is provided; then
an application to a real problem (scattering of H atoms by rare gas atoms) is
presented. This chapter is inspired to Ch.2 of the book of Thijssen.
25
For a central potential, the system is symmetric
around the z axis and thus the differential cross
section does not depend upon φ. Both the dif-
ferential and the total cross section depend upon
the energy of the incident particle.
which in our case, given the symmetry of the problem, can be simplified as
∞
X χl (r)
ψ(r) = Al Pl (cos θ). (3.7)
l=0
r
The functions χl (r) are solutions for (positive) energy E = h̄2 k 2 /2m with an-
gular momentum l of the radial Schrödinger equation:
" #
h̄2 d2 χl (r) h̄2 l(l + 1)
+ E − V (r) − χl (r) = 0. (3.8)
2m dr2 2mr2
26
where the jl and nl functions are the well-known spherical Bessel functions,
respectively regular and divergent at the origin. These are the Rl (r) = χl (r)/r
solutions of the radial equation for the free particle (V (r) = 0). The quantities
δl are known as phase shifts and depend upon the potential and the energy.
The cross section can then be expressed in terms of the phase shifts. One
looks for coefficients of Eq.(3.7) that yield the desired asymptotic behavior (3.2),
using the following series expansion of a plane wave:
∞
X
eik·r = il (2l + 1)jl (kr)Pl (cos θ), (3.10)
l=0
where the Pl functions are Legendre polynomials and θ, angle between k and r,
is the same we have introduced earlier. One finds Al = il (2l + 1)/k. With some
further algebra, and using the large-x behavior of spherical Bessel functions:
1 πl 1 πl
jl (x) ' sin x − , nl (x) ' cos x − , (3.11)
x 2 x 2
one finally demonstrates that the differential cross section can be written as
2
∞
dσ 1 X
iδl
= 2 (2l + 1)e sin δl Pl (cos θ) , (3.12)
dΩ k
l=0
The energy- and angular momentum-dependent phase shifts thus contain all
the information on the scattering properties of a potential.
27
where = 5.9meV, σ = 3.57Å. The LJ potential is much used in molecular
and solid-state physics to model interatomic interaction forces. The attractive
−1/r6 term describes weak van der Waals (or “dispersive”, in chemical parlance)
forces due to (dipole-induced dipole) interactions (see also Appendix C). The
repulsive 1/r12 term models the repulsion between closed shells. While usually
dominated by direct electrostatic interactions, the ubiquitous van der Waals
forces are the dominant term for the interactions between closed-shell atoms and
molecules. These play an important role in molecular crystals and in macro-
molecules. The LJ potential is the first realistic interatomic potential for which
a molecular-dynamics simulation was performed (Rahman, 1965, liquid Ar).
It is straightforward to find that the LJ potential as written in Eq.(3.14) has
a minimum Vmin = − for r = σ, is zero for r = σ/21/6 = 0.89σ and becomes
strongly positive (i.e. repulsive) at small r.
28
The choice of the units in this code is (once again) different from that of
the previous codes. It is convenient to choose units in which h̄2 /2m is a
number of the order of 1. Two possible choices are meV·Å2 , or meV·σ 2 .
This code uses the former choice. Note that m here is not the electron
mass! it is the reduced mass of the H-Kr system. As a first approximation,
m is here the mass of H.
The choice of r1 and r2 is not very critical but requires some care. r1 can
be chosen at rmax , for which, given the fast decay of the LJ potential for
large r, a good choice is rmax = 5σ. r2 should not be too close to r1 . A
good choice seems to be r2 = r1 + λ/4, that is, at 1/4 of the wave length
λ = 2π/k of the scattered wave function from r1 . 4
29
4. Sum the phase shifts as in Eq.(3.13) to obtain the total cross section and
a graph of it as a function of the incident energy. The relevant range of
energies is of the order of a few meV, something like 0.1 ≤ E ≤ 3 ÷ 4
meV. If you go too close to E = 0, you will run into numerical difficulties
(the wave length of the wave function diverges). The angular momentum
ranges from 0 to a value of lmax to be determined.
The code writes a file containing the total cross section and each angular mo-
mentum contribution as a function of the energy (beware: up to lmax = 13; for
larger l, lines will be wrapped).
3.3.1 Laboratory
• Verify the effect of all the parameters of the calculation: grid step for in-
tegration, rmin , r1 = rmax , r2 , lmax . In particular the latter is important:
you should start to find good results when lmax ≥ 6.
• Print, for some selected values of the energy, the wave function and its
asymptotic behavior. You should verify that they match beyond rmax .
• Modify the code to calculate the cross section from a different potential,
for instance, the following one:
h i
V (r) = −A exp −(r − r0 )2 , r < rmax ; V (r > rmax ) = 0
30
Chapter 4
31
The expectation value of H over wavefunction ψ + δψ becomes
(ψ ∗ + δψ ∗ )H(ψ + δψ) dv
R
hHi + δhHi =
(ψ ∗ + δψ ∗ )(ψ + δψ) dv
R
R ∗
ψ Hψ dv + δψ ∗ Hψ dv + ψ ∗ Hδψ dv
R R
'
ψ ∗ ψ dv + δψ ∗ ψ dv + ψ ∗ δψ dv
R R R
Z Z Z
∗ ∗ ∗
= ψ Hψ dv + δψ Hψ dv + ψ Hδψ dv ×
δψ ∗ ψ dv
R R ∗
1 ψ δψ dv
1 − − (4.3)
ψ ∗ ψ dv ψ ∗ ψ dv ψ ∗ ψ dv
R R R
where second-order terms in δψ have been omitted and we have used the ap-
proximation 1/(1+x) ' 1−x, valid for x << 1. By omitting again higher-order
terms, one finds for the variation δhHi:
δψ ∗ Hψ dv ψ ∗ Hδψ dv δψ ∗ ψ dv
R R R R ∗
ψ δψ dv
δhHi = + − hHi + . (4.4)
ψ ∗ ψ dv ψ ∗ ψ dv ψ ∗ ψ dv ψ ∗ ψ dv
R R R R
One of the two terms in parentheses is the complex conjugate of the other; the
same holds for the two remaining terms, because H is a hermitian operator,
satisfying Z Z ∗
a∗ Hb dv = b∗ Ha dv (4.5)
for any pair of functions a and b. We can thus simplify the above expression as
δψ ∗ Hψ dv δψ ∗ ψ dv
R R
δhHi = + c.c. − hHi + c.c. (4.6)
ψ ∗ ψ dv ∗
R R
ψ ψ dv
and finally to
δψ ∗ [H − hHi] ψ dv + c.c.
R
δhHi = . (4.7)
ψ ∗ ψ dv
R
32
where λk are additional variables called Lagrange multipliers. In our case we
have
Z
I0 = ψ ∗ Hψ dv (4.10)
Z
I1 = ψ ∗ ψ dv (4.11)
that is
Hψ = −λψ (4.16)
i.e. the Lagrange multiplier is equal, apart from the sign, to the energy eigen-
value. Again we see that states whose expectation energy is stationary with
respect to any variation in the wave function are the solutions of the Schrödinger
equation.
ψ ∗ Hψ dv
R
hHi = R ∗ ≥ E0 . (4.18)
ψ ψ dv
33
This demonstrates Eq.(4.18), since the second term is either positive or zero,
as En ≥ E0 by definition of ground state. Note that if the ground state is
non-degenerate, the inequality is strict: hHi = E0 only for ψ = ψ0 .
This simple result is extremely important: it tells us that any function ψ
yields for the expectation energy an upper estimate of the energy of the ground
state. The best approximation to the ground state is can be found by varying
ψ inside a given set of functions and looking for the function that minimizes
hHi. This is the essence of the variational method.
A simple way to use such result is to introduce a set of normalized trial wave
functions ψ(v; α1 , . . . , αr ), where v are the variables of the problem (coordinates
etc), αi , i = 1, . . . , r are parameters. The ground-state energy will be a function
of the parameters:
Z
E(α1 , . . . , αr ) = ψ ∗ (v; α1 , . . . , αr )Hψ(v; α1 , . . . , αr ) dv (4.21)
We now look for the minimum of E with respect to a variation of the parameters,
that is, we impose
∂E ∂E
= ... = = 0. (4.22)
∂α1 ∂αr
The function ψ satisfying these conditions with the lowest E is the function
that better approximates the ground state, among the considered set of trial
wave functions. It is clear that the quality of the results depends in a crucial
way upon a suitable choice of the set of trial wave functions.
34
4.2.1 Expansion into a basis set of orthonormal functions
Let us assume to have a basis of N functions bi , between which orthonormality
relations hold: Z
hbi |bj i ≡ b∗i bj dv = δij (4.24)
By replacing Eq.(4.25) into Eq.(4.23) one can immediately notice that the latter
takes the form
c∗i cj (Hij
X
= − Eδij ) (4.26)
ij
Since both H and the basis functions are given, Hij is a known square matrix of
numbers. The hermiticity of the Hamiltonian operator implies that such matrix
is hermitian:
Hji = Hij∗ (4.28)
(i.e. symmetric if all elements are real). According to the variational method,
let us minimize Eq. (4.26) with respect to the coefficients:
∂G
=0 (4.29)
∂c∗i
This produces the condition
X
(Hij − Eδij )cj = 0 (4.30)
j
If the derivative with respect to complex quantities bothers you: write the
complex coefficients as sums of a real and an imaginary part ck = xk + iyk ,
require that derivatives with respect to both xk and yk are zero. By exploiting
hermiticity you will find a system
Wk + Wk∗ = 0
−iWk + iWk∗ = 0
We note that, if the basis were a complete (and thus infinite) system, this
would be the Schrödinger equation in the Heisenberg representation. We have
finally demonstrated that the same equations, for a finite basis set, yield the
best approximation to the true solution according to the variational principle.
35
4.2.2 Secular equation
Eq.(4.30) is a system of N algebraic linear equations, homogeneous (there are
no constant term) in the N unknown cj . In general, this system has only the
trivial, and obviously nonphysical, solution cj = 0 for all coefficients. A non-
zero solution exists if and only if the following condition on the determinant is
fulfilled:
det |Hij − Eδij | = 0 (4.31)
Such condition implies that one of the equations is a linear combination of the
others and the system has in reality N − 1 equations and N unknowns, thus
admitting non-zero solutions.
Eq.(4.31) is known as secular equation. It is an algebraic equation of de-
gree N in E (as it is evident from the definition of the determinant, with the
main diagonal generating a term E N , all other diagonals generating lower-order
terms), that admits N roots, or eigenvalues. Eq.(4.30) can also be written in
matrix form
Hc = Ec (4.32)
where H is here the N ×N matrix whose matrix elements are Hij , c is the vector
formed with ci components. The solutions c are also called eigenvectors. For
each eigenvalue there will be a corresponding eigenvector (known within a mul-
tiplicative constant, fixed by the normalization). We have thus N eigenvectors
and we can write that there are N solutions:
X
ψk = Cik bi , k = 1, . . . , N (4.33)
i
where Cik is a matrix formed by the N vectors c(k) , written as columns and
disposed side by side:
Eq.(4.32) is a common equation in linear algebra and there are standard meth-
ods to solve it. Given a matrix H, it is possible to obtain, using standard library
routines, the C matrix and the set Ek of eigenvalues.
The solution process is usually known as diagonalization. This name comes
from the following important property of C. Eq.(4.33) can be seen as a trans-
formation of the N starting functions into another set of N functions, via a
transformation matrix. It is possible to show that if the bi functions are or-
thonormal, the ψk functions are orthonormal as well. Then the transformation
is unitary, that is,
∗
X
Cij Cik = δjk (4.36)
i
36
holds. In matrix notations,
†
(C −1 )ij = Cji
∗
≡ Cij (4.37)
that is, the inverse matrix is equal to the conjugate of the transpose matrix,
or hermitian conjugate matrix. A matrix C having such property is called a
unitary matrix and typically represents a rotation.
Let us consider now the matrix product C −1 HC and let us calculate its
elements:
(C −1 HC)kn = ∗ ∗
X X
Cik En Cin = En Cik Cin = En δkn (4.39)
i i
where kn = 2πn/a, n = 0, ±1, ±2, .... Note that the f (x) function of Eq.(4.42)
is by construction a periodic function, with period equal to a: f (x + a) =
f (x), as can be immediately verified. This implies that f (−a/2) = f (+a/2)
37
must hold (also known under the name of periodic boundary conditions). The
expressions reported here are easily generalized to three or more dimensions.
In the following only a simple one-dimensional case will be shown.
Let us define our plane-wave basis set bi (x) as:
1 2π
bi (x) = √ eiki x , ki = i, i = 0, ±1, ±2, ..., ±N. (4.44)
a a
p2
Hij = hbi |H|bj i = hbi | + V (x)|bj i (4.46)
2m
can be trivially calculated. The kinetic term is diagonal (i.e. it can be repre-
sented by a diagonal matrix):
The potential term is nothing but the Fourier transform of the potential (apart
from a multiplicative factor):
Z a/2
1 1
hbi |V (x)|bj i = V (x)e−i(ki −kj )x dx = √ Ve (ki − kj ). (4.48)
a −a/2 a
A known property of Fourier transform ensures that the matrix elements of the
potential tend to zero for large values of ki − kj . The decay rate will depend
upon the spatial variation of the potential: faster for slowly varying potentials,
and vice versa. Potentials and wave functions varying on a typical length scale
λ have a significant Fourier transform up to kmax ∼ 2π/λ. In this way we can
estimate the number of plane waves needed to solve a problem.
38
with V0 > 0, b < a. The matrix elements of the Hamiltonian are given by
Eq.(4.47) for the kinetic part. by Eq.(4.48) for the potential. The latter can be
explicitly calculated:
Z b/2
1
hbi |V (x)|bj i = − V0 e−i(ki −kj )x dx (4.51)
a −b/2
b/2
V0 e−i(ki −kj )x
= − V0 (4.52)
a −i(ki − kj ) −b/2
V0 b
Ve (0) = − . (4.54)
a
Code pwell.f901 (or pwell.c2 ) generates the ki , fills the matrix Hij and di-
agonalizes it. The code uses units in which h̄2 /2m = 1 (e.g. atomic Rydberg
units). Input data are: width (b) and depth (V0 ) of the potential well, width
of the box (a), number of plane waves (2N + 1). On output, the code prints
the three lowest energy levels; moreover it writes to file gs-wfc.out the wave
function of the ground state.
39
BLAS5 (collected here: dgemm.f6 ) are also required. dsyev implements re-
duction to tridiagonal form for a real symmetric matrix (d=double precision,
sy=symmetric matrix, ev=calculate eigenvalues and eigenvectors). The usage
of dsyev requires either linking to a pre-compiled LAPACK and BLAS libraries,
or compilation of the Fortran version and subsequent linking. Instructions on
the correct way to call dsyev are contained in the header of the subroutine.
Beware: most diagonalization routines overwrite the input matrix!
For the C version of the code, it may be necessary to add an underscore (as in
dsyev () ) in the calling program. Moreover, the tricks explained in Sec.0.1.4
are used to define matrices and to pass arguments to BLAS and LAPACK
routines.
4.4.2 Laboratory
• Observe how the results converge with respect to the number of plane
waves, verify the form of the wave function. Verify the energy you get for
a known case. You may use for instance the following case: for V0 = 1,
b = 2, the exact result is E = −0.4538. You may (and should) also verify
the limit V0 → ∞ (what are the energy levels?).
• Observe how the results converge with respect to a. Note that for values
of a not so big with respect to b, the energy calculated with the variational
method is lower than the exact value. Why is it so?
• Plot the ground-state wave function. You can also modify the code to
write excited states. Do they look like what you expect?
• We know that for a symmetric potential, i.e. V (−x) = V (x), the solutions
have a well-defined parity, alternating even and odd parity (ground state
even, first excited state odd, and so on). Exploit this property to reduce
the problem into two sub-problems, one for even states and one for odd
states. Use sine and cosine functions, obtained by suitable combinations
of plane waves as above. Beware the correct normalization and the kn = 0
term! Why is this convenient? What is gained in computational terms?
5
http://www.netlib.org/blas/
6
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/dgemm.f
40
Chapter 5
In the variational method as seen in action in the previous chapter the wave
function is expanded over a set of orthonormal basis functions. In many phys-
ically relevant cases, it is useful to adopt a non-orthonormal basis set instead.
A paradigmatic case is the calculation of the electronic structure of molecules
using atom-centered localized functions, in particular, Gaussian functions, as
frequently done in Quantum Chemistry methods. In this chapter we consider
the extension of the variational method to the case of non-orthonormal basis
sets.
is not simply equal to δij . The quantities Sij are known as overlap integrals.
In principle, one can always derive an orthogonal basis set from a non-
orthoginal one using an orthogonalization procedure such as the Gram-Schmid
algorithm. Given a non-orthogonal basis set bi , the corresponding orthogonal
basis set b̃i is obtained as follows:
b̃1 = b1 (5.2)
b̃2 = b2 − b̃1 hb̃1 |b2 i/hb̃1 |b̃1 i (5.3)
b̃3 = b3 − b̃2 hb̃2 |b3 i/hb̃2 |b̃2 i − b̃1 hb̃1 |b3 i/hb̃1 |b̃1 i (5.4)
and so on. The b̃i are then normalized. In practice, such procedure is compu-
tationally expensive and numerically not very stable so usually one prefers to
adapt the approach of Sec.4.2.1 to a non-orthonormal basis set.
For a non-orthonormal basis set, Eq.(4.26) becomes
41
and the minimum condition, Eq.(4.30), becomes
X
(Hij − Sij )cj = 0 (5.6)
j
and |b̃i is the rotated basis set in which S is diagonal. Note that a zero eigenvalue
σ means that the corresponding |b̃i has zero norm, i.e. one of the b functions is
a linear combination of the other functions. In that case, the matrix is called
singular and some matrix operations (e.g. inversion) are not well defined.
Let us define now a second transformation matrix
Dij
Aij ≡ √ . (5.11)
σj
We can write
A∗ik
X X
Sij Ajn = δkn (5.12)
i j
(note that unlike D, the matrix A is not unitary) or, in matrix form, A† SA = I.
Let us now define
c = Av (5.13)
With this definition, Eq.(5.7) becomes
HA v = SA v (5.14)
A† HA v = A† SA v = v (5.15)
Thus, by solving the secular problem for operator A† HA, we find the desired
eigenvalues for the energy. In order to obtain the eigenvectors in the starting
base, it is sufficient, following Eq.(5.13), to apply operator A to each eigenvector.
42
5.1.1 Gaussian basis set
Atom-centered Gaussian functions are frequently used as basis functions, es-
pecially for atomic and molecular calculations. They are known as GTO:
Gaussian-Type Orbitals. An important feature of Gaussian functions is that
the product of two Gaussian functions, even if centered at different centers,
can be written as a single Gaussian. With rather straightworward algebra, one
demonstrates that
αβ
2 2 2 − α+β (r1 −r2 )2
e−α(r−r1 ) e−β(r−r2 ) = e−(α+β)(r−r0 ) e , (5.16)
where the new center r0 lies on the line connecting the two centers r1 and r2 :
αr1 + βr2
r0 = . (5.17)
α+β
Some useful integrals involving Gaussian functions:
Z ∞ 1/2
2 1 π
e−αx dx = , (5.18)
0 2 α
" 2
#∞
e−αx
Z ∞
−αx2 1
xe dx = − = , (5.19)
0 2α 0
2α
e−2Z(r1 +r2 ) 3 3 5π 2
Z
d r1 d r2 = . (5.23)
|r1 − r2 | 8Z 5
43
5.2 Code: hydrogen gauss
Code hydrogen gauss.f901 (or hydrogen gauss.c2 ) solves the secular prob-
lem for the hydrogen atom using two different non-orthonormal basis sets:
h̄2 ∇2 Zqe2
H=− − (5.26)
2me r
For the hydrogen atom, Z = 1.
Calculations for S- and P-wave Gaussians are completely independent. In
fact, the two sets of basis functions are mutually orthogonal: Sij = 0 if i is a
S-wave, j is a P-wave Gaussian, as evident from the different parity of the two
sets of functions. Moreover the matrix elements Hij of the Hamiltonian are
also zero between states of different angular momentum, for obvious symmetry
reasons. The S and H matrices are thus block matrices and the eigenvalue
problem can be solved separately for each block. The P-wave basis is clearly
unfit to describe the ground state, being orthogonal to it by construction, and
it is included mainly as an example.
The code reads from file a list of exponents, αi , and proceeds to evaluate all
matrix elements Hij and Sij . The calculation is based upon analytical results for
integrals of Gaussian functions (Sec.5.1.1). In particular, for S-wave Gaussians
one has !3/2
π
Z
−(αi +αj )r2 3
Sij = e d r= (5.27)
αi + αj
while the kinetic and Coulomb terms in Hij are respectively
" # !3/2
h̄2 ∇2 −αj r2 3 h̄2 6αi αj π
Z
−αi r2
HijK = e − e d r= (5.28)
2me 2me αi + αj αi + αj
" #
Zq 2 2πZqe2
Z
−αi r2 2
HijV = e − e e−αj r d3 r = − (5.29)
r αi + αj
1
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/F90/hydrogen gauss.f90
2
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/C/hydrogen gauss.c
44
For the P-wave basis the procedure is analogous, using the corresponding (and
more complex) analytical expressions for integrals.
The code then calls subroutine diag that solves the generalized secular
problem (i.e. it applies the variational principle). Subroutine diag returns a
vector e containing eigenvalues (in order of increasing energy) and a matrix v
containing the eigenvectors, i.e. the expansion coefficients of wave functions.
Internally, diag performs the calculation described in the preceding section
in two stages. The solution of the simple eigenvalue problem is performed by
the subroutine dsyev we have already seen in Sec.4.4.
In principle, one could use a single LAPACK routine, dsygv, that solves
the generalized secular problem, Hψ = Sψ, with a single call. In practice,
one has to be careful to avoid numerical instabilities related to the problem
of linear dependencies among basis functions (see Eq.(5.10) and the following
discussion). Inside routine diag, all eigenvectors of matrix S corresponding to
very small eigenvectors, i.e. smaller than a pre-fixed threshold, are discarded,
before proceeding with the second diagonalization. The number of linearly
independent eigenvectors is reprinted in the output.
The reason for such procedure is that it is not uncommon to discover that
some basis functions can almost exactly be written as sums of some other basis
functions. This does not happen if the basis set is well chosen, but it can happen
if the basis set functions are too numerous or not well chosen (e.g. with too
close exponents). A wise choice of the αj coefficients is needed in order to have
a reach accuracy without numerical instabilities.
The code then proceeds and writes to files s-coeff.out (or p-coeff.out)
the coefficients of the expansion of the wave function into Gaussians. The
ground state wave function is written into file s-wfc.out (or p-wfc.out).
Notice the usage of dgemm calls to perform matrix-matrix multiplication.
The header of dgemm.f contains a detailed documentation on how to call it.
Its usage may seem awkward at a first sight (and also at a second one). This
is a consequence in part of the Fortran way to store matrices, requiring the
knowledge of the first, or “leading”, dimension of matrices; in part, of the old-
style Fortran way to pass variables, including vectors and arrays, to subroutines
under the form of pointers. One may wonder why bother with dgemm and its
obscure syntax and why not use the Fortran-90 syntax and the MATMUL intrinsic
function instead: they are so much easier to use! The reason is efficiency: very
efficient implementations of dgemm exist for modern architectures. On the other
hand, modern language features that look great on paper, and sometimes are
great also in practice, may turn out to be inefficient.
For the C version of the code, and how matrices are introduced and passed
to Fortran routines, see Sec.0.1.4.
5.2.1 Laboratory
• Verify the accuracy of the energy eigenvalues, starting with one Gaussian,
then 2, then 3. Try to find the best values for the coefficients for the 1s
state (i.e. the values that yield the lowest energy).
45
• Compare with the the solutions obtained using code hydrogen radial.
Plot the 1s numerical solution (calculated with high accuracy) and the
“best” 1s solution√for 1, 2, 3, Gaussians (you will need to multiply the
latter by a factor 4π: why? where does it come from?). What do you
observe? where is the most significant error concentrated?
• Compare with the results for the following optimized basis sets (a.u.):
• Observe and discuss the ground state obtained using the P-wave basis set
• Observe the effects related to the number of basis functions, and to the
choice of the parameters α. Try for instance to choose the characteristic
√
Gaussian widths, λ = 1/ α, as uniformly distributed between suitably
chosen λmin and λmax .
• For Z > 1, how would you re-scale the coefficients of the optimized Gaus-
sians above?
46
Chapter 6
Self-consistent field
where Z is the charge of the nucleus and the sum is over pairs of electrons i
and j, i.e. each pair appears only once. Alternatively:
X N
X −1 N
X
= (6.2)
hiji i=1 j=i+1
47
6.1.1 Slater determinants
A N −electron wave function can be built from a set of orbitals φi , i = 1, . . . , N
as a Slater determinant:
φ1 (1) . . . φ1 (N )
1 . . .
ψ(1, . . . , N ) = √ (6.5)
. . .
N!
φN (1) . . . φN (N )
Here the notation (N ) ≡ (rN , σN ) indicates position and spin variables for the
N −th electron. A Slater determinant has by construction the required antisym-
metry properties for a many-electron wave function: in fact, the exchange of
two particles is equivalent to the exchange of two columns, which produces, due
to a known property of determinants, a change of sign. Note that if two rows
are equal, the determinant is zero: all φi ’s must be different. This demonstrates
Pauli’s exclusion principle: two (or more) identical fermions cannot occupy the
same state.
Note that the single-electron orbitals φi are assumed to be orthonormal:
Z
φ∗i (1)φj (1)dv1 = δij (6.6)
To demonstrate it, one may observe that by expanding the first determinant,
one obtains N ! terms that, once integrated, are identical.
48
and
XZ
φ∗i (1)φ∗j (2)g12 [φi (1)φj (2) − φj (1)φi (2)] dv1 dv2 .
X
hψ| gij |ψi = (6.9)
hiji hiji
Notice the sign and the index permutation in the second term in square brackets:
both come from the antisymmetry. The integrals implicitly include summation
over spin components. If we assume that g12 depends only upon coordinates,
as in Coulomb interaction, and not upon spins, the second term is zero if i
and j states have different spins. For this reason, it is convenient to make spin
variables explicit. Eq.(6.9) can then be rewritten as
XZ
φ∗i (1)φ∗j (2)g12 [φi (1)φj (2) − δ(σi , σj )φj (1)φi (2)] dv1 dv2
X
hψ| gij |ψi =
hiji hiji
(6.10)
where σi is the spin of electron i, and:
δ(σi , σj ) = 0 if σi 6= σj
= 1 if σi = σj
In summary:
XZ
hψ|H|ψi = φ∗i (1)f1 φi (1) dv1 (6.11)
i
XZ
+ φ∗i (1)φ∗j (2)g12 [φi (1)φj (2) − δ(σi , σj )φj (1)φi (2)] dv1 dv2
hiji
(the variations of all other normalization integrals will be zero) and, using the
hermiticity of H as in Sec.4.1.1,
Z
δhψ|H|ψi = δφ∗k (1)f1 φk (1) dv1 + c.c. (6.15)
XZ
+ δφ∗k (1)φ∗j (2)g12 [φk (1)φj (2) − φk (2)φj (1)δ(σk , σj )] dv1 dv2 + c.c.
j
49
Thus the variational principle takes the form
Z Z
δφ∗k (1) {f1 φk (1) φ∗j (2)g12
X
+ [φk (1)φj (2) (6.16)
j
− φk (2)φj (1)δ(σk , σj )] dv2 − k φk (1)} dv1 + c.c. = 0
i.e. the term between curly brackets (and its complex conjugate) must vanish
so that the above equation is satisfied for any variation. This leads to the set
of integro-differential Hartree-Fock equations:
XZ
f1 φk (1) + φ∗j (2)g12 [φk (1)φj (2) − δ(σk , σj )φj (1)φk (2)] dv2 = k φk (1)
j
(6.17)
or, in more explicit form,
h̄2 2 Zqe2 XZ q2
− ∇1 φk (1) − φk (1) + φ∗j (2) e [φj (2)φk (1) (6.18)
2me r1 j
r12
− δ(σk , σj )φk (2)φj (1)] dv2 = k φk (1)
Eq.(6.18) has normally an infinite number of solutions, of which only the lowest-
energy N will be occupied by electrons, the rest playing the role of excited
states. The sum over index j runs only on occupied states.
h̄2 2 Zqe2
− ∇1 φk (1) − φk (1) + VH (1)φk (1) + (V̂x φk )(1) = k φk (1), (6.19)
2me r1
where we have introduced the Hartree potential VH and the exchange poten-
tial V̂x . The Hartree potential is the average electrostatic potential felt by an
electron in the field generated by all other electrons:
XZ qe2 qe2
Z
VH (1) = φ∗j (2) φj (2)dv2 ≡ ρ(2) dv2 , (6.20)
j
r12 r12
Note that both the Hartree potential and the charge density do not actually
depend upon the spin.
50
The exchange potential reflects the effect of antisymmetry between electrons
with the same spin:
qe2
Z
φj (1)φ∗j (2)
X
(V̂x φk )(1) = − δ(σk , σj ) φk (2) dv2 . (6.23)
j
r12
While the Hartree potential is local (just multiplies the orbitals), the exchange
potential is non local, acting on orbitals as
Z
(V̂x φk )(1) ≡ Vx (1, 2)φk (2)dv2 . (6.24)
The careful observer will notice an alarming feature: the Hartree potential
contains a “self-interaction” of an electron with itself. Such interaction is ob-
viously spurious and unphysical. The same term with opposit sign is however
present in the exchange potential, so it cancels out in the equations.
The factors 1/2 reflect the fact that the sums run over pairs of orbitals. The first
term in the energy has a one-electron character and containg the kinetic and
potential energy. The second term is called Hartree energy and is of electrostatic
character; the last term is called exchange energy.
Alternatively, one may use the sum of eigenvalues of Eq.(6.18): by multi-
plying the two sides of Eq.(6.18) by φ∗k (1) and integrating over dv1 , one finds
X Z
φ∗k (1)φ∗j (2)g12 [φk (1)φj (2) − δ(σj , σk )φj (1)φk (2)] dv1 dv2 ,
X
E= k −
k <jk>
(6.26)
or, in terms of the Hartree and exchange potential:
1 1X
X Z Z
E= k − ρ(1)VH (1)dv1 − φk (1)V̂x (1, 2)φk (2)dv1 dv2 . (6.27)
k
2 2 k
Notice the sign of the Hartree and exchange energy terms: they compensate for
the double counting of those terms that is present in the eigenvalue sum.
The Hartree-Fock energy is not the exact energy: it would be in a world
where the exact wave function has the form of a Slater determinant. This
is in general not true. The energy difference between the exact and Hartree-
Fock solution is known as correlation energy.1 This name reflects the fact
1
Feynman called it stupidity energy, because the only physical quantity that it measures is
our inability to find the exact solution!
51
that the Hartree-Fock approximation misses part of the ”electron correlation”:
the effects of an electron on all others. This is present in Hartree-Fock via
the exchange and electrostatic interactions, but more subtle effects are not
accounted for, because they require a more general form of the wave function.
For instance, the probability P (r1 , r2 ) to find an electron at distance r1 and
one at distance r2 from the origin is not simply equal to p(r1 )p(r2 ), because
electrons try to ”avoid” each other. The correlation energy in the case of He
atom is about 0.084 Ry: a small quantity relative to the energy (∼ 1.5%), but
not negligible.
Zq 2 qe2
Z
Vscf (r1 ) = − e + ρ̃(r2 ) dr2 , ρ̃(r2 ) = |φ(r2 )|2 . (6.30)
r1 r12
Note that ρ̃ is half of the charge density.
For closed-shell atoms, a further big simplification can be achieved: Vscf is a
central field, i.e. it depends only on the distance r1 between the electron and the
nucleus. Even in open-shell atoms, this can be imposed as an approximation,
by spherically averaging ρ. The simplification is considerable, since we know a
priori that the orbitals will be factorized as in Eq.(2.9). The angular part is
given by spherical harmonics, labelled with quantum numbers ` and m, while
the radial part is characterized by quantum numbers n and `. Of course the
accidental degeneracy for different ` is no longer present. It turns out that even
in open-shell atoms, this is an excellent approximation.
52
6.2 Code: helium hf radial
Code helium hf radial.f902 (or helium hf radial.c3 ) solves Hartree-Fock
equations for the ground state of He atom. helium hf radial is based on code
hydrogen radial and uses the same integration algorithm based on Numerov’s
method. The new part is the implementation of the method of self-consistent
field for finding the orbitals.
The calculation consists in solving the radial part of the Hartree-Fock equa-
tion (6.29) for the effective potential of Eq.(6.30), assumed to be radial:
Zq 2 qe2
Z
Vscf (r) = − e + ṼH (r) , ṼH (r) ρ̃(r0 ) dr0 . (6.31)
r |r − r0 |
Note that ṼH is half of the Hartree potential. Vscf (r) depends in turn upon the
solution via ρ̃(r). We start from an initial estimate for ṼH (r) (simply, ṼH (r) =
0), calculated in routine init pot. With the ground state R(r) obtained from
such potential, we calculate in routine rho of r the charge density (of the other
electron) ρ̃(r) = |R(r)|2 /4π (do not forget the angular part!). Routine v of rho
re-calculates the new potential ṼHout (r) by integration, using the Gauss theorem:
Z r
Q(s)
Z
ṼHout (r) = V0 + qe2 ds, Q(s) = ρ(r)4πr2 dr (6.32)
rmax s2 r<s
where Q(s) is the charge contained in the sphere of radius s; rmax is the out-
ermost grid point, such that the potential has already assumed the asymptotic
value V0 = qe2 /rmax , valid at large r.
The new potential is then re-introduced in the calculation not directly but as
a linear combination of the old and the new potential. This is the simplest tech-
nique to ensure that the self-consistent procedure converges. It is not needed
in this case, but in most cases it is: there is no guarantee that re-inserting the
new potential in input will lead to convergence. We can write
This term accounst for the fact that eigenvalues are calculated using the input
potential, while other energy terms are calculated using the output potential.
By adding this correction, the energy obtained from the eigenvalue sum as in
2
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/F90/helium hf radial.f90
3
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/C/helium hf radial.c
53
Eq.(6.27) is the same as the one obtained using Eq.(6.25), also far from self-
consistency. The two values of the energy are printed side by side.
Also noticeable is the ”virial check”: for a Coulomb potential, the virial
theorem states that hT i = −hV i/2, where the two terms are respectively the
average values of the kinetic and the potential energy. It can be demonstrated
that the Hartree-Fock solution obeys the virial theorem.
6.2.1 Laboratory
• Observe the behavior of self-consistency, verify that the energy (but not
any single term of the energy!) decreases monotonically. Also note that
the self-consistency error (the “variational correction” term) decreases
exponentially with the number of iterations.
• Compare the energy obtained with this and with other methods: per-
turbation theory with hydrogen-like wave functions (E = −5.5 Ry, Sect.
D.1), variational theory with effective Z (E = −5.695 Ry, Sect. D.2),
best numerical Hartree(-Fock) result (E = −5.72336 Ry, as found in the
literature), experimental result (E = −5.8074 Ry).
• Make a plot of orbitals (file wfc.out) for different n and `. Note that
the orbitals and the corresponding eigenvalues become more and more
hydrogen-like for higher n. Can you explain why?
• If you do not know how to answer the previous question: make a plot
of Vscf (file pot.out) and compare its behavior with that of the −Zqe2 /r
term. What do you notice?
54
Chapter 7
Molecules
where TI is the kinetic energy of nuclei, VII is the Coulomb repulsion between
nuclei, VeI is the Coulomb attraction between nuclei and electrons, Te is the
kinetic energy of electrons, Vee is the Coulomb repulsion between electrons:
X h̄2 2 X h̄2 qe2 X Zµ Zν
TI = − ∇ , Te = − ∇2i , VII = ,
µ=1,N
2Mµ µ i=1,n
2m 2 µ6=ν |Rµ − Rν |
qe2 X 1 X X Zµ
Vee = , VeI = −qe2 . (7.2)
2 i6=j |ri − rj | µ=1,N i=1,n
|Rµ − ri |
This looks like an impressive problem. It is however possible to exploit the mass
difference between electrons and nuclei to separate the global problem into an
55
electronic problem for fixed nuclei and a nuclear problem under an effective
potential generated by electrons. Such separation is known as adiabatic or Born-
Oppenheimer approximation. The crucial point is that the electronic motion
is much faster than the nuclear motion: while forces on nuclei and electrons
have the same order of magnitude, an electron is at least ∼ 2000 times lighter
than any nucleus. We can thus assume that at any time the electrons ”follow”
the nuclear motion, while the nuclei at any time ”feel” an effective potential
generated by electrons. Formally, we assume a wave function of the form
(l)
Ψ(Rµ , ri ) = Φ(Rµ )ψR (ri ) (7.3)
(l)
where the electronic wave function ψR (ri ) solves the following Schrödinger
equation:
(l) (l) (l)
(Te + Vee + VeI ) ψR (ri ) = ER ψR (ri ). (7.4)
The index R is a reminder that both the wave function and the energy depend
upon the nuclear coordinates, via VeI ; the index l classifies electronic states.
We now insert the wave function, Eq.(7.3), into Eq.(7.1) and notice that Te
does not act on nuclear variables. We will get the following equation:
(l) (l) (l)
TI + VII + ER Φ(Rµ )ψR (ri ) = EΦ(Rµ )ψR (ri ). (7.5)
(l) (l)
where electrons have ”disappeared” into the eigenvalue ER . The term VII +ER
plays the role of effective interaction potential between nuclei. Of course such
potential, as well as eigenfunctions and eigenvalues of the nuclear problem,
depends upon the particular electronic state.
The Born-Oppenheimer approximation is very well verified, except the spe-
cial cases of non-adiabatic phenomena (that are very important, though). The
main neglected term in Eq.7.6 has the form
X h̄2
(l)
(∇µ Φ(Rµ )) ∇µ ψR (ri ) (7.8)
µ Mµ
56
a problem for nuclei only, Eq.(7.7). The latter is in fact a Schrödinger equa-
tion in which the nuclei interact via an effective interatomic potential, V (Rµ ) ≡
VII +E (l) , a function of the atomic positions Rµ and of the electronic state. The
interatomic potential V (Rµ ) is also known as potential energy surface (“poten-
tial” and “potential energy” are in this context synonyms), or PES. It is clear
that the nuclear motion is completely determined by the PES (assuming that
the electron states does not change with time) since forces acting on nuclei are
nothing but the gradient of the PES:
Fµ = −∇µ V (R(0)
µ ) = 0. (7.10)
qe2 Z1 Z2
EII (R) = (7.11)
R
where Z1 and Z2 are nuclear charges for the two nuclei.
Let us consider the electronic ground state only for H2 molecule. At small
R, repulsion between nuclei is dominant, V (R) becomes positive, diverging like
qe2 /R for R → 0. At large R, the ground state becomes that of two neutral
H atoms, thus V (R) ' 2Ry. At intermediate R, the curve has a minimum at
about R0 = 0.74Å, with V (R0 ) ' V (∞) − 4.5eV. Such value – the difference
57
between the potential energy of atoms at large distances and at the minimum,
is known as cohesive or binding energy. The form of the interatomic potential is
reminiscent of that of model potentials like Morse (in fact such potentials were
proposed to model binding).
What is the electronic ground state for R ∼ R0 ? We can get an idea by
using the method of molecular orbitals: an approximate solution in which single-
electron states are formed as linear combinations of atomic states centered
about the two nuclei. Combinations with the same phase are called ligand, as
they tend to accumulate charge in the region of space between the two nuclei.
Combinations with opposite phase are called antiligand, since they tend to
deplete charge between the nuclei. Starting from molecular orbitals, one can
build the wave function as a Slater determinant. Two ligand states of opposite
spin, built as superpositions of 1s states centered on the two nuclei (σ orbitals),
yield a good approximation to the ground state. By construction, the total spin
of the ground state is zero.
Molecular orbitals theory can explain qualitatively the characteristics of the
ground (and also excited) states, for the homonuclear dimer series (i.e. formed
by two equal nuclei). It is however no more than semi-quantitative; for better
results, one has to resort to the variational method, typically in the framework
of Hartree-Fock or similar approximations. Orbitals are expanded on a basis
set of functions, often atom-centered Gaussians or atomic orbitals, and the
Hartree-Fock or similar equations are solved on this basis set.
The index k labels the coordinate parts of the orbitals; for each k there is
a spin-up and a spin-down orbital. F is called the Fock operator. This is of
course a non-local operator which depends upon all orbitals φk . Explicitly, from
Eqs.(6.18):
Let us look now for a solution under the form of an expansion on a basis of
(k)
functions: φk (r) = M
P
1 ci bi (r). We find the Rothaan-Hartree-Fock equations:
58
(k) (k) (k)
where c(k) = (c1 , c2 , . . . , cM ) is the vector of the expansion coefficients, S is
the superposition matrix, F is the matrix of the Fock operator on the basis set
functions:
Fij = hbi |F|bj i, Sij = hbi |bj i. (7.15)
that after some algebra can be written as
N/2
1
XX X (k)∗
Fij = fij + 2 cl c(k)
m
giljm − gijlm , (7.16)
l m k=1
2
The sum over states between parentheses in Eq.(7.16) is called density matrix.
The two terms in the second parentheses come respectively from the Hartree
and the exchange potentials.
The problem of Eq.(7.14) is more complex than a normal secular problem
solvable by diagonalization, since the Fock matrix, Eq.(7.16), depends upon its
own eigenvectors. It is however possible to reconduct the solution to a self-
consistent procedure, in which at each step a fixed matrix is diagonalized (or,
for a non-orthonormal basis, a generalized diagonalization is performed at each
step).
For matrix elements between Gaussians centered around the same centers,
one can easily find analytical results, using the basic ingredients already used
for code hydrogen gauss. We need an expression for the giljm matrix ele-
ments introduced in Eq.(7.18). Using the properties of products of Gaussians,
Eq.(5.16), these can be written in terms of the integral
1 3 3
Z
2 2
I= e−αr1 e−βr2 d r1 d r2 . (7.19)
r12
Let us look for a variable change that makes (r1 −r2 )2 to appear in the exponent
of the Gaussians:
h i
αr12 + βr22 = γ (r1 − r2 )2 + (ar1 + br2 )2 (7.20)
s 2
αβ α β
r
2
= (r1 − r2 ) + r1 + r2 . (7.21)
α+β β α
Let us now introduce a further variable change from (r1 , r2 ) to (r, s), where
s
α β
r
r = r1 − r2 , s= r1 + r2 ; (7.22)
β α
The integral becomes
αβ 2 1 ∂(r1 , r2 ) 3 3
Z αβ 2
− α+β r − α+β s
I= e e ∂(r, s) d rd s,
(7.23)
r
59
where the Jacobian is easily calculated as the determinant of the transformation
matrix, Eq.(7.22):
√ !3
∂(r1 , r2 ) αβ
∂(r, s) = α + β . (7.24)
The calculation of the integral is trivial and provides the required result:
2π 5/2 qe2
giljm = (7.25)
αβ(α + β)1/2
where α = αi + αj , β = αl + αm .
60
√
In the case Rij − R = 0 we use the limit erf(x) → 2x/ π to obtain
2π
Vij = − Kij , Rij − R = 0 (7.33)
αi + αj
(beware indices!).
Although symmetry is not used in the code, it can be used to reduce by a
sizable amount the number of bi-electronic integrals giljm . They are obviously
invariant under exchange of i, j and l, m indices. This means that if we have
N basis set functions, the number of independent matrix elements is not N 4
but M 2 , where M = N (N + 1)/2 is the number of pairs of (i, j) and (l, m)
indices. The symmetry of the integral under exchange of r and r0 leads to
another symmetry: giljm is invariant under exchange of the (i, j) and (l, m)
pairs. This further reduces the independent number of matrix elements by a
factor 2, to M (M + 1)/2 ∼ N 4 /8.
61
The self-consistent procedure is even simpler than in code helium hf radial:
at each step, the Fock matrix is re-calculated using the density matrix at the
preceding step, with no special tricks or algorithms, until energy converges
within a given numerical threshold.
7.5.1 Laboratory
• Chosen a basis set that yields a good description of isolated atoms, find the
equilibrium distance by minimizing the (electronic plus nuclear) energy.
Verify how sensitive the result is with respect to the dimension of the
basis set. Note that the “binding energy” printed on output is calculated
assuming that the isolated H atom has an energy of -1 Ry, but you should
verify what the actual energy of the isolated H atom is for your basis set.
• Plot the ground state molecular orbital, together with a ligand combi-
nation of 1s states centered on the two H nuclei (obtained from codes
for hydrogen). You should find that slightly contracted Slater orbitals,
corresponding to Z = 1.24, yield a better fit than the 1s of H. Try the
same for the first excited state of H2 and the antiligand combination of
1s states.
• Study the limit of superposed atoms (R → 0) and compare with the results
of code hydrogen gauss and helium hf radial. The limit of isolated
atoms (R → ∞) will instead yield strange results. Can you explain why?
What do you expect to be wrong in the Slater determinant in this limit?
62
Chapter 8
63
by Hartree-Fock or Density-Functional theory. In the end, the basic step is to
solve to the problem of calculating the energy levels in a periodic potential.
We haven’t yet said anything about the composition and the periodicity of
our system. Let us simplify further the problem and assume a one-dimensional
array of atoms of the same kind, regularly spaced by a distance a. The atomic
position of atom n will thus be given as an = na, with n running on all integer
numbers, positive and negative. In the jargon of solid-state physics, a is the
lattice parameter, while the an are the vectors of the crystal lattice. The system
has a discrete translational invariance, that is: it is equal to itself if trans-
lated by a or multiples of a. Called V (x) the crystal potential, formed by the
superposition of atomic-like potentials: V (x) = n Vn (x − an ), the following
P
64
is build as an anti-symmetrized product of single-electron states taken as spin-
up and spin-down pairs (as in the case of He and H2 ). Of course the resulting
state will have zero magnetization (S = 0). The exact number of electrons in a
crystal depends upon its atomic composition. Even if we assume the minimal
case of one electron per atom, we still have N electrons and we need to calculate
N/2 states, with N → ∞. How can we deal with such a macroscopic number
of states?
ψk (x + a) = ψk (x)eika . (8.1)
Let us classify our solution using the Bloch vector k (in our case, a one-
dimensional vector, i.e. a number). The Bloch vector is related to the eigenvalue
of the translation operator (we remind that H and T are commuting opera-
tors). Eq.(8.1) suggests that all k differing by a multiple of 2π/a are equivalent
(i.e. they correspond to the same eigenvalue of T ). It is thus convenient to
restrict to the following interval of values for k: k: −π/a < k ≤ π/a. Values
of k outside such interval are brought back into the interval by a translation
Gn = 2πn/a.
We must moreover verify that our Bloch states are compatible with PBC.
It is immediate to verify that only values of k such that exp(ikL) = 1 are
compatible with PBC, that is, k must be an integer multiple of 2π/L. As
a consequence, for a finite number N of atoms (i.e. for a finite dimension
L = N a of the box), there are N admissible values of k: kn = 2πn/L, con
n = −N/2, ..., N/2 (note that k−N/2 = −π/a is equivalent to kN/2 = π/a). In
the thermodynamical limit, N → ∞, these N Bloch vectors will form a dense
set between −π/a and π/a, in practice a continuum.
65
In order to obtain the same description as for a periodic potential, we simply
“refold” the wave vectors k into the interval −π/a < k ≤ π/a, by applying
the translations Gn = 2πn/a. Let us observe the energies as a function of the
“refolded” k, Eq.(8.2): for each value of k in the interval −π/a < k ≤ π/a there
are many (actually infinite) states with energy given by n (k) = h̄2 (k+Gn )2 /2m.
The corresponding Bloch states have the form
1
ψk,n (x) = √ eikx uk,n (x), uk,n (x) = eiGn x . (8.3)
L
The function uk,n (x) is by construction periodic. Notice that we have moved
from an “extended” description, in which the vector k covers the entire space, to
a “reduced” description in which k is limited between −π/a and π/a. Also for
the space of vectors k, we can introduce a “unit cell”, ] − π/a, π/a], periodically
repeated with period 2π/a. Such cell is also called Brillouin Zone (BZ). It is
immediately verified that the periodicity in k-space is given by the so-called
reciprocal lattice: a lattice of vectors Gn such that Gn · am = 2πp, where p is
an integer.
66
where the sum over p runs over all the N vectors of the lattice. The purely
geometric factor multiplying the integral differs from zero only if k and k 0
coincide:
0
eip(k −k)a = N δk,k0 .
X
(8.9)
p
We have used Kronecker’s delta, not Dirac’s delta, because the k form a dense
but still finite set (there are N of them). We note that the latter orthogonality
relation holds irrespective of the periodic part u(x) of Bloch states. There is no
reason to assume that the periodic parts of the Bloch states at different k are
orthogonal: only those for different Bloch states at the same k are orthogonal
(see Eq.(8.7)).
67
This yields
Z L/2
1 2
hbi,k |V |bj,k i = Ae−αx e−iGx dx (8.15)
a −L/2
The integral is known (it can be calculated using the tricks and formulae given
in previous sections, extended to complex plane):
Z ∞ r
−αx2 −iGx π −G2 /4α
e e dx = e (8.16)
−∞ α
1 2π
Z
fj = V (x)e−iGj x dx, Gj = j , j = 0, n − 1. (8.17)
L a
We can exploit periodicity to show that
Z a
1
fj = V (x)e−iGj x dx. (8.18)
a 0
This is nothing but the FT f˜(Gj ), with a slightly different factor (1/a instead
√
of 1/ a) with respect to the definition of Eq.(4.43). Note that the integration
limits can be translated at will, again due to periodicity. Let us write now such
integrals as a finite sum over grid points (with ∆x = a/n as finite integration
step):
1 n−1
V (xm )e−iGj xm ∆x
X
fj =
a m=0
1 n−1
V (xm )e−iGj xm
X
=
n m=0
1 n−1
X jm
= Vm exp[−2π i], Vm ≡ V (xm ). (8.19)
n m=0 n
Notice that the FT is now a periodic function in the variable G, with period
Gn = 2πn/a! This shouldn’t come as a surprise though: the FT of a periodic
function is a discrete function, the FT of a discrete function is periodic.
68
It is easy to verify that the potential in real space can be obtained back
from its FT as follows:
n−1
X
V (x) = fj eiGj x , (8.20)
j=0
The two operations of Eq.(8.19) and (8.21) are called Discrete Fourier Trans-
form. One may wonder where have all the G vectors with negative values gone:
after all, we would like to calculate fj for all j such that |Gj |2 < Ec (for some
suitably chosen value of Ec ), not for Gj with j ranging from 0 to n − 1. The
periodicity of the discrete FT in both real and reciprocal space however allows
to refold the Gj on the “right-hand side of the box”, so to speak, to negative
Gj values, by making a translation of 2πn/a.
The discrete FT of a function defined on a grid of n points requires O(n2 )
operations: a sum over n terms for each of the n points. There is however
a recursive version of the algorithm, the Fast FT or FFT, which can do the
transform in O(n log n) operations. The difference may not seem so important
but it is: the FFT is at the heart of many algorithms used in different fields.
An example of usage of FFTs is provided in codes testfft.f901 and
testfft.c2 . Their compilation and linking requires the FFTW3 v.3 library.
If properly installed on your system, it is sufficient to specify -lfftw3. In some
cases you may need to specify -I followed by the directory where files to be
included: fftw3.f034 for Fortran, fftw3.h5 for C, can be found. Note that
Intel MKL libraries contain, in addition to all BLAS and LAPACK, FFTW3
routines as well.
69
solution on a plane-wave basis set of the problem of a single potential well.
Code periodicwell.f906 (or periodicwell.c7 ) is in fact a trivial extension
of code pwell. Such code in fact uses a plane-wave basis set like the one
in Eq.(8.10), which means that it actually solves the periodic Kronig-Penney
model for k = 0. If we increase the size of the cell until this becomes large with
respect to the dimension of the single well, then we solve the case of the isolate
potential well.
The generalization to the periodic model only requires the introduction of
the Bloch vector k. Our base is given by Eq.(8.10). In order to choose when to
truncate it, it is convenient to consider plane waves up to a maximum (cutoff)
kinetic energy:
h̄2 (k + Gn )2
≤ Ecut . (8.23)
2m
Bloch wave functions are expanded into plane waves:
X
ψk (x) = cn bn,k (x) (8.24)
n
2
n |cn |
P
and are automatically normalized if = 1. The matrix elements of the
Hamiltonian are very simple:
h̄2 (k + Gi )2
Hij = hbi,k |H|bj,k i = δij + Ve (Gi − Gj ), (8.25)
2m
where Ve (G) is the Fourier transform of the crystal potential, defined as in
Eq.(8.18). Code pwell may be entirely recycled and generalized to the solution
for Bloch vector k. It is convenient to introduce a cutoff parameter Ecut for the
truncation of the basis set. This is preferable to setting a maximum number of
plane waves, because the convergence depends only upon the modulus of k + G.
The number of plane waves, instead, also depends upon the dimension a of the
unit cell.
Code periodicwell requires in input the well depth, V0 , the well width,
b, the unit cell length, a. Internally, a loop over k points covers the entire BZ
(that is, the interval [−π/a, π/a] in this specific case), calculates E(k), writes
the lowest E(k) values to files bands.out in an easily plottable format.
8.2.1 Laboratory
• Plot E(k), that goes under the name of band structure, or also dispersion.
Note that if the potential is weak (the so-called quasi-free electrons case),
its main effect is to induce the appearance of intervals of forbidden energy
(i.e.: of energy values to which no state corresponds) at the boundaries
of the BZ. In the jargon of solid-state physics, the potential opens a gap.
This effect can be predicted on the basis of perturbation theory.
• Observe how E(k) varies as a function of the periodicity and of the well
depth and width. As a rule, a band becomes wider (more dispersed, in
6
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/F90/periodicwell.f90
7
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/C/periodicwell.c
70
the jargon of solid-state physics) for increasing superposition of the atomic
states.
• Plot for a few low-lying bands the Bloch states in real space (borrow and
adapt the code from pwell). Remember that Bloch states are complex
for a general value of k. Look in particular at the behavior of states for
k = 0 and k = ±π/a (the “zone boundary”). Can you understand their
form?
71
Chapter 9
Pseudopotentials
In general, the band structure of a solid will be composed both of more or less
extended states, coming from outer atomic orbitals, and of strongly localized
(core) states, coming from deep atomic levels. Extended states are the interest-
ing part, since they determine the (structural, transport, etc.) properties of the
solid. The idea arises naturally to get rid of core states by replacing the true
Coulomb potential and core electrons with a pseudopotential (or effective core
potential in Quantum Chemistry parlance): an effective potential that “mim-
ics” the effects of the nucleus and the core electrons on valence electrons. A big
advantage of the pseudopotential approach is to allow the usage of a plane-wave
basis set in realistic calculations.
Rn = n1 a1 + n2 a2 + n3 a3 (9.1)
72
A reciprocal lattice of vectors Gm such that Gm · Rn = 2πp, with p integer,
is introduced. It can be shown that
Gm = m1 b1 + m2 b2 + m3 b3 (9.3)
2π 2π 2π
b1 = a2 × a3 , b2 = a3 × a2 , b3 = a1 × a2 (9.4)
Ω Ω Ω
(note that ai · bj = 2πδij ). The Bloch theorem generalizes to
where the Bloch vector k is any vector obeying the PBC. Bloch vectors are
usually taken into the three-dimensional Brillouin Zone (BZ), that is, the unit
cell of the reciprocal lattice. It is a straightforward exercise in vector algebra
to show that the volume ΩBZ of the Brillouin Zone is related to the volume of
the unit cell by ΩBZ = 8π 3 /Ω.
It can be shown that there are N Bloch vectors compatible with the box
defined in Eq.(9.2); in the thermodynamical limit N → ∞, the Bloch vector
becomes a continuous variable as in the one-dimensional case. We remark that
this means that at each k-point we have to “accommodate” ν electrons, where ν
is the number of electrons in the unit cell. For a nonmagnetic, spin-unpolarized
insulator, this means ν/2 filled states. In semiconductor physics, occupied states
are called “valence bands”, while empty states are called “conduction bands”.
We write the electronic states as ψk,i where k is the Bloch vector and i is the
band index.
73
that vary strongly in a small region of space requires a large number of delo-
calized functions such as plane waves.
Let us estimate how large is this large number using Fourier analysis. In
order to describe features which vary on a length scale δ, one needs Fourier
components up to qmax ∼ 2π/δ. In a crystal, our wave vectors q = k + G have
discrete values. There will be a number NP W of plane waves approximately
equal to the volume of the sphere of radius qmax , divided by the volume ΩBZ
of the unit cell of the reciprocal lattice, i.e. of the BZ:
3
4πqmax
NP W ' . (9.8)
3ΩBZ
A simple estimate for diamond is instructive. The 1s orbital of the carbon atom
has its maximum around 0.3 a.u., so δ ' 0.1 a.u. is a reasonable value. Diamond
has a ”face-centered cubic” (fcc) lattice with lattice parameter a0 = 6.74 a.u.
and primitive vectors:
1 1 1 1 1 1
a1 = a0 0, , , a2 = a0 , 0, , a3 = a0 , ,0 . (9.9)
2 2 2 2 2 2
The unit cell has a volume Ω = a30 /4, the BZ has a volume ΩBZ = (2π)3 /(a30 /4).
Inserting the data, one finds NP W ∼ 250, 000 plane wave, clearly too much for
practical use.
It is however possible to use a plane wave basis set in conjunction with
pseudopotentials: an effective potential that “mimics” the effects of the nucleus
and the core electrons on valence electrons. The true electronic valence orbitals
are replaced by “pseudo-orbitals” that do not have the orthogonality wiggles
typical of true orbitals. As a consequence, they are well described by a much
smaller number of plane waves.
Pseudopotentials have a long history, going back to the 30’s. Born as a
rough and approximate way to get decent band structures, they have evolved
into a sophisticated and exceedingly useful tool for accurate and predictive
calculations in condensed-matter physics.
74
Si has the same crystal structure as Diamond:
a face-centered cubic lattice with two atoms in
the unit cell. In the figure, the black and red
dots identify the two sublattices. The side of
the cube is the lattice parameter a0 . In the Di-
amond structure, the two sublattices have the
same composition; in the zincblende structure
(e.g. GaAs), they have different composition.
The origin of the coordinate system is arbitrary; typical choices are one of
the atoms, or the middle point between two neighboring atoms. We use the
latter choice because it yields inversion symmetry. The Si crystal can thus be
described 3 by three primitive vectors as in Eq.(9.9) with lattice parameter
a0 = 10.26 a.u., and two atoms in the unit cell at positions d1 = −d, d2 = +d,
where
1 1 1
d = a0 , , . (9.12)
8 8 8
The reciprocal lattice of the fcc lattice is a ”body-centered cubic” (bcc) lattice,
whose primitive vectors are
2π 2π 2π
b1 = (1, 1, −1) , b2 = (1, −1, 1) , b3 = (−1, 1, 1) (9.13)
a0 a0 a0
(again, the choice is not unique).
Let us re-examine the matrix elements between plane waves of a potential V ,
given by a sum of spherically symmetric potentials Vµ centered around atomic
positions: XX
V (r) = Vµ (|r − dµ − Rn |) (9.14)
n µ
75
The code requires on input the cutoff (in Ry) for the kinetic energy of plane
waves, and a list of vectors k in the Brillouin Zone. Traditionally these points
are chosen along high-symmetry lines, joining high-symmetry points shown in
figure and listed below:
Γ = (0, 0, 0),
2π
X = (1, 0, 0),
a0
2π 1
W = (1, , 0),
a0 2
2π 3 3
K = ( , , 0),
a0 4 4
2π 1 1 1
L = ( , , ),
a0 2 2 2
On output the code prints for each k-point the eight lowest eigenvalues,
corresponding to the four4 valence (occupied) bands and the four conduction
(empty) bands.
9.3.1 Laboratory
• Verify which cutoff is needed to achieve converged results for E(k).
• Understand and reproduce the results in the original paper for Si, Ge,
Sn. 5 You may either try to plot the band structure along a few high-
symmetry lines, or compare some selected energy differences.
• Try to figure out what the charge density would be by plotting the sum
of the four lowest wave functions squared at the Γ point. It is convenient
to plot along the (110) plane (that is: one axis along (1,1,0), the other
along (0,0,1) ).
• In the zincblende lattice, the two atoms are not identical. Cohen and
Bergstresser introduce a “symmetric” and an “antisymmetric” contribu-
tion, corresponding respectively to a cosine and a sine times the imaginary
unit in the structure factor:
What do you think is needed in order to extend the code to cover the case
of Zincblende lattices?
4
The Si atom, whose electronic configuration is 1s2 2s2 2p6 3s2 3p2 , has 10 core and 4 valence
electrons, thus crystal Si has 8 valence electrons per unit cell and 4 valence bands.
5
Remember that absolute values of E(k) have no physical meaning: the zero of the energy is
not defined for a crystal with PBC, since there is no reference level, no ”inside” and ”outside”.
In the paper, E = 0 is set at the top of the valence band.
76
Chapter 10
Exact diagonalization of
quantum spin models
Systems of interacting spins are used since many years to model magnetic phe-
nomena. Their usefulness extends well beyond the field of magnetism, since
many different physical phenomena can be mapped, exactly or approximately,
onto spin systems. Many models exists and many techniques can be used to
determine their properties under various conditions. In this chapter we will
deal with the exact solution (i.e. finding eigenvalues and eigenvectors) for the
Heisenberg model, i.e. a quantum spin model in which spins centered at lattice
sites interact via the exchange interaction. The hyper-simplified model we are
going to study is sufficient to give an idea of the kind of problems one encoun-
ters when trying to solve many-body systems without resorting to mean-field
approximations (i.e. reducing the many-body problem to that of a single spin
under an effective field generated by the other spins). Moreover it allows to
introduce two very important concepts in numerical analysis: iterative diago-
nalization and sparseness of a matrix.
77
observed behavior. The microscopic origin of the interaction was later found
in the antisymmetry of the wave functions and in the constraints it imposes on
the electronic structure (this is why it is known as exchange interaction).
One of the phenomenological models used to study magnetism is the Heisen-
berg model. This consists in a system of quantum spins Si , localized at lattice
sites i, described by a spin Hamiltonian:
X
H=− (Jx (ij)Sx (i)Sx (j) + Jy (ij)Sy (i)Sy (j) + Jz (ij)Sz (i)Sz (j)) (10.1)
<ij>
where N is the number of spins and the σµ (i) labels the two possible spin states
(σ = −1/2 or σ = +1/2) for the i−th spin. The Hilbert space has dimension
Nh = 2N (or Nh = (2S + 1)N for spin S), thus becoming quickly intractable for
N as small as a few tens (e.g. for N = 30, Nh ∼ 1 billion). It is however possible
to reduce the dimension of the Hilbert space by exploiting some symmetries of
the system, or by restricting to states of given total magnetization. For a
system of N spins, n up and N − n down, it can be easily demonstrated that
Nh = N !/n!/(N − n)!. For 30 spins, this reduces the dimension of the Hilbert
space to ”only” 155 millions at most. The solution “reduces” (so to speak) to
the diagonalization of the Nh × Nh Hamiltonian matrix Hµ,ν = hµ|H|νi, where
µ and ν run on all possible Nh states.
For a small number of spins, up to 12-13, the size of the problem may still
tractable with today’s computers. For a larger number of spin, one has to resort
to techniques exploiting the sparseness of the Hamiltonian matrix. The number
of nonzero matrix elements is in fact much smaller than the total number of
matrix elements. Let us re-write the spin Hamiltonian under the following form:
J X
H=− (S+ (i)S− (j) + S− (i)S+ (j) + 2Sz (i)Sz (j)) . (10.4)
2 <ij>
78
The only nonzero matrix elements for the two first terms are between states |µi
and |νi states such that σµ (k) = σν (k) for all k 6= i, j, while for k = i, j:
where
αj = hvj |H|vj i, βj+1 = (hwj+1 |wj+1 i)1/2 . (10.8)
The first condition in Eq.(10.8) enforces orthogonality of |wj+1 i to |vj i; the
second, to vector |vj−1 i. In fact, hvj−1 |wj+1 i = 0 implies
79
but from Eq.(10.7) we have that hvj−1 |H = hwj | + αj−1 hvj−1 | + βj−1 hvj−2 |,
demonstrating the equivalence of Eq.(10.9) with the definition of βj in Eq.(10.8).
A remarkable property of Lanczos chains is that each new vector of the chain
is automatically orthogonal to all previous vectors, not just to the previous
two. This can be demonstrated by induction. Let us consider hwj+1 |vi i =
(hvj |H − αj hvj | − βj hvj−1 |)|vi i for i < j − 1. If we assume that hvj |vi i = 0 for
all i < j, we have hwj+1 |vi i = hvj |H|vi i. Since however H|vi i has components
only on |vi+1 i, |vi i and |vi−1 i (see Eq.(10.7)), hvj |H|vi i = 0 for all i < j − 1.
In summary, vectors |vj i form an orthonormal set: hvi |vj i = δij . In the
basis of the |vj i vectors, the Hamiltonian has a tridiagonal form (see Eqs.(10.8)
and (10.9)), with αj elements on the diagonal, βj on the subdiagonal. After n
steps:
α1 β 2 0 . . . 0
β ..
2 α2 β3 0 .
Ht = 0 β3 α3 . .
. 0 . (10.10)
.
.. ..
.
. 0 . . β
n
0 ... 0 βn αn
If n = Nh , this transformation becomes exact: Ht = H, and constitutes an al-
ternative tridiagonalization algorithm. In practice, the Lanczos recursion tends
to be unstable and may lead to loss of orthogonality between states. If however
we limit to a few steps, we observe that the lowest eigenvalues, and especially
the lowest one, of matrix Ht converge very quickly to the corresponding ones
of H. Since the diagonalization of a tridiagonal matrix is a very quick and
easy operation, this procedure gives us a convenient numerical framework for
finding a few low-lying states of large matrices. If moreover it is possible to
exploit sparseness (or other properties of the matrix) to quickly calculate H|vi
products without storing the entire matrix, the advantage over conventional
diagonalization becomes immense.
In the code, energies are in units of |J|, spins are adimensional. If J > 0 a
ferromagnetic ground state, with all spins oriented along the same direction,
will be favored, while the J < 0 case will favor an antiferromagnetic ordering.
The sign of J is set in the code (to change it, edit the code and recompile).
For the totally magnetized (ferromagnetic) case, the solution is trivial: there
is just one state with all spins up (let us call it |F i), yielding E0 = hF |H|F i =
2
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/F90/heisenberg exact.f90
3
http://www.fisica.uniud.it/%7Egiannozz/Didattica/MQ/Software/C/heisenberg exact.c
80
−N J/4. Also the case with N − 1 spins up can be exactly solved. We have
N states with N − 1 spins up, that we label as |ni = S− (n)|F i. Exploiting
translational symmetry, one introduces Bloch-like states
N
1 X
|ki = √ eikn |ni, k = 2πm/N, m = 0, ..., N − 1. (10.12)
N n=1
It can then be shown that these are the eigenvectors of H with eigenvalues
E(k) = E0 + J(1 − cos k). Careful readers will recognize spin waves in this
solution.
In the antiferromagnetic case, the ground state has Sz = 0 for even Sz = 1/2
for odd number of spins. In the limit of infinite chains, the ground-state energy
is known: E0 = −N J(log 2 − 41 ), and the gap between E0 and the first excited
state E1 decreases as 1/N . A general exact solution (for other similar spin
problems as well) can be found by means of the Bethe Ansatz, a highly nontrivial
technique.
The code requires the number N of spins and the number nup of up spins,
computes the dimension nhil of the Hilbert space. It then proceeds to the
labelling of the states, using a trick often employed for spin-1/2 systems: an
integer index k, running from 1 to 2N −1, contains in its i−th bit the information
(0=down, 1=up) for the i−th spin. Of course this works only up to 32 spins,
for default integers (or 64 spins for INTEGER(8)). The integer k is stored into
array states for the states in the required Hilbert space.
The Hamiltonian matrix is then filled (the code does not takes advantage of
sparseness) and the number of nonzero matrix elements counted. For the S+ S−
and S− S+ terms in the Hamiltonian, only matrix elements as in 10.5 and 10.6,
respectively, are calculated. We remark that the line
k = states(ii)+2**(j-1)-2**(i-1)
is a quick-and-dirty way to calculate the index for the state obtained by flipping
down spin i and flipping up spin j in state states(ii).4
We then proceed to the generation of the Lanczos chain. The number nl of
chain steps (should not exceed nhil) is prompted for and read from terminal.
The starting vector is filled with random numbers. Note the new BLAS routines
dnrm2 and dgemv: the former calculates the module of a vector, the latter a
matrix-vector product and is used to calculate H|vi.
The Hamiltonian in tridiagonal form (contained in the two arrays d and e)
is then diagonalized by the LAPACK routine dsterf, that actually finds only
the eigenvalues. The lowest eigenvalues is then printed for increasing values of
the dimension of the tridiagonal matrix, up to nl, so that the convergence of
the Lanczos chain can be estimated. You can modify the code to print more
eigenvalues.
As a final check, the matrix is diagonalized using the conventional algorithm
(routine dspev). Note how much slower this final step is than the rest of the
4
A more elegant but hardly more transparent way would be to directly manipulate the
corresponding bits.
81
calculation! Once you are confident that the Lanczos chain works, you can
speed up the calculations by commenting out the exact diagonalization step.
The limiting factor will become the size of the Hamiltonian matrix.
• For the antiferromagnetic case, verify that the ground state has zero mag-
netization (for even N ) or magnetization 1/2 (for odd N ). Plot the
ground-state energy E0 and the first excited state E1 (where can you
find it? why?) as a function of N , try to verify if the gap E1 − E0 has
a 1/N dependence. Note that all energies are at least doubly degener-
ate for odd N , as a consequence of time-reversal symmetry and Kramer’s
theorem.
• For the ferromagnetic case, verify that the ground state has all spins
aligned. Note that the ground state will have the same energy no mat-
ter which total magnetization you choose! This is a consequence of the
rotational invariance of the Heisenberg Hamiltonian. Verify that the case
with N − 1 spins up corresponds to the spin-wave solution, Eq.(10.12).
You will need to print all eigenvalues.
• Modify the code in such a way that open boundary conditions (that is: the
system is a finite chain) are used instead of periodic boundary conditions.
You may find the following data useful to verify your results: E/N =
−0.375 for N = 2, E/N = −1/3 for N = 3, E/N = −0.404 per N = 4,
E/N → −0.44325 per N → ∞
• Modify the code in such a way that the entire Hamiltonian matrix is no
longer stored. There are two possible ways to do this:
– Calculate the Hψ product “on the fly”, without ever storing the
matrix;
– Store only nonzero matrix elements, plus an index keeping track of
their position.
Of course, you cannot any longer use dspev to diagonalize the Hamil-
tonian. Note that diagonalization packages for sparse matrices, such as
ARPACK, exist.
82
Chapter 11
Density-Functional Theory
where F [ρ] = hΨ|T + U |Ψi is a universal functional, i.e. independent upon the
external potential V , and we have assumed that the potential V acts locally on
the electrons: V ≡ i v(ri ).
P
1
Note that the original DFT applies to spinless fermions
83
A further consequence is that the energy functional E[ρ] is minimized by
the ground-state charge density. This suggests a very interesting algorithm
to find the ground state: finding a three-dimensional function that minimizes
the energy functional is a much easier task than finding the 3N −dimensional
wave function that minimizes the same quantity. Unfortunately it is not easy
to minimize an unknown functional, since all we know at this stage is that it
exists.2
h̄2 X
Z
Ts = − ψi∗ (r)∇2 ψi (r)d3 r, (11.5)
2m i
qe2 ρ(r)ρ(r0 ) 3 3 0
Z
EH [ρ] = d rd r , (11.6)
2 |r − r0 |
the third term is the interaction energy with the external potential, and all the
rest is hidden into the Exc term. The latter is known as exchange-correlation
energy, for historical reasons coming from Hartree-Fock terminology: in prin-
ciple, Exc contains both the exchange energy of the Hartree-Fock method, and
the correlation energy that is missing in it.
By imposing the condition that the KS orbitals ψi minimize the energy, we
find the Kohn-Sham equations to which KS orbitals obey:
!
h̄2 ∇2
− + VKS (r) ψi (r) = i ψi (r), (11.7)
2m
2
We actually know a lot more than this about the properties of the exact functional F [ρ],
but there is no way to write it down explicitly and in a simple form
84
where the effective, or Kohn-Sham potential, VKS = v(r) + VH (r) + Vxc (r), is a
functional of the charge density:
3qe2
Vx (r) ' − (3π 2 ρ(r))(1/3) . (11.10)
2π
Kohn and Sham extend and improve upon such ideas by introducing the local
density approximation (LDA): they re-write the the energy functional as
Z
Exc = ρ(r)exc (r)d3 r, (11.11)
using for the exchange-correlation energy density exc (r) the result for the ho-
mogeneous electron gas of density n, xc (n), computed in each point at the local
charge density: exc (r) ≡ xc (ρ(r)). The function xc (n) can be computed with
high accuracy and fitted a some simple analytical form, as e.g. in the following
parameterization (Perdew-Zunger) of the Monte-Carlo results by Ceperley and
Alder. In Ry atomic units:
dxc (n)
Vxc (r) = xc (n) + ρ . (11.13)
dn n=ρ(r)
85
In spite of its simplicity, and of its derivation from an electron gas model that
wouldn’t look suitable to describe real, highly inhomogeneous materials, LDA
gives surprising good results for several properties (e.g. bond lengths, crystal
structures, vibrational frequencies) of a large class of materials (e.g. sp bonded
semiconductors). It also gives (unsurprisingly) bad results for other properties
(e.g. band gap) and for other cases (e.g. transition metals). A number of
functionals have been proposed with various degrees of sophistication, extending
DFT to a much larger class of properties and of materials. The search for better
functionals is currently a very active field of research.
The loop is started with some suitable initial choice of the charge density, is
(n)
iterated until self-consistency is achieved, i.e. ρout = ρ(n) according to some
pre-defined criterion (see Ch.6 for an introduction to self-consistency). At the
end of the loop, the DFT energy can be computed, using either Eq.(11.4) or
Eq.(11.9). The total energy will be given by the sum of the DFT energy and of
the nuclear repulsion energy.
Let us focus on a periodic system with a plane-wave basis set. We consider
a simple but nontrivial case: Si crystal using Appelbaum-Hamann (Phys. Rev.
B 8, 1777 (1973)) pseudopotentials. We use the definitions of lattice, recipro-
cal lattice, Bloch vector, plane-wave basis set as in code cohenbergstresser,
introduced in Ch. 9, as well as conventional (LAPACK) diagonalization and
the “simple mixing” algorithm of Sec.6.2:
(n)
ρ(n+1) = βρout + (1 − β)ρ(n) , 0 < β ≤ 1. (11.14)
86
1. matrix elements of the pseudopotential;
ρat (r0 ) 3 0
3/2
α
Z
2
vlr (r) = −qe2 d r, ρat (r) = Zv e−αr . (11.15)
|r − r0 | π
Note that both ρat and vlr are spherically symmetric, and so are their Fourier
transforms. You may want to verify that ρat integrates to Zv = 4 electrons.
Appelbaum-Hamann pseudopotentials describe in fact a Si4+ (pseudo-)ion, in-
teracting with the four valence electrons of Si.
The short-ranged potential has the form
2
vsr (r) = e−αr (v1 + v2 r2 ). (11.16)
87
and for the short-range term:
3/2 !!
π v2 3 G2 2 /4α
ṽsr (G) = qe2 v1 + − e−G . (11.22)
α α 2 4α
The careful reader will notice that the G = 0 term diverges as −4πZv qe2 /G2 .
This is due to the presence of the long-range Coulomb term. The divergence,
however, cancels out, at least in neutral systems, with the divergence of opposite
sign coming from the Hartree potential of electrons. The G = 0 term can be
evaluated in practice 7 by taking the G → 0 limit and throwing away the
divergent term −4πZv qe2 /G2 .
88
Routine fft3d implements Eq.(11.28) or Eq.(11.26) (with the factor 1/n1 n2 n3 )
if the first argument (the sign of the exponential) has value +1 or -1, respec-
tively. Note that Eq.(11.26) is also called “forward” FT, Eq.(11.28) “backward”
FT. Note that as in Sec.8.1.5, both the real- and the reciprocal-space grids are
periodic, so G−vectors with negative indices hkl appear “at the other end of
the box”. Also note that the “inverse” transform is really the inverse: if you
apply a FT to a function and then the inverse FT, or vice versa, you get exactly
the starting function.
Why is FFT important? because it allows to quickly jump between real to
reciprocal space, performing the required operations in the space where it is
more convenient. Such “dual-space” technique is fundamental in modern DFT
codes based on plane waves to achieve high performances in terms of speed.
89
11.4.4 Computing the potential
The self-consistent potential appearing in the Kohn-Sham equations, Eq.(11.8),
consists of two terms, the Hartree and the exchange-correlation term. Pseu-
dopotentials are build to work in conjunction with a specific kind of exchange-
correlation functional. Appelbaum-Hamann pseudopotentials work together
with ”Slater exchange”, Eq.(11.10), one of the simplest and less accurate func-
tionals.
The self-consistent potential is computed in subroutine v of rho.
do n3=1,nr3
do n2=1,nr2
do n1=1,nr1
vr(n1,n2,n3) = - alphax * 3.0_dp / 2.0_dp * e2 * &
( 3.0_dp*rho(n1,n2,n3)/pi )**(1.0_dp/3.0_dp)
end do
end do
end do
ρ(G)
VH (G) = 4πqe2 . (11.32)
G2
This is nothing but the solution of the Poisson equation in Fourier space. The
diverging G = 0 term is compensated (in neutral systems) by the same term
coming from pseudopotentials. The lines
do ng =1, ngm
if ( g2(ng) > eps ) vg(ng) = vg(ng) + fpi*e2*rhog(ng)/g2(ng)
end do
add, for G 6= 0, to vg the Hartree potential directly computed from rhog (charge
in reciprocal space) and g2, square modulus of G.
11.4.5 Laboratory
In order to compile the ah code, you will need routines from the BLAS, LA-
PACK and FFTW3 libraries. You may follow the same procedure as for com-
pilation of code testfft code, Ch.8.
90
• Verify which cutoff is needed to achieve converged results for E(k).
• Compute the band structure. To this end you will need compute and store
the final self-consistent potential, then to perform a non-self-consistent
calculation with the previously computed self-consistent potential, on a
suitably chosen set of k-points.
• Examine how the band structure, and especially the band gap, changes
by changing alphax from 2/3 to 1.
• Plot the charge density along the (111) direction, along the bond between
two atoms, and on the (110) plane.
91
Appendix A
h̄2 h̄2
Hi,i = + Vi , Hi,i+1 = Hi+1,i = − . (A.5)
m(∆x)2 2m(∆x)2
The resemblance with the secular equation as obtained from the variational
principle, Ch.4, is quite obvious, and can be made more explicit by introducing
92
a set of “basis functions” bi (x) so defined:
1 ∆x ∆x
bi (x) = √ xi − < x < xi + (A.6)
∆x 2 2
∆x ∆x
bi (x) = 0 x < xi − , x > xi + . (A.7)
2 2
It is straightforward to verify that these functions are orthonormal. The Hij
elements are the “matrix elements” of the Hamiltonian. The potential is rep-
resented by its value in the grid point: Vii = hbi |V |bi i ' V (xi ) and is thus
diagonal in this basis. The kinetic energy is less obvious: our basis functions
are not differentiable, but the matrix elements for the kinetic energy:
h̄2 d2
Z
Tij = hbi |T |bj i = − bi (x) bj (x)dx (A.8)
2m dx2
can be specified via the discretized form of the second derivative, as in Eq.(A.1).
The solution of the Schrödinger equation via the secular equation has no real
advantage with respect to the numerical integration procedure of Ch.1–3 in one
dimension, but it can be generalized to more dimensions in a straightforward
way: for instance, we can introduce a uniform grid in the following way:
93
Appendix B
Solution of time-dependent
Schrödinger equations
When the potential does not contain any explicit dependence upon time, the
solution of time-dependent Schrödinger equation:
∂ψ(x, t) h̄2 ∂ 2
ih̄ = Hψ(x, t), H=− + V (x) (B.1)
∂t 2m ∂x2
for the one-dimensional case can be obtained via variable separation and written
down in terms of eigenvectors and eigenvalues of the time-independent Schrö-
dinger equation, Hψn (x) = En ψn (x), as
Z
cn e−iEn t/h̄ ψn (x), ψ(x, 0)ψn∗ (x)dx.
X
ψ(x, t) = cn = (B.2)
n
94
B.1 Discretization in time: Crank-Nicolson algorithm
Let us consider for simplicity the one-dimensional case. We use the same dis-
cretization on a uniform grid as in Appendix A. The right-hand side of the
Schrödinger equation:
i∆t
ψ(t + ∆t) = ψ(t) − Hψ(t + ∆t). (B.9)
h̄
This algorithm is called implicit because the wave function at the next time
step cannot be simply obtained from the wave function at the previous one
(note that the former appear in both sides of the equation). The discretized
equations can however be recast into the form of a linear system:
i∆t
Aψ(t + ∆t) ≡ 1 + H ψ(t + ∆t) = ψ(t). (B.10)
h̄
Since the matrix A is tridiagonal, its solution can be found very quickly, in
order O(N ) operations. The implicit Euler algorithm can be demonstrated to
be numerically stable, but it still suffers from a major drawback: it breaks, with
an error proportional to the time step, the unitariety of the time evolution.
95
The better Crank-Nicolson algorithm is obtained by combining explicit and
implicit Euler discretization:
i∆t i∆t
1+ H ψ(t + ∆t) = 1 − H ψ(t). (B.11)
2h̄ 2h̄
Notice the factor 2 dividing the time step: you can obtain the above formula
by performing an explicit step, followed by an implicit one, both with time step
∆t/2. This often used algorithm conserves unitariety of the time evolution up
to order O((∆t)2 )) and is numerically stable.
For finite n, the error is O (∆t)2 , where ∆t = t/n. The discretization of the
In real space and in one dimension, the kinetic term is represented by a tridi-
agonal matrix like the one in Eq.(A.4) (without the potential contribution in
96
the diagonal). The exponential of such an operator is far from simple. One
can however take advantage of the Fast Fourier-Transform (FFT) algorithm
to switch back and forth between real and Fourier (or “reciprocal”) space. In
reciprocal space, the kinetic energy is diagonal and the calculation of U (t) is as
simple as for the potential term in real space:
2
UT (∆t)ψej (t) = e−ih̄qj ∆t/2m ψej (t) (B.17)
97
Appendix C
The Van der Waals attractive interaction can be described in semiclassical terms
as a dipole-induced dipole interaction, where the dipole is produced by a charge
fluctuation. A more quantitative and satisfying description requires a quantum-
mechanical approach. Let us consider the simplest case: two nuclei, located
in RA and RB , and two electrons described by coordinates r1 and r2 . The
Hamiltonian for the system can be written as
1 1 R · x 3(R · x)2 − x2 R2
' − + . (C.3)
|x + R| R R3 R5
Using such expansion, it can be shown that the lowest nonzero term is
2qe2 (R · x1 )(R · x2 )
∆H ' 3
x1 · x 2 − 3 . (C.4)
R R2
98
The problem can now be solved using perturbation theory. The unperturbed
ground-state wave function can be written as a product of 1s states centered
around each nucleus: Φ0 (x1 , x2 ) = ψ1s (x1 )ψ1s (x2 ) (it should actually be anti-
symmetrized but in the limit of large separation it makes no difference). It is
straightforward to show that the first-order correction, ∆(1) E = hΦ0 |∆H|Φ0 i,
to the energy, vanishes because the ground state is even with respect to both x1
and x2 . The first nonzero contribution to the energy comes thus from second-
order perturbation theory:
X |hΦi |∆H|Φ0 i|2
∆(2) E = − (C.5)
i>0
Ei − E0
where Φi are excited states and Ei the corresponding energies for the unper-
turbed system. Since ∆H ∝ R−3 , it follows that ∆(2) E = −C6 /R6 , the well-
known behavior of the Van der Waals interaction.1 The value of the so-called
C6 coefficient can be shown, by inspection of Eq.(C.5), to be related to the
product of the polarizabilities of the two atoms.
1
Note however that at very large distances a correct electrodynamical treatment yields a
different behavior: ∆E ∝ −1/R7 . In practice such asymptotic behavior becomes dominant
when in is too small to be of any relevance.
99
Appendix D
100
since Z = 2. The electron repulsion will necessarily raise this energy, i.e. make
it less negative. In first-order perturbation theory,
E − E0 = hψ0 |V |ψ0 i (D.7)
Z6 2 −2Z(r1 +r2 ) 3 3
Z
= 2
e d r1 d r2 (D.8)
π r12
5
= ZRy. (D.9)
4
For Z = 2 the correction is equal to 2.5 Ry and yields E = −8 + 2.5 = −5.5 Ry.
The experimental value is −5.8074 Ry. The perturbative approximation is not
accurate but provides a reasonable estimate of the correction, even if the “per-
turbation”, i.e. the Coulomb repulsion between electrons, is of the same order
of magnitude of all other interactions. Moreover, he ground state assumed in
perturbation theory is usually qualitatively correct: the exact wave function for
He will be close to a product of two 1s functions.
The contribution to the energy due to the first square bracket in Eq.(D.11) is
−2Ze2 a.u.: this is in fact a Hydrogen-like problem for a nucleus with charge Ze ,
for two non-interacting electrons. By expanding the remaining integrals and
using symmetry we find
4(Z − Ze ) 3 3 2 3 3
Z Z
E(Ze ) = −2Ze2 − |ψ|2 d r1 d r2 + |ψ|2 d r1 d r2 (D.13)
r1 r12
(in a.u.) with
Ze6 −2Ze (r1 +r2 )
|ψ|2 = e (D.14)
π2
101
Integrals can be easily calculated and the result is
5 27
E(Ze ) = −2Ze2 − 4(Z − Ze )Ze + 2 Ze = 2Ze2 − Ze (D.15)
8 4
where we explicitly set Z = 2. Minimization of E(Ze ) with respect to Ze
immediately leads to
27
Ze = = 1.6875 (D.16)
16
and the corresponding energy is
729
E=− = −5.695 Ry (D.17)
128
This result is definitely better that the perturbative result E = −5.50 Ry,
even if there is still a non-negligible distance with the experimental result
E = −5.8074 Ry.
It is possible to improve the variational result by extending the set of trial
wave functions. Sec.(6.1) shows how to produce the best single-electron func-
tions using the Hartree-Fock method. Even better results can be obtained
using trial wave functions that are more complex than a simple product of
single-electron functions. For instance, let us consider trial wave functions like
where the two single-electron functions, f and g, are Hydrogen-like wave func-
tion as in Eq.(D.4) with different values of Z, that we label Zf and Zg . By
minimizing with respect to the two parameters Zf and Zg , one finds Zf = 2.183,
Zg = 1.188, and an energy E = −5.751 Ry, much closer to the experimental
result than for a single effective Z. Note that the two functions are far from
being similar!
102
If the bi functions are S-like gaussians as in Eq.(5.24), we have:
1
Bk (r1 , r2 ) = √ bi(k) (r1 )bj(k) (r2 ) + bi(k) (r2 )bj(k) (r1 ) (D.20)
2
where k is an index running over n(n+1)/2 pairs i(k), j(k) of gaussian functions.
The overlap matrix Sekk0 may be written in terms of the Sij overlap matrices,
Eq.(5.27), of the hydrogen-like case:
Sekk0 = hBk |Bk0 i = Sii0 Sjj 0 + Sij 0 Sji0 . (D.21)
can be written using matrix elements Hij = HijK + HijV , obtained for the
hydrogen-like case with Z = 2, Eq.(5.28) and (5.29):
e 0 = H 0 S 0 + H 0 S 0 + S 0 H 0 + H 0 S 0 + hBk |Vee |B 0 i,
H (D.23)
kk ii jj ij ji ii jj ij ji k
qe2
Z
hBk |Vee |Bk0 i = bi(k) (r1 )bj(k) (r2 )b 0 (r1 )bj(k0 ) (r2 )d3 r1 d3 r2 (D.24)
r12 i(k )
q2
Z
+ bi(k) (r1 )bj(k) (r2 ) e bj(k0 ) (r1 )bi(k0 ) (r2 )d3 r1 d3 r2 .
r12
These matrix elements can be written, using Eq.(7.25), as
where
103
where P (r1 , r2 )dr1 dr2 is the joint probability to find an electron between r1 and
r1 + dr1 , and an electron between r2 and r2 + dr2 . The probability to find an
electron between r and r + dr is given by p(r)dr, with
Z Z
p(r) = 4πr2 |ψ(r, r2 )|2 4πr22 dr2 = P (r, r2 )dr2 . (D.29)
D.4 Laboratory
• observe the effect of the number of basis functions, to the choice of coef-
ficients λ of the gaussians, to the inclusion of P-type gaussians
• compare the obtained energy with the one obtained by other methods:
perturbation theory with hydrogen-like wave functions, (Sec.D.1), varia-
tional theory with effective Z (Sec.D.2), exact result (-5.8074 Ry).
set view 0, 90
unset surface
set contour
set cntrparam levels auto 10
splot [0:4][0:4] "gs-wfc.out" u 1:2:3 w l
104
Appendix E
where the bn,k are plane waves and the φc are atomic core states1 . By construc-
tion, hφc |b̃i,k i = 0. The solution of the Schrödinger equation for the crystal
potential can be obtained by expanding the valence wavefunctions into OPWs:
X
ψ= cj b̃j,k (r) (E.2)
j
One obtains a generalized secular equation (OPWs are not orthonormal) whose
solution yields the valence wavefunctions, while core states retain their atomic-
like character. Alternatively, one writes the Schrödinger equation (H −)ψ = 0,
projects it over plane waves:
obtaining
!
X X
cj hbi,k |(H − ) |bj,k (r)i − |φc ihφc |bj,k i = 0. (E.4)
j c
Under the assumption that the crystal potential is well approximated by a sum
of atomic-like potentials, and that atomic core states φc retain their atomic-like
character, we may write Hφc ' c φc , where c is the eigenvalue corresponding
to φc in the atom. We may thus rewrite Eq.(E.4) as
!
X X
cj hbi,k | H − + |φc i( − c )hφc | |bj,k i = 0. (E.5)
j c
1
more exactly: Bloch sums of atomic core states
105
Eq.(E.5) is a secular equation for the plane-wave part only, for the effective
potential X
Ṽ = V + |φc i( − c )hφc |. (E.6)
c
do not have the correct normalization, due to the lack of orthogonalization with
the core states.
where ψ̃ is the all-electron wavefunction. The above result can be recast into
the form X
|ψ̃i = |ψi + cl |φ̃l i − |φl i . (E.11)
It remains to define the cl coefficients. Let us introduce the projectors βl
with the following properties:
X
hβl |φm i = δlm , |φl ihβl | = I. (E.12)
l
106
It is easy to verify that cl = hβl |ψi and that we can write
X
|ψ̃i = |ψi + hβl |ψi |φ̃l i − |φl i (E.13)
l
" #
X
= I+ |φ̃l i − |φl i hβl | |ψi. (E.14)
l
The quantity between square brackets is our 1 + T operator. This replaces the
pseudo-states φ from the pseudo-wavefunctions around the atoms and replaces
them with the all-electron states φ̃. The 1 + T operator is a purely atomic
quantity that is obtained from a judicious choice of the φ̃l all-electron atomic
states, the corresponding pseudo-states φl , and the projectors βl .
The equations to solve in the PAW method are then obtained by inserting
the above form for ψ̃ in the energy functional and by finding its minimum
with respect to the variation of the smooth part only, ψ. Rather cumbersome
expressions results. An important feature of the resulting equations is that the
charge density is no longer given simply by the square of the orbitals, but it
contains in general an additional (augmentation) term:
X XX
n(r) = |ψi (r)|2 + hψi |βl iqlm (r)hβm |ψi i (E.15)
i i lm
where
qlm (r) = φ̃l (r)φ̃m (r) − φl (r)φm (r) (E.16)
(using the completeness relation, Eq.(E.12)). Conversely the pseudo-wavefunctions
are no longer orthonormal, but obey instead a generalized orthonormality rela-
tion:
X Z
hψi |S|ψj i = δij , S=I+ |βl iQlm hβm | Qlm = qlm (r)dr, (E.17)
lm
107