# How to numerically solve the Schrodinger equation for the hydrogen atom?

From the analytical solution for the hydrogen atom I remember that the energies were obtained by boundary conditions and then the energy depends on n*n in which n is interpreted as different energy levels.

I am confused about solving Schrodinger equation numerically. Since we do not know the energy E, it appears as a non-numerical value in the Schrodinger equation. How can we solve the Schrodinger equation numerically?

The hydrogen atom, in the rest frame of the proton, has as its only nontrivial component a single electron, with wavefunction $$\psi(\vec{r},t)$$. The Hamiltonian will contain a kinetic-energy term for the electron and a Coulomb potential term:

$$H=\frac{\hat{\vec{p}}^2}{2m}-\frac{e^2}{4\pi\epsilon_0 \hat{r}}$$

We can write these operators in the position basis, since we have chosen to represent the electron's state with a position wavefunction:

$$H=\frac{-\hbar^2}{2m}\nabla^2-\frac{e^2}{4\pi\epsilon_0 r}$$

At this point, we can write down the Schrodinger equation $$H\psi=i\hbar\frac{\partial \psi}{\partial t}$$:

$$\frac{-\hbar^2}{2m}\nabla^2\psi - \frac{e^2}{4\pi\epsilon_0 r}\psi=i\hbar\frac{\partial \psi}{\partial t}$$

Numerically solving this equation for initial conditions $$\psi(\vec{r},0)$$ will give you the time evolution of your initial wavefunction.

Now that it is clear that what was actually asked for was the solution of the time-independent Schrodinger equation $$H\psi=E\psi$$, the answer is no longer simply using the nearest PDE solver on the above equation. In position space, the equation is now, for a time-independent wavefunction $$\psi(\vec{r})$$,

$$\frac{-\hbar^2}{2m}\nabla^2\psi - \frac{e^2}{4\pi\epsilon_0 r}\psi=E\psi$$

where we know neither $$E$$ nor $$\psi$$. There are generally two ways to start solving this - either start with a guess for $$E$$ and solve for $$\psi$$, or start with a guess for $$\psi$$ and solve for $$E$$.

If you're making a guess for $$E$$, then you proceed by solving the above PDE for $$\psi$$ and checking if the wavefunction is "sensible" (the conditions for "sensible" depend on the situation; for the hydrogen atom, we might include "vanishes at infinity" in our definition of "sensible," because hydrogen atoms have finite spatial extent). If the wavefunction is not "sensible," then, based on the particular way that $$\psi$$ is not "sensible," you make another guess for $$E$$ that is more likely to make the wavefunction "sensible" (for example, in the hydrogen atom, if the wavefunction grows indefinitely with distance, we might choose a lower value of energy in the next iteration). Repeat this process enough times, and you may zero in on a value of $$E$$ that produces a wavefunction $$\psi$$ that fits the necessary conditions.

If you're making a guess for $$\psi$$, then you can evaluate the left-hand side of the equation, determine how similar it is to $$\psi$$, adjust your guess in the direction that your result indicates, and evaluate again. Eventually you will get a wavefunction for which the left-hand side looks very close to a scaled version of $$\psi$$ (or equivalently, for which the left-hand side after normalization looks very close to $$\psi$$). This wavefunction is the stationary state, and the scaling factor is the energy.

• How can we know the initial condition and how can we know this initial condition is the eigen function of the Hamiltonian so that what we get as the expectation value of Hamiltonian is the energy corresponding to one of the energy levels? – MOON Oct 20 '18 at 14:42
• @MOON You have to choose your initial condition. If you choose it to be an eigenfunction of the Hamiltonian, then the time evolution will be as follows: $\psi(\vec{r},t)=e^{-iEt}\psi(\vec{r},0)$. If you want to find the eigenfunctions of the Hamiltonian, then that requires numerically solving the time-independent Schrodinger equation, which is an entirely different problem. – probably_someone Oct 20 '18 at 14:48
• Could you please also add to your answer how we can solve the time-independent Schrodinger equation? Because in the time-independent Schrodinger equation we do not know the energy E. – MOON Oct 20 '18 at 14:54