Introduction
The standard method for solving for the vector x is Gaussian elimination. A
particularly useful formulation in terms of numerical treatment is called LU
decomposition. Here the matrix A is written as the product of a lower triangular
matrix L and an upper triangular matrix U, A = L . U. Note that the vector b does not
enter here. This means that once the decomposition has been performed, it can be
applied to solve A . x = b for any value of b. The determinant of A is simply given by
the product of the diagonal elements of L. For a detailed discussion of both Gaussian
Elimination and LU decomposition see DeVries pp 119-131 and your lecture notes
from course 342, Numerical Methods. The function lu_solver.c (Appendix A) takes
as input the matrix A and the vector b (and specification of the array sizes). It returns
the solution x and the determinant. In the course of the decomposition A is
overwritten by L and U (note that the rows become interchanged).
Exercise 1 Solution of Linear Equations by LU Decomposition
Write a programme that solves the equation A . x = b for
3 1 1 2
A 3 2 1 b 3 (1)
1 1 1 1
using LU decomposition and solve the problem yourself on paper. Compare results of
each method of solution. The main() function (here called lin_eq.c) contains the value
of the matrix elements and the vector b. It should call the external function
lu_solver.c. Thus use as header:
#include "lu_solver.h"
#include <math.h>
extern void lu_solve(double a[][],double x[],double b[], double det, int ndim, int n);
1
H ij
i j -1
(2)
1 1/ 2 1/ 3
H 1 / 2 1/ 3 1/ 4 (3)
1 / 3 1/ 4 1 / 5
The Hilbert matrix has the property that its determinant decreases rapidly with
increasing matrix dimension. Using your LU decomposition program, solve the
equation H . x = b with bi = i, e.g. for the 3x3 matrix b = (1,2,3) and compute the
determinant of H. The numerical accuracy of your program may be checked by
setting
n
bi H
j 1
ij (4)
Eigenvalue problems
where A is a matrix of constants and xn and n are the nth eigenvector and eigenvalue
solutions of the problem. In all, if A is an NXN matrix, there are N eigenvectors and
eigenvalues. The problem may be solved by computing the following determinant
det A - I 0
(6)
where I is the unit matrix of the same dimension as A. Evaluation of this determinant
for an NxN matrix A results in an Nth order polynomial in . This is called the
characteristic equation or secular equation for the matrix A. Its N roots give the
eigenvalues of A, n. Obviously this is challenging for n > 2, so one generally adopts
a numerical solution for larger matrices. A square matrix A can be diagonalised by a
unitary transformation (see lecture notes from course Numerical Simulations of
Physical Systems MA 342 or Linear Algebra and its Applications, G. Strang S-LEN
512.5 L6*2).
The transformation matrix S turns A into a diagonal matrix A'. Once the
transformation matrix S has been found, the eigenvectors of A are contained in the
columns of the transformation matrix on the right in Eq. 7 and in the rows of its
inverse in Eq. 7, S-1. The eigenvalues A are the diagonal elements of A' and the
eigenvalue in the nth diagonal element corresponds to the eigenvector in the nth
column of S. Numerical diagonalisation is achieved by bringing the matrix A
gradually towards diagonal form using a sequence of similarity transformations. For
symmetric matrices a sequence of orthogonal similarity transformations is used. One
such procedure is called Jacobi transformation. The routine jacobi_trans.c performs
just such a transformation. Its input is the matrix A, the outputs are the eigenvalues in
array e[i] and the eigenvectors in matrix v[i][j]. Note that typedef statements have
been used for declaration of scalars, matrices and vectors. (For further details, see
your course JS 3065 Computational Methods).
Write a programme which calls jacobi and solves the eigenvalue problem for
2 1 2
A 1 2 2
2 2 5
Calculate the eigenvalues and eigenvectors of this matrix by hand and compare your
numerical results with your analytical result.
1 2
ψ k (x) V(x)ψ k (x) ε k ψ k (x)
2
(8)
ψ k (x) is the eigenfunction for wavenumber k, ε k are the allowed energies and V(x)
is a periodic potential energy. A plot of ε k versus k is called the band structure.
Since the potential energy operator and the eigenfunctions both contain periodic
functions they can be expanded in Fourier series. We will use the complex form of
Fourier series to expand the periodic function f(x) = f(x+na) (a = period, n is 0, 1,
2, ..)
f(x) cn exp[i 2x/a]
n
(9)
In the nearly free electron problem we choose to limit the expansion for the potential
and wavefunction such that only coefficients with –2 n 2 are nonzero. Solutions
to the Schrödinger equation using such a limited expansion for the wave function are
quite accurate provided the magnitudes of the potential energy Fourier components in
the problem are much less than the kinetic energies of the electrons. The expansions
for the potential energy and wave functions are
2
V(x) vn exp[i 2x/a] v0 2v1 cos(2x/a) 2v2 cos(x/a)
n 2
(10a)
2 i 2x
k (x) c n exp[
a
ikx] (10b)
n 2
The right hand equality in Eq. 10a is valid provided v1 = v-1 and v2 = v-2. We also
choose v0 = 0. The factor exp[ikx] multiplying each term in Eq. 10b is necessary to
make k a Bloch eigenfunction. (See lecture notes from course JS 3014 Thermal and
Electronic Properties). When the potential and eigenfunction are substituted into Eq.
8, the resulting set of linear equations is
1 2
(k G 2 ) ε k v1 v2 0 0
2
v-1
1 2
(k G 1 ) ε k v1 v2 0 c 2
2 c
1 2 -1
v-2 v-1 k εk v1 v2 c0 0
2 c
1 2 1
0 v- 2 v-1 (k G1) ε k v1
2 c 2
1
0 0 v-2 v-1 (k G 2 )2 ε k
2
Inspection of the matrix equation above shows that its diagonal elements depend on
wave number k. An energy band calculation using these equations consists of
repeated construction of the matrix and computation of its eigenvalues. The notation
Gn in the equations above means 2n/a. In 1-D the reciprocal lattice consists of points
given by k = Gn with n integer. The equations are given in atomic units in which h bar
= e = me = 1. It will be helpful if you choose units for wavenumbers to be in units of
/a so that k = ±1 correspond to the Brillouin zone boundaries for the problem and G n
=2n.
Exercise 4
Write a programme which contains a function which constructs the 5x5 matrix above
as a function of k. The programme should also call the diagonalisation routine to
obtain the eigenvalues of the matrix.
Use your programme to obtain the bandstructure of a solid where all of the Fourier
components of the potential are weak (v-2 = v-1 = v1 = v2 = 0.1) and for a solid
where some of the Fourier components of the potential are strong (v -2 = 0.3 v-1 = 0.7
v1 = v2 = 0.1). Compare the band gaps calculated in your programme at the
Brillouin zone centre and at its edges with the result from perturbation theory that the
nth band gap is twice the nth Fourier component of the periodic potential, e.g. the first
gap at k = 1 (in units of /a) is equal to 2 v1.