This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
numexercises7_14 [2014/07/14 12:29] bogner |
numexercises7_14 [2014/07/14 12:57] bogner |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Numerical Exercises for Monday July 14 ===== | ===== Numerical Exercises for Monday July 14 ===== | ||
- | * Install Git, and try out some of the commands covered in Morten or Nicolas's lecture slides ({{:computing.pdf|}} {{:talentdftguides.pdf|}}) for your codes in the following problems. | ||
- | |||
- | * In your favorite programming language, make a program to construct a real symmetric $NxN$ matrix. Diagonalize it using the appropriate LAPACK or GSL routine, and write out some number of the lowest eigenvalues. (Suggestion: You might find it useful to use Mathematica (available on the ECT* computers) to diagonalize a small matrix that you can benchmark against.) This will help you test that you've linked to the GSL or LAPACK library. | ||
- | * The code {{:laguerre_general.f90.zip|}} calculates the generalized Laguerre polynomials that appear in the definition of the HO wf's, see {{:ho_spherical.pdf| here}}. Use this subroutine to create a function or subroutine that calculates the HO wf's $R_{nl}(r)$. | + | * In the code {{:coulomboscrelme.f90.zip|}}, you will find a subroutine (laguerre_general) that calculates the generalized Laguerre polynomials that appear in the definition of the HO wf's, see {{:ho_spherical.pdf| here}}. Use this subroutine to create a function or subroutine that calculates the HO wf's $R_{nl}(r)$. Note that for large $n,l$ values, the factorial and double factorial functions that appear in $R_{nl}$ lead to overflow if you code them according to their naive expressions. How might you avoid this problem? [Hint: Recall that $Log{(AB\cdots)}=Log{A} + Log{B} + \cdots$]. |
* Check numerically that the constructed HO wf's are orthonormal. I.e., evaluate $\int r^2dr R_{nl}(r)R_{n'l'}(r)$. To do this, you will want to use Gaussian quadrature to discretize the integrals. Gaussian quadrature is discussed a bit in {{:ho_spherical.pdf| }}. (Gauss-Laguerre quadrature is ideal for this problem, but plain old Gauss-Legendre quadrature, which is widely available in canned routines you can easily find via Google, is sufficient.) | * Check numerically that the constructed HO wf's are orthonormal. I.e., evaluate $\int r^2dr R_{nl}(r)R_{n'l'}(r)$. To do this, you will want to use Gaussian quadrature to discretize the integrals. Gaussian quadrature is discussed a bit in {{:ho_spherical.pdf| }}. (Gauss-Laguerre quadrature is ideal for this problem, but plain old Gauss-Legendre quadrature, which is widely available in canned routines you can easily find via Google, is sufficient.) |