I am trying to solve the radial Schrödinger equation using NDEigensystem
but I am running into some issues. There are posts about doing this (see here for example), but I don't particularly understand the specifics such as why a shift is necessary for unbounded potentials like the Coulomb potential (here the Coulomb solutions were found without a shift).
Regardless, I've non-dimensionalized the Schrödinger equation, with a Yukawa potential, to be of the form
\begin{equation} \frac{d^2f}{dx^2} + \left[ \frac{2}{x}e^{-x/\xi} -\gamma^2 - \frac{\ell(\ell + 1)}{x^2} \right]f = 0 . \end{equation}
Here, $f$ is the radial part of the wave function multiplied by the radius, and $x$ is a nondimensionalized radius.
The energy eigenvalue is given by $\gamma^2$ and in the limit that $\xi\to \infty$, $\gamma \to 1/n$ which are the non-dimensional energy eigenvalues for a plain Coulomb potential.
As a warm up, I've simply tried to solve the Coulomb case (ignoring the possible variable substitutions suggested here). The code for this is as follows:
H[l_] = f''[x] + (2/x - (l (l + 1))/x^2)*f[x];
{vals, funs} =
NDEigensystem[{H[0], DirichletCondition[f[x] == 0, True]},
f[x], {x, 0, 100}, 3,
Method -> {"SpatialDiscretization" -> {"FiniteElement", \
{"MeshOptions" -> {"MaxCellMeasure" -> 0.001}}}}];
Take[Sort[vals]]
which outputs
{-0.0185335, -0.00331214, 0.00932567}
This is obviously significantly different from the {1, 0.25, 0.111111}
that I expect. I've assumed $\ell = 0$ for simplicity, but naturally, I would also like to recover the $\ell\geq 0$ results as well. Thanks in advance.
NDEigensystem
looks for eigenvalues closest to zero first, then the next closest to zero, then the next, etc. Since, for the hydrogen atom, the eigenvalues bunch up near zero, it's never going to look for the ground state first! This is the purpose of the shift. It's there to shift the eigenvalues up enough so that the smallest eigenvalue (the ground state energy) is closest to zero, and so it will look for those first. $\endgroup$vals
in that code includes several positive eigenvalues, which are discarded by theTake
command. Also note that the top answer doesn't actually find the ground state; it only gets the $n = 2$ through $n = 8$ states. $\endgroup$