Numerical Exercises for Tuesday July 15

In today's exercises, we complete the tasks from yesterday, which unfortunately had ambiguous and confusing instructions!

The easy stuff

Harmonic Oscillator wf's and matrix elements to solve the Hydrogen atom

Here, our goal is to do some simple exercises to help us build useful tools such as subroutines to calculate HO wf's and matrix elements $\langle n'l|V|nl\rangle$ that are useful building blocks for more complicated calculations (e.g., Hartree-Fock calculations of many-body systems). Our ultimate test will be to see if we can get the ground state energy of the hydrogen atom (-.5 in atomic units) when we solve the Schr\“odinger equation by matrix diagonalization in the HO basis.

Recall that the HO wavefunctions are given by \begin{equation} R_{nl}(r) = \frac{A_{nl}}{b^{3/2}}\xi^le^{-\xi^2/2}L_{n}^{l+1/2}(\xi^2)\,, \end{equation}

where the oscillator length $b\equiv \sqrt{\hbar/(m\omega)}$, and the dimensionless variable $\xi\equiv r/b$. The normalization constant is given by

\begin{equation} A_{nl}=\sqrt{\frac{2^{n+l+2}n!}{\pi^{1/2}(2n+2l+1)!!}} \end{equation}

\begin{equation} \int_{0}^{\infty}R_{nl}(r)R_{n'l}(r)r^2dr= \delta_{nn'} \end{equation}

\begin{equation} \int_{0}^{\infty}R_{nl}(r)R_{n'l}(r)r^2dr\approx \sum_{i=1}^{N}w_i r_i^2 R_{nl}(r_i)R_{n'l}(r_i)\,, \end{equation}

where the sum is over the N mesh points and $w_{i}$ are the quadrature weights.