![](/Adillwma/QuantumHarmonics/raw/main/Images/QuantumHarmonics_Logo2.gif)
- Introduction
- Part 1 - The Quantum Harmonic Oscillator
- Part 2 - The Hydrogen Atom
- Part 3 - The Hydrogen Atom with l > 0
- Appendix
- Contributing
- Contact
- Acknowledgements
- Liscence
Our current best understanding of the most fundamental aspects of our universe come from Quantum Mechanics. Central to this framework is the Schrödinger equation, a core equation that governs the behaviour of non-reletivistic quantum systems. Solving a form of this equation known as the Time-Independent Schrödinger Equation or 'TISE' in the position basis reveals the quantized energy levels and spatial distribution of a quantum system. The TISE solves for the stationary states and is often used to solve for systems where the potential is constant over time. Analytical solutions are often infeasible for complex systems, necessitating numerical techniques. This project is designed to solve the TISE numerically for various quantum systems and visualize the results. A comparison is made to some well understood examples that have exact analytical solutions in order to validate the numerical results and quantify our accuracy. We will specifically be solving for the Energy Levels and Wavefunctions, the latter of which will be used to calculate the Probability Density of the systems spatial distribution.
The energy levels
where
here
The Quantum Harmonic Oscillator (QHO) is a fundamental concept in quantum mechanics, serving as an analogue to the classical harmonic oscillator. The classical harmonic oscillator represents a system with a quadratic potential, oscillating about an equilibrium position, such as a vibrating diatomic molecule or pendulum, the QHO extends this understanding into the quantum realm. The QHO is a good example to begin building our simulation since it has exact analytic solutions we can use to validate our results.
For the quantum harmonic oscillator, the potential
where
![](/Adillwma/QuantumHarmonics/raw/main/Images/QHOpotential.png)
The potential
When solved analytically the Energy Levels,
where
This equation represents the quantization of energy levels in the QHO. Quantisation is a core idea of Quantum Mechanics (hence the name). In the case of the QHO, each energy level is equally spaced, with a separation of
n | Analytical Result | In terms of |
---|---|---|
1 | 1 | |
2 | 3 | |
3 | 5 | |
4 | 7 | |
5 | 9 | |
6 | 11 | |
7 | 13 | |
... | ... | ... |
The table shows the first seven analytically derived energy states for the Quantum Harmonic Oscillator, we see that when the energy is expressed in terms of
The analytical wavefunctions
This equation is made up of three terms,
Solving for the first three wavefunctions we get the following:
Term | Normalisation Prefactor | Gaussian | Hermite Polynomial | Wavefunction Expression |
---|---|---|---|---|
1 | ||||
2 | ||||
3 | ||||
... | ... | ... | ... | ... |
The first three analytically solved wavefunctions for the Quantum Harmonic Oscillator. See Appendix Section 1.3 for a more comprehensive reference table.
It is hard to get an idea of what these wavefunctions look like from the above table, but if we now plot the wavefunctions against the displacement in
![](/Adillwma/QuantumHarmonics/raw/main/Images/wfa.png)
The first three analytically solved wavefunctions for the Quantum Harmonic Oscillator plotted against position
We will now attempt to calculate the energy levels and wavefunctions of the same QHO system, this time by solving the TISE using numerical methods. We can then compare the results to the exact analytical solutions shown above to validate our methodology.
To find a numerical solution, we can divide the spatial dimension into
In order to define the matrix
where
and the diagonals above and below this are,
If we choose to measure
The potential term can be represented by a matrix where the leading diagonal is the potential evaluated at the
Then using a linear algebra solver, we can solve for the eigenvalues and eigenvectors of
NOTE: It is important to use a small $(\approx 0.1 a_o)$ step size for $\Delta x$ . Additionally the x range (from which follows the range for the potential) must cover sufficient range that the largest desired wavefunction falls to zero at the extremities in order to ensure the numerical solutions stability as demonstrated in Appendix Section 2.1.
We compare the computed eigenvalues with the expected eigenvalues.
Looking back on our table of analytical values for the energy levels and filling in our simulated values we can see we get a good match between the two, with the error gradually increasing as the energy level increases. This is to be expected as the wavefunctions become more complex and the numerical solutions become less stable.
n | Analytical Result | in terms of |
Simulation Result | Simulation Error |
---|---|---|---|---|
1 | 1 | 1.00 | 0.00 | |
2 | 3 | 3.00 | 0.00 | |
3 | 5 | 4.99 | 0.01 | |
4 | 7 | 6.98 | 0.02 | |
5 | 9 | 8.97 | 0.03 | |
6 | 11 | 10.96 | 0.04 | |
7 | 13 | 12.95 | 0.05 | |
... | ... | ... | ... | ... |
Comparison between analytical and simulated results for the first seven energy levels for the QHO
To get a better idea of the error we can plot it as a function of n, the results show good agreement between simulation and analytical results, a full exploration of the error as a function of the input parameters is given in Appendix Section 2.1.
![](/Adillwma/QuantumHarmonics/raw/main/Images/outputt.png)
The left-hand plot shows the results for the first 100 energy levels of our simulation compared to the analytical results shown in red. The plot on the right shows both the absolute error (shown in green and referenced to the left y-axis) and the relative error as a percentage of the true value (shown in yellow and reference to the right hand y-axis.)
We can also compare our numerically computed wavefunctions to their analytical counterparts to check that our simulation is working as expected.
![](/Adillwma/QuantumHarmonics/raw/main/Images/output5.png)
Comparison between the first four simulated and analytically derived QHO wavefunctions and probability densities. Although there is a phase mismatch to one of the wavefunctions, we find agreement between all the probability distributions.
In this visual comparison we can see that the wavefunctions are in good agreement with the analytical solutions, with the only difference being a phase factor in one of the waves. This is to be expected as the phase is not a physical observable and is therefore not unique. This phase shift does not affect the probability density, which we find to be in good agreement with the analytical solutions. This is quantified further in Appendix Section 2.1.
Now we have verified our simulation works as expected, we can move on to visualising the wavefunctions and probability density of the QHO in more detail.
![](/Adillwma/QuantumHarmonics/raw/main/Images/output21.png)
The left-hand plots in blue show the simulated wavefunctions for the QHO corresponding values of
Putting together the results and visualisations generated so far, we can see the relationship between the potential and the probability density of the QHO. Each probability density is plotted at the energy given by its corresponding energy level eigenvalue. We see how the potential forms a well in which the wavefunctions/probability densities are confined, classically this potential is an absolute limit, however we can see that the probability densities extend beyond this point, this is a key feature of quantum mechanics, and is a result of the wave-like nature of the electron.
![](/Adillwma/QuantumHarmonics/raw/main/Images/output7.png)
The dotted u shape line shows the potential, the left-hand plot shows the simulated wavefunctions, plotted at the energy corresponding to their energy eigenvalue. The right-hand plot shows the same but with the probability densities rather than wavefunctions. Classically the probability of existing outside of the potential limits is not allowed, this is one of the disagreements between classical and quantum theory.
Having verified our method, we can use it to solve a slightly more complex system - the Hydrogen atom. We will use same methodology as before but change the potential to that of the hydrogen atom. The eigenvalues and eigenvectors will then yield the energy levels and wavefunctions which we shall again compare to analytical results.
In addition to having to change the potential, we will also change to a spherical coordinate system to simplify our calculations. In such a spherically symmetric system, the wavefunction can be written,
where
Now that we are using a spherical coordinate system, we discretise a range of radius values,
then the energy will be measured in units of,
Given the units we have selected to work in for convenience, the analytically derived energy levels of the hydrogen atom are given by the formula,
n | Analytical Result | in terms of |
---|---|---|
1 | -1.0000 | |
2 | -0.2500 | |
3 | -0.1111 | |
4 | -0.0625 | |
5 | -0.0400 | |
6 | -0.0278 | |
7 | -0.0204 | |
... | ... | ... |
The table shows the first seven analytically derived energy states for the Hydrogen atom, we can see that the energy levels are a multiple of the ground state energy, -1.0000, as expected.
Given our choice of units the potential for the hydrogen atom can be written,
This potential is the sum of the classical attractive Coulomb interaction between the electron and the nucleus, and an additional term dependent on the azimuthal quantum number
Initially we will focus only on this case where
![](/Adillwma/QuantumHarmonics/raw/main/Images/output56.png)
The potential for Hydrogen when the value of quantum number
We can now use the same method as outlined in Part 1 to create the kinetic energy term matrix
NOTE: We must use a range of $r$ such that the wavefunction become negligible, and a large number of $r$ points, at least 1000, to ensure the numerical solutions stability as demonstrated in Appendix Section 2.1.
n | Analytical Result | in terms of |
Simulation Result ( |
Simulation Error ( |
---|---|---|---|---|
1 | -1.0000 | -1.0433 | -0.0433 | |
2 | -0.2500 | -0.2553 | -0.0053 | |
3 | -0.1111 | -0.1127 | -0.0017 | |
4 | -0.0625 | -0.0632 | -0.0007 | |
5 | -0.0400 | -0.0403 | -0.0003 | |
6 | -0.0278 | -0.0280 | -0.0002 | |
7 | -0.0204 | -0.0205 | -0.0001 | |
... | ... | ... | ... | ... |
Comparison between analytical and simulated results for the first seven energy levels for the Hydrogen electron
To convert our dimensionless results given in terms of
-
$m_e$ : mass of an electron$\approx 9.109 \times 10^{-31}$ kg -
$e$ : elementary charge$\approx 1.602 \times 10^{-19}$ C -
$\epsilon_0$ : vacuum permittivity$\approx 8.854 \times 10^{-12}$ F/m -
$\hbar$ : reduced Planck constant$\approx 1.055 \times 10^{-34}$ J·s
Which yields,
Which we know is the energy of the ground state of the hydrogen atom, and each energy level is a multiple of this value. We can then convert our dimensionless results to eV by multiplying by 13.606.
n | Analytical Result (eV) | Simulation Result (eV) | Simulation Error (eV) |
---|---|---|---|
1 | -13.6060 | -14.1712 | -0.5905 |
2 | -3.4015 | -3.4713 | -0.0721 |
3 | -1.5095 | -1.5318 | -0.0232 |
4 | -0.8547 | -0.8597 | -0.0095 |
5 | -0.5442 | -0.5488 | -0.0041 |
6 | -0.3774 | -0.3801 | -0.0014 |
7 | -0.2768 | -0.2796 | -0.0007 |
... | ... | ... | ... |
Comparison between analytical and simulated results for the first seven energy levels for the Hydrogen electron with the energy values converted to eV
![](/Adillwma/QuantumHarmonics/raw/main/Images/outpuit.png)
The left hand plots show the first 9 simulated wavefunctions,
We can see from our findings that the probability densities correctly predict what we observe in the real world, which is that electrons with higher energy will be found further from the nucleus, The peak of the probability density is the most likely place to find the electron, and this correspond to the classically predicted radius. However, there is also a probability of a higher energy electron being found closer to the nucleus than predicted by classical physics (or further away). This is a result of the wave-like nature of the electron and is a key feature of quantum mechanics.
![](/Adillwma/QuantumHarmonics/raw/main/Images/output18.png)
The plot shows the simulated probability density corresponding to the wavefunctions for
We can get an idea of how the probability density manifests by adding some perspective shifted circles onto our plot to indicate the maxima of the probability density. It is important to note these are merely a guide to the eye, to highlight the local maxima, the probability density is a continuous function and is not limited to these circled radii.
![](/Adillwma/QuantumHarmonics/raw/main/Images/output17.png)
Same plot as shown above with the added guides marking out the local maxima for each probability density.
The energy scale describes the required energy to move the electron from its bound state to infinity, a simpler way to think of it is the sum total energy of the nucleus and the electron is this much lower (hence the negative) than if they were separated by an infinite distance.
So far, we have been calculating in one dimension, but the hydrogen atom is a three-dimensional system. Fortunately, in the
![](/Adillwma/QuantumHarmonics/raw/main/Images/n2dscaled.png)
![](/Adillwma/QuantumHarmonics/raw/main/Images/n2d.png)
We can expand our solution to two dimensions in this case where
If we return to our hydrogen potential, given by equation 14, and change the value of
When
For
![](/Adillwma/QuantumHarmonics/raw/main/Images/outputcc.png)
Hydrogen potential varying
![](/Adillwma/QuantumHarmonics/raw/main/Images/l3d.png)
3D representation of the shape of the Hydrogen orbitals as
Overall, for higher values of
If we now again plot the wavefunctions and probability density for the hydrogen atom, but this time for a range of l values, we can see how the position of the maxima changes as
![](/Adillwma/QuantumHarmonics/raw/main/Images/ls2.png)
Plot again shows the wavefunctions on the left and the probability densities on the right. This time we plot a range of
To be updated.
To be updated.
Term | Normalisation Prefactor | Gaussian | Hermite Polynomial | Wavefunction Expression |
---|---|---|---|---|
1 | ||||
2 | ||||
3 | ||||
4 | ||||
5 | ||||
6 | ||||
7 | ||||
8 | ||||
9 | ||||
10 | ||||
11 | ||||
12 | ||||
13 | ||||
14 | ||||
15 | ||||
... | ... | ... | ... | ... |
Analytical wavefunctions for the Quantum Harmonic Oscillator generated. Abriged to the first 15 terms due to GitHub's column width. Full 100 terms available at Full Reference Table
Many thanks to Prof. Sandu Popescu, FRS, for many inspiring and enlightening lectures.
Contributions to this codebase are welcome! If you encounter any issues, bugs or have suggestions for improvements please open an issue or a pull request on the GitHub repository.
This project is not currently licensed. For more information please get in touch via the contact details below.
For any queries related to this project feel free to get in touch with me via email at [email protected].