.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/quantum/hydrogenlike/plot_01_hydrogen_orbitals.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_quantum_hydrogenlike_plot_01_hydrogen_orbitals.py: Schrodinger's hydrogen atom: radial wavefunctions and orbital energies ========================================================================= Schrodinger's first 1926 paper solved his wave equation for the hydrogen atom and recovered the Bohr energies :math:`E_n\propto-1/n^2` without any quantization postulate. :class:`~chemistrykit.quantum.systems.hydrogenlike.HydrogenLikeAtom` reproduces the textbook 13.6 eV hydrogen ground-state energy exactly, and its radial wavefunctions (built from the associated Laguerre polynomials of :mod:`scipy.special`) are independently checked here by numerically integrating them to a normalized probability of 1. .. GENERATED FROM PYTHON SOURCE LINES 16-28 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.constants import ELECTRONVOLT from chemistrykit.quantum.systems.hydrogenlike import HydrogenLikeAtom from chemistrykit.quantum.visualizers.quantum_plots import plot_radial_distribution h_atom = HydrogenLikeAtom(Z=1) print(f"Bohr radius a0 = {h_atom.bohr_radius:.6e} m") for n in (1, 2, 3, 4): print(f"E_{n} = {-h_atom.energy(n) / ELECTRONVOLT:.4f} eV (ionization energy from level n)") .. rst-class:: sphx-glr-script-out .. code-block:: none Bohr radius a0 = 5.291772e-11 m E_1 = 13.6057 eV (ionization energy from level n) E_2 = 3.4014 eV (ionization energy from level n) E_3 = 1.5117 eV (ionization energy from level n) E_4 = 0.8504 eV (ionization energy from level n) .. GENERATED FROM PYTHON SOURCE LINES 29-32 Every radial wavefunction should integrate (as r^2 R^2) to exactly 1 -- a formula-agnostic sanity check independent of any particular associated-Laguerre-polynomial normalization convention: .. GENERATED FROM PYTHON SOURCE LINES 32-37 .. code-block:: Python for n, l in [(1, 0), (2, 0), (2, 1), (3, 0), (3, 1), (3, 2)]: norm = h_atom.check_radial_normalization(n, l) print(f"n={n}, l={l}: integral of r^2 R_nl(r)^2 dr = {norm:.6f}") .. rst-class:: sphx-glr-script-out .. code-block:: none n=1, l=0: integral of r^2 R_nl(r)^2 dr = 1.000000 n=2, l=0: integral of r^2 R_nl(r)^2 dr = 1.000000 n=2, l=1: integral of r^2 R_nl(r)^2 dr = 1.000000 n=3, l=0: integral of r^2 R_nl(r)^2 dr = 1.000000 n=3, l=1: integral of r^2 R_nl(r)^2 dr = 1.000000 n=3, l=2: integral of r^2 R_nl(r)^2 dr = 1.000000 .. GENERATED FROM PYTHON SOURCE LINES 38-45 .. code-block:: Python fig, ax = plt.subplots(figsize=(7, 5)) for n, l, style in [(1, 0, "-"), (2, 0, "--"), (2, 1, "-."), (3, 2, ":")]: plot_radial_distribution(h_atom, n, l, ax=ax, r_max_bohr_radii=25.0, linestyle=style, label=f"n={n}, l={l}") ax.legend() ax.set_title("Hydrogen radial distribution functions") fig.tight_layout() .. image-sg:: /api/gallery/quantum/hydrogenlike/images/sphx_glr_plot_01_hydrogen_orbitals_001.png :alt: Hydrogen radial distribution functions :srcset: /api/gallery/quantum/hydrogenlike/images/sphx_glr_plot_01_hydrogen_orbitals_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 46-50 The 1s radial distribution function peaks at exactly r = a0 -- the famous result that the Bohr-model "orbit radius" is really the *most probable* radial distance in the full quantum treatment, not a literal orbit: .. GENERATED FROM PYTHON SOURCE LINES 50-58 .. code-block:: Python a0 = h_atom.bohr_radius r = np.linspace(1.0e-4 * a0, 6.0 * a0, 2000) P = h_atom.radial_distribution_function(r, n=1, l=0) r_peak = r[np.argmax(P)] print(f"1s radial distribution peaks at r = {r_peak / a0:.4f} * a0 (expected: 1.0)") plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none 1s radial distribution peaks at r = 0.9996 * a0 (expected: 1.0) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.061 seconds) .. _sphx_glr_download_api_gallery_quantum_hydrogenlike_plot_01_hydrogen_orbitals.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_hydrogen_orbitals.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_hydrogen_orbitals.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_hydrogen_orbitals.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_