This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
numexercises7_14 [2014/07/14 08:45] bogner |
numexercises7_14 [2014/07/14 13:40] (current) 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 {{:coulomboscrelme.f90.zip|}} calculates the relative matrix elements $\langle nl|V|n'l\rangle$ in HO states. From this, construct a subroutine that returns the properly normalized $r$-space HO wf's. For some basic background on HO wf's, see {{:ho_spherical.pdf| here}}. | + | * 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. To do this, you will want to use Gaussian quadrature to discretize the integrals. Gaussian quadrature is discussed a bit in {{:ho_spherical.pdf| }}. If you don't have a routine to calculate quadrature points/weights, take advantage of Google to find a canned routine to do this for you. | + | * Check numerically that the constructed HO wf's are orthonormal. I.e., evaluate $\int r^2dr R_{nl}(r)R_{n'l'}(r)$. You will want to use Gaussian quadrature to discretize the integrals. Gaussian quadrature is discussed some in {{:ho_spherical.pdf| }}. While Gauss-Laguerre quadrature is ideal for this problem, plain Gauss-Legendre quadrature, which is widely available in canned routines you can easily find via Google, is sufficient. |
+ | |||
+ | * Write a function/subroutine that calculates the matrix elements of the Coulomb potential between an electron and a proton, $\langle nl|V|n'l\rangle$. Use atomic units ($e=m_e=\hbar=1/4\pi\epsilon_0$). | ||
+ | |||
+ | * Modify your code in the previous step so that it calculates $\langle nl|V|n'l\rangle$ for any user-supplied potential $V(r)$. | ||
+ | |||
+ | * Using the analytical expressions for the kinetic energy matrix elements $\langle nl|T|n'l\rangle$,construct the hamilton matrix $\langle nl|H|n'l\rangle$ for the hydrogen atom for $l=0$. Keep HO basis states $n,n'<N_{max}$ and diagonalize $H$. For a given $N_{max}$ value, repeat the calculation at different HO frequencies and plot the ground state energy versus $\omega$ (or the oscillator length scale, defined as $b=\sqrt{\hbar/(m\omega)}$. Hopefully, you find that as $N_{max}$ increases, the ground state begins to approach the exact result of -$.5$ in natural units. | ||
- | * Construct a subroutine that returns relative HO matrix elements of the Minnesota NN potential. The definition of the Minnesota potential and a sketch of how to proceed will be given on the black board. | ||