It is instructive to look at a simple, but relevant example for
testing the statements of the preceding section. Here, we study the
performance of the conjugate-gradient algorithm applied to a diamond
crystal. Since there are two atoms in the unit cell with four valence
electrons each, one needs to compute m=4 wave functions (spin
degeneracy) at each
-point in the Brillouin zone. We just
consider the center of the Brillouin zone (
), and also restrict
our study to the non-selfconsistent functional
(6). This way, we are essentially computing the smallest
eigenpairs of the Hamiltonian matrix H, which has a size of
N=609. This is much smaller than typical problem sizes studied
today, but it allows to use MATLAB and an explicit representation of
H for numerical experiments.
We first perform a direct diagonalization of the full matrix to get the spectrum shown in the inset of figure 1.
Figure 1: The rate of convergence as a function of the
shift parameter
for a conjugate
gradient algorithm performed on an energy functional with implicit
orthogonality constraints. The inset shows the spectrum of the matrix
H which appears in the energy functional.
The smallest
four (occupied) eigenvalues are grouped into a low-lying single
eigenvalue and a triplet. They are well separated from the higher,
unoccupied eigenvalues. This gap is critical for achieving fast convergence.
Using
Eq. (9) we should get optimal performance for
. The starting guess for the conjugate gradient procedure
is generated by diagonalizing a 27 by 27 submatrix from the upper left
corner of H, and selecting the smallest four eigenpairs. The other
(609-27) components of the start vectors are filled up with
0.001*rand() to ensure that the full spectrum is represented in the
starting guess.
When sweeping the shift
through, we measure a rate of
convergence as shown in figure 1. If the shift approaches
, the rate of convergence deteriorates
dramatically because the condition number increases. In the case
without preconditioning (solid line), indeed the performance is almost
constant within the range given by Eq. (9) (indicated by
vertical dot-dashed lines).
With preconditioning (dashed line), the rate of convergence is
substantially larger, but only for a good choice of
. Since the
large eigenvalues of H are now effectively reduced,
must be chosen smaller accordingly. From this numerical experiment it
appears that there might not even be an optimal choice of
in
this case, in other words there is no shift for which the
orthonormality modes do not degrade the performance.