Reading and references:
For each of the following exercises create the specified files with your answer(s). Submit your homework using the course submit utility as usual.
Although the matrix whose eigenvalues we seek is infinite, let's keep at most only the first 14 rows and columns. The number n of rows and columns actually used and the value of the parameter epsilon (see the notes) are to be read in at execution time. You are to find the eigenvalues of the n x n matrix
anh
h = (i + 1/2) \delta + \epsilon g
ij ij ij
for i,j = 0,1,2...,n-1. The \delta_{ij} is the
Kronecker delta and the \epsilon is the epsilon parameter.
The 14 x 14 version of the matrix gij is given explicitly in the file ~p6720/examples/anharm/g14. A key question: Is it a symmetric matrix? The rows and columns correspond to i,j ranging from 0 to 13. If you want just the values on the non-zero bands, see the file ~p6720/examples/anharm/g14band. If you prefer, you may instead set up the problem so that the matrix elements are computed by your program, using the formulas given in the notes. (Be sure to find the eigenvalues of h and not just g!).
Here is how your program should perform, so it can be tested by our automatic system:
These are the files to be submitted: anharm.cc, Makefile and (optional) data. The Makefile should have all the proper references to the library routines. (Submit the data file if your code requires it.)
We will test your program with the command
anharm < testinput
where our test input file contains a single set of values,
epsilon and n.
For notes on calling LAPACK routines, please
see the links at the top of this page. Some LAPACK routines
call for a single character argument, such as JOBZ = 'N' or 'V'
and the C/C++ prototype specifies dzzzz(char jobz, ...). In that
case just pass a character constant with single quotes like this:
dzzzz('N', ...)
Do the diagonalization (find the eigenvalues) for n = 8, 10, 12, and 14 and epsilon = 0.15 and see how the lowest three eigenvalues are converging.
In a file called anharm.txt list the resulting eigenvalues, and compare the change in each in going from 12 to 14. Which eigenvalues change the most? This change suggests to what extent the answer has converged. Discuss.
If you want to try my compiled code, it is in ~p6720/examples/anharm/anharm.