Modeling and visualization of bound-state hydrogen eigenfunctions and electron probability densities.
- Python 3.12.11
- Matplotlib 3.10.6
- Seaborn 0.13.2
- NumPy 2.3.2
- SciPy 1.16.1
- Normalized radial functions with stable log-gamma normalization & complex spherical harmonics.
- Stationary-state wavefunction on an
$x–z$ plane grid$(y=0)$ . - Probability densities and radial probability distributions.
- Reduced-mass Bohr radius and electron–nucleus reduced mass.
- hydrogen_wavefunction.py - Wavefunction computational modeling
- hwf_plots.py - Plotting module
- main.py - Application entry-point to showcase samples
- hydrogen_wavefunctions.ipynb - IPython / Jupyter Notebook
- Quantum Mechanics and Atomic Systems: A Brief Overview
- Schrödinger Equation for Hydrogen Atom Wavefunctions
- Model assumptions
- References
Quantum mechanics (QM) is the fundamental theory in physics that provides a description of the physical properties of nature at the scale of atoms and subatomic particles. Unlike classical mechanics which describes macroscopic phenomena, QM addresses the behavior of matter and energy on the quantum (smallest discrete) level.
The hydrogen atom is especially significant as it is the simplest atom, containing just one electron. Its wavefunction can be treated analytically, providing profound insights into the nature of quantum systems.
Electron probability density for hydrogen atom orbitals shown as cross-sections
A wavefunction (
The square magnitude of the wavefunction
These are mathematical functions that describe the wave-like behavior of either one electron or a pair of electrons in an atom. These functions can be used to determine the probability of finding an electron in any specific region around the atom's nucleus; Their angular structure is carried by spherical harmonics and their radial structure by associated Laguerre polynomials.
Electron density plot showing regions of varying electron probability
We can describe quantum numbers as a set of numerical values that provide a complete
description of a quantum particle's state.
For electrons in an atom, there are typically four quantum numbers:
-
Principal quantum number (
$n$ ):( 1 <= n )
Represents the electron's energy level and relative size of the orbital. -
Azimuthal quantum number (
$\ell$ ):( 0 <= l <= n-1 )
Relates to the shape of the atomic orbital. -
Magnetic quantum number (
$m_\ell$ ):( -l <= m <= l )
Specifies the orientation of the orbital in space. -
Spin quantum number (
$m_s$ ):( +1/2 or -1/2 )
Describes the electron's intrinsic spin.
Spin is excluded here (no spin–orbit, hyperfine, or fine‑structure corrections).
Note
In the hydrogen atom, or any atom with a single electron (like ionized helium, lithium, etc.), the electron's spin doesn't interact with anything else to affect its spatial distribution.
For our specific application with the hydrogen atom, we will focus on the first three quantum numbers, as the electron's spin doesn't influence the shape or distribution of the electron cloud.
The Schrödinger equation serves as the foundation of quantum mechanics, it is a differential equation that determines the wavefunctions of a quantum system. For the hydrogen atom, we use the following representation of the time-independent Schrödinger equation:
Given the spherical symmetry of the hydrogen atom, we may express it in terms of
spherical coordinates
Relationship between the spherical and rectangular coordinate systems
The wavefunction can be represented as a product of radial and angular functions:
When the Hamiltonian is expressed in spherical coordinates, it contains both radial and angular parts.
By substituting this into the Schrödinger equation, we separate the equation into two parts:
one that depends only on
The radial wavefunction gives us information about the probability
distribution of the electron as a function of distance
2.1.1 Exponential Decay
Signifies the probability decay of finding an
electron as we move away from the nucleus. Here,
2.1.2 Power term
Dictates how the probability changes with
2.1.3 Associated Laguerre Polynomials
These polynomials contribute to the finer structure of the radial part, especially defining nodes (regions where the probability is zero):
The angular wavefunction yields the spherical harmonics, which gives the angular dependence of the wavefunction in terms of the polar (
2.2.1 Associated Legendre Polynomials
These dictate the shape of the orbital in the polar (
2.2.2 Exponential Azimuthal Term
This term provides the orientation of the orbital in the azimuthal plane, as
determined by the magnetic quantum number
The resultant normalized wavefunction for the hydrogen atom (and hydrogenic ions) is the product of the solutions of the radial and angular components:
To determine the probability density
In addition, the radial probability distribution describes the probability of finding the electron between
- Non-relativistic, point nucleus, Schrödinger hydrogenic Hamiltonian with Coulomb potential.
- No spin/fine-structure, external fields, or finite-nuclear-size effects.
- Shapes broadcast;
$R$ is real-valued,$Y_{\ell}^{m}$ and$\psi$ are complex. -
$R$ and$\psi$ have units of$,\mathrm{m}^{-3/2}$ . -
$Y_{\ell}^{m}$ and$Z$ are dimensionless. - Cartesian coordinates
$(x,y,z)$ and radial distance$r$ are in meters. - Masses are in kilograms.
To account for the finite nuclear mass, the model uses the electron–nucleus reduced mass
Here
Setting
The same formalism applies for hydrogenic ions with nuclear charge
All radial length scales contract by
(When
For visualization, the model evaluates stationary states on the plane
The azimuth
-
Plane mode (default):
$\phi=0\ \text{for}\ x\ge0,\quad \phi=\pi\ \text{for}\ x<0.$ -
Constant mode:
$\large \phi \equiv \phi_0$ (user-specified constant).
This keeps the angular dependence well defined on the slice while preserving the complex phase of
Note
We use the complex orthonormal spherical harmonics with the Condon–Shortley phase, so that
The function plot_hydrogen_wavefunction_xz
from the hwf_plots
module can be used to generate 2D color-mapped plots of the electron probability density
Plot Parameter | Description | Type |
---|---|---|
wf |
Wavefunction parameters. | WaveFunction |
color_map |
Seaborn colormap name. | str |
use_dark_theme |
Theme rendering mode. | bool |
k |
Framing scale factor for extent calculation. | float |
exposure |
Exposure correction factor for low-probability regions. | float |
Below there are some example plots generated for various quantum states of the hydrogen atom:
wf = WaveFunction(n=3, l=2, m=1)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", k=2)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", use_dark_theme=True, k=2)
wf = WaveFunction(n=4, l=3, m=0)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", k=2.2, exposure=0.5)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", use_dark_theme=True, k=2.2, exposure=0.5)
wf = WaveFunction(n=3, l=0, m=0)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", k=2.5, exposure=1)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", use_dark_theme=True, k=2.5, exposure=1)
wf = WaveFunction(n=4, l=3, m=1)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", k=2)
plot_hydrogen_wavefunction_xz(wf, colormap="rocket", use_dark_theme=True, k=2)
As we examine the electron density plots corresponding to the quantum numbers above,
we notice that with increasing principal quantum number
- The number of nodes (regions where the probability density is zero) increases.
- The electron's spatial distribution expands, covering larger regions around the nucleus.
- The overall shape of the atomic orbital becomes more intricate and detailed.
wf = WaveFunction(n=9, l=6, m=1)
plot_hydrogen_wavefunction_xz(wf, colormap="mako", k=2, exposure=0.5)
plot_hydrogen_wavefunction_xz(wf, colormap="mako", use_dark_theme=True, k=2, exposure=0.5)
wf = WaveFunction(n=32, l=16, m=1)
plot_hydrogen_wavefunction_xz(wf, colormap="magma", k=1.8, exposure=0.5)
plot_hydrogen_wavefunction_xz(wf, colormap="magma", use_dark_theme=True, k=1.8, exposure=0.5)
For extremely high quantum numbers, the following effects can be observed:
- The complexity increases even further, resulting in numerous nodes and intricate patterns.
- Evaluating the wavefunction over a vast spatial domain becomes computationally intensive.
- Visualization can become cluttered, making it harder to discern specific details or features.
- Griffiths, D.J. (2016) Introduction to quantum mechanics. 3rd edn. Harlow: Pearson.
- Atkins, P. and Friedman, R. (2011) Molecular quantum mechanics. 5th edn. Oxford: Oxford University Press.
- Bransden, B.H. and Joachain, C.J. (2003) Quantum mechanics. 2nd edn. Harlow: Pearson Education.
- Zettili, N. (2009) Quantum mechanics: concepts and applications. 2nd edn. Chichester: Wiley.
- Eisberg, R. and Resnick, R. (1985) Quantum physics of atoms, molecules, solids, nuclei, and particles. 2nd edn. New York: Wiley.
- Bethe, H.A. & Salpeter, E.E. (1957) Quantum Mechanics of One- and Two-Electron Atoms. Berlin: Springer.
- Landau, L.D. & Lifshitz, E.M. (1977) Quantum Mechanics: Non-Relativistic Theory. 3rd edn. Oxford: Pergamon.
- Edmonds, A.R. (1960) Angular Momentum in Quantum Mechanics. 2nd edn. Princeton, NJ: Princeton University Press.
- Freie Universität Berlin (2015) Theoretical chemistry, Available at: https://www.bcp.fu-berlin.de/en/chemie/chemie/forschung/PhysTheoChem/agkeller/_Docs/TC_WS15_Ex07.pdf
As of August 2025, the contents of this work have been utilized by various universities, academic institutions, research projects and scientific exhibitions.
Their use in these contexts is gratefully acknowledged, and it continues to be openly available for academic, research, and educational purposes.
Readers, scholars, researchers and institutions are welcome to reference or incorporate it in their own work as appropriate.
Important
This work is openly available for academic, research and educational purposes.
Voluntary contributions to support this effort are welcome.