The goal of this program is to find numerical solutions to the eigenvalue problem, the time-independent Schrodinger Equation.
We will work in 2 dimensions so the equation becomes:
This program is meant to be a personal exercise to extend what was accomplished in the repository quantum-eigenvalues to 2 dimensions.
We want to solve this for different potentials
We know how to solve the Schrodinger equation in 1D. The problem now is to extend it to 2D. Lets first look at the eigenvectors
In 2D it feels natural to turn
However,
When we run it through SciPy, it'll return the eigenvectors like this:
Here you can see that it is a column vector
Now the next part is to deal with the 2D Laplacian. We saw the 1D case with the tridiagonal matrix. The matrix will look similar
here except now we can set
Here we can see that the off diagonals contain 1 and the main diagonal contains -2. This comes from the 3 point approximation for the derivative.
The Kroncker Sum of discrete Laplacians in 2D is
This is computed using the Kronecker product(although SciPy performs the calculations for us):
This results in an
Recall that the potential energy was a matrix with only entries on the diagonal and 0s everywhere else.
It will be the same here except there will be
The Schrodinger Equation then becomes this
There are different potentials the user can run the program for.
First is the Infinite Square Well or Particle in a box:
Next is the Harmonic Oscillator:
Next is the Hydrogen-like potential:
Next is the Gaussian-like potential:
When the program runs, it will ask you to input different quantities. The first one is which potential to run it for. I = Infinite square well, O = Harmonic Oscillator, H = Hydrogen-like potential, G = Gaussian-like potential.
The next is the number of states to run it for. Note that the ground state is calculated so if you enter 3, it will calculate states 0-2.
Next is the length and width of the grid L. The grid is defined from -L to L.
Next is the number of discretized points between -L and L.
After user input is calculated it will solve the eigenvalue problem. It uses eigsh from SciPy to do this which returns the amount of eigenvalues and eigenvectors corresponding to "states." The code is currently setup to calculate the "states" amount of lowest eigenvalues so that it gives eigenvalues from smallest to largest. SciPy is necessary here because it has ARPACK subroutines to handle large sparse matrices.
For the output, instead of the eigenvectors we are instead more concerned with the probability densities. It uses MatPlotLib in order to make contour plots of not only the potentials but also the probability densities. You should see windows open with these figures. You can track the program's progress in the console in which this is ran.