.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/quantum/hydrogen/plot_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_hydrogen_plot_hydrogen_orbitals.py: Hydrogen orbitals ==================== The hydrogen-atom eigenstates factor into a radial part and a spherical harmonic, .. math:: \psi_{nlm}(r,\theta,\phi) = R_{nl}(r)\, Y_l^m(\theta,\phi), \qquad E_n = -\frac{Z^2}{2n^2}\ \text{(Hartree)}, labeled by the principal, orbital, and magnetic quantum numbers :math:`n, l, m` (with :math:`0\le linfinity ionization limit for n in range(1, 6): E_n = HydrogenOrbital(n, 0, 0).energy ax_levels.axhline(E_n, xmin=0.1, xmax=0.9, color="C0", lw=2) ax_levels.text(0.92, E_n, f"n={n}", va="center", fontsize=8) ax_levels.axhline(0.0, color="gray", ls="--", lw=0.8) ax_levels.text(0.92, 0.0, "ionized", va="center", fontsize=8, color="gray") ax_levels.set_xlim(0, 1.3) ax_levels.set_xticks([]) ax_levels.set_ylabel(r"$E_n = -Z^2/(2n^2)$ (Hartree)") ax_levels.set_title("Energy-level ladder") fig.tight_layout() .. image-sg:: /api/gallery/quantum/hydrogen/images/sphx_glr_plot_hydrogen_orbitals_001.png :alt: Hydrogen radial probability densities, Energy-level ladder :srcset: /api/gallery/quantum/hydrogen/images/sphx_glr_plot_hydrogen_orbitals_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none n=1 l=0 m=0: normalization=1.000000, most probable r=1.000 n=2 l=0 m=0: normalization=1.000000, most probable r=5.237 n=2 l=1 m=0: normalization=1.000000, most probable r=4.000 n=3 l=2 m=1: normalization=1.000000, most probable r=9.000 .. GENERATED FROM PYTHON SOURCE LINES 63-69 A volumetric :math:`\lvert\psi_{2,1,0}\rvert^2` electron-density cloud --------------------------------------------------------------------------- :func:`~physicskit.quantum.visualizers.orbitals.plot_orbital_cloud` returns an interactive Plotly figure; call ``.show()`` or ``.write_html(...)`` on it to view or export it. .. GENERATED FROM PYTHON SOURCE LINES 69-73 .. code-block:: Python orb_2p = HydrogenOrbital(2, 1, 0) fig3d = plot_orbital_cloud(orb_2p, n_points=45) .. GENERATED FROM PYTHON SOURCE LINES 74-84 A coherent superposition of two eigenstates, beating in time -------------------------------------------------------------- A single orbital's density is static (an eigenstate of a time-independent Hamiltonian), but a coherent superposition of *two* eigenstates is not: :func:`~physicskit.quantum.chapters.hydrogen_am.orbital_superposition_density` genuinely reshapes at the Bohr frequency :math:`\omega_{ab}=E_a-E_b`. :func:`~physicskit.quantum.visualizers.orbitals.animate_orbital_beating` renders this as a Plotly ``frames``-based isosurface animation with a Play button, stepping through one full beat period. .. GENERATED FROM PYTHON SOURCE LINES 84-91 .. code-block:: Python orb_a = HydrogenOrbital(2, 0, 0) orb_b = HydrogenOrbital(3, 1, 0) beat_period = 2 * np.pi / abs(orb_b.energy - orb_a.energy) times_beat = np.linspace(0, beat_period, 24) fig_beat = animate_orbital_beating(orb_a, orb_b, times_beat, n_points=35) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.216 seconds) .. _sphx_glr_download_api_gallery_quantum_hydrogen_plot_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_hydrogen_orbitals.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_hydrogen_orbitals.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_hydrogen_orbitals.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_