Computational Demo: Spherical Harmonics#

Spherical harmonics \(Y^m_{l}(θ,ϕ)\) are the angular solutions to the Schrödinger equation for systems with spherical symmetry. They form a complete set of orthogonal functions on the surface of a sphere.

##Mathematical Definition: $\( Y_l^m(\theta,\phi) = \sqrt{\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}} P_l^m(\cos\theta)e^{im\phi} \)$

where:

√[…]: Normalization constant (makes sure total probability = 1)

\(P^m_{l}(cos θ)\): Associated Legendre polynomials (determines θ-dependence)

\(e^{im\phi}\): Complex exponential (determines φ-dependence)

Summary: Spherical harmonics are the mathematical functions that describe how quantum probability is distributed over directions in space. They form a complete and orthogonal “alphabet” of angular behaviors, meaning any directional quantum pattern can be built from them. Physically, they encode the directional shapes of atomic orbitals.

##The Basic Idea Spherical harmonics are just the mathematical description of the angular shapes of atomic orbitals.

Think of them as “vibration patterns on a sphere” similar to how a bubble’s surface can vibrate in different patterns:

  • Simple up-down motion

  • More complex patterns with nodes (still points)

Spherical harmonics are the 3D version of this as they describe all the possible vibration patterns on a sphere.

Summary: Spherical harmonics describe all possible wave-like patterns that can exist on the surface of a sphere, analogous to vibration modes on a drum or bubble. Each pattern has specific nodes and symmetries that determine where probability can and cannot exist. These patterns directly translate into the shapes of atomic orbitals.

1. What Problem Are We Trying to Solve - The Schrödinger Equation#

Imagine you have a quantum system with spherical symmetry, for example:

  • A hydrogen atom (electron around nucleus)

  • A diatomic molecule rotating

  • Any system that looks the same when you rotate it

The Problem We’re Solving#

The Schrödinger equation for these systems is easier to solve if we use spherical coordinates (r, θ, φ) instead of regular (x,y,z) coordinates.

When we do this, we find the wavefunction separates into: \(ψ(r,θ,φ) = R(r) × Y(θ,φ)\)

Each part explained:

  • \(R(r)\) The radial part:

Answers: “How far from the nucleus is the electron?”

Depends only on distance r

Examples:

1s orbital: Highest probability near nucleus

2s orbital: Some probability farther out

3s orbital: Electron can be even farther away

  • \(Y(θ,φ)\) The angular part (Spherical Harmonics):

Answers: “In which direction is the electron pointing?”

Depends only on angles θ and φ

Examples:

s-orbitals: Equal in all directions (spherical)

p-orbitals: Prefer certain directions (dumbbell-shaped)

d-orbitals: More complex directional preferences

Spherical harmonics answer: “In which directions is the particle most likely to be found?”

Summary: The Schrödinger equation for spherically symmetric systems separates naturally into radial and angular parts when written in spherical coordinates. The radial function determines how far from the nucleus the particle is likely to be found, while the spherical harmonics determine the directional probability. Together, they completely describe the quantum state.The angular function tells us where in space an electron is most likely to be found, independent of how far from the nucleus it is. Different values of ℓ and m correspond to different spatial symmetries and nodal structures. These angular patterns are exactly what define the familiar s, p, and d orbital shapes.

2. Where Do They Come From? Let’s Start with the Rigid Rotor#

The Rigid Rotor Problem#

Think of a diatomic molecule (like HCl) spinning in space.

The time-independent Schrödinger equation for this is: $\( -\frac{\hbar^2}{2I} \left[ \frac{1}{\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial}{\partial\theta}\right) + \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\phi^2} \right] \psi(\theta,\phi) = E \psi(\theta,\phi) \)$

The solutions to this equation are exactly the spherical harmonics \(Y_l^m(\theta, \phi)\), with energies: $\( E_l = \frac{\hbar^2}{2I} l(l+1) \)$ This shows that spherical harmonics are fundamentally the quantum states of rotation.

Then We Use Them for Hydrogen Atoms#

For hydrogen atoms, we have the same angular equation, so we reuse the same spherical harmonics but now combine them with radial functions:

\(\psi_{nlm}(r,\theta,\phi) = R_{nl}(r)Y_l^m(\theta,\phi)\)

Important Properties:#

Differential Equation (from rigid rotor): $\( \nabla^2 Y_l^m + l(l+1)Y_l^m = 0 \)$ This angular Laplacian operator comes directly from separating the rigid rotor Schrödinger equation.

Orthonormality:#

\[ \int_0^{2\pi} \int_0^{\pi} Y_l^m(\theta,\phi) Y_{l'}^{m'*}(\theta,\phi) \sin\theta d\theta d\phi = \delta_{ll'}\delta_{mm'} \]

This means:

  • Different spherical harmonics are perpendicular in function space

  • You can’t get one spherical harmonic by mixing others

  • This allows any angular function to be expanded as a sum of spherical harmonics

##Angular Momentum Eigenfunctions: $\(\hat{L}^2 Y_l^m = \hbar^2 l(l+1) Y_l^m\)$

\[\hat{L}_z Y_l^m = \hbar m Y_l^m\]
  • \(l\) quantizes the total angular momentum

  • \(m\) quantizes the z-component of angular momentum

  • For rigid rotor: These are the measurable quantities of rotational angular momentum

This means when we measure:

  • Total angular momentum squared, we always get \(ħ²l(l+1)\)

  • z-component of angular momentum, we always get \(ħm\)

##Completeness:

Any well-behaved function on a sphere can be written as: $\( f(\theta,\phi) = \sum_{l=0}^{\infty} \sum_{m=-l}^{l} c_{lm} Y_l^m(\theta,\phi) \)$

Summary: Orthonormality guarantees that every spherical harmonic represents a completely independent angular state. Completeness guarantees that any angular probability distribution can be reconstructed as a sum of spherical harmonics. Together, these properties make spherical harmonics a universal basis for all directional quantum behavior.

Table 1: The First Few Spherical Harmonics#

Spherical Harmonic

Mathematical Expression

Physical Interpretation

\(Y_0^0\)

\(\dfrac{1}{\sqrt{4\pi}}\)

s-orbital: Spherical symmetry, no angular nodes

\(Y_1^0\)

\(\left( \dfrac{3}{4\pi} \right)^{1/2} \cos\theta\)

p\(_z\)-orbital: Dumbbell shape along z-axis, one nodal plane (xy-plane)

\(Y_1^1\)

\(\left( \dfrac{3}{8\pi} \right)^{1/2} \sin\theta e^{i\phi}\)

Complex p-orbital basis: Forms real p\(_x\) and p\(_y\) orbitals

\(Y_1^{-1}\)

\(\left( \dfrac{3}{8\pi} \right)^{1/2} \sin\theta e^{-i\phi}\)

Complex p-orbital basis: Forms real p\(_x\) and p\(_y\) orbitals

\(Y_2^0\)

\(\left( \dfrac{5}{16\pi} \right)^{1/2} (3\cos^2\theta - 1)\)

d\(_{z^2}\)-orbital: Unique “doughnut + lobe” shape, two nodal cones

\(Y_2^1\)

\(\left( \dfrac{15}{8\pi} \right)^{1/2} \sin\theta \cos\theta e^{i\phi}\)

Complex d-orbital basis: Forms real d\(_{xz}\) and d\(_{yz}\) orbitals

\(Y_2^{-1}\)

\(\left( \dfrac{15}{8\pi} \right)^{1/2} \sin\theta \cos\theta e^{-i\phi}\)

Complex d-orbital basis: Forms real d\(_{xz}\) and d\(_{yz}\) orbitals

\(Y_2^2\)

\(\left( \dfrac{15}{32\pi} \right)^{1/2} \sin^2\theta e^{2i\phi}\)

Complex d-orbital basis: Forms real d\(_{xy}\) and d\(_{x^2-y^2}\) orbitals

\(Y_2^{-2}\)

\(\left( \dfrac{15}{32\pi} \right)^{1/2} \sin^2\theta e^{-2i\phi}\)

Complex d-orbital basis: Forms real d\(_{xy}\) and d\(_{x^2-y^2}\) orbitals

Table 2: Real Spherical Harmonics (Commonly Used in Chemistry)#

Orbital Type

Real Combination

Mathematical Expression

p\(_x\)

\(\dfrac{1}{\sqrt{2}}(Y_1^1 + Y_1^{-1})\)

\(\left( \dfrac{3}{4\pi} \right)^{1/2} \sin\theta \cos\phi\)

p\(_y\)

\(\dfrac{1}{i\sqrt{2}}(Y_1^1 - Y_1^{-1})\)

\(\left( \dfrac{3}{4\pi} \right)^{1/2} \sin\theta \sin\phi\)

p\(_z\)

\(Y_1^0\)

\(\left( \dfrac{3}{4\pi} \right)^{1/2} \cos\theta\)

d\(_{xy}\)

\(\dfrac{1}{i\sqrt{2}}(Y_2^2 - Y_2^{-2})\)

\(\left( \dfrac{15}{16\pi} \right)^{1/2} \sin^2\theta \sin 2\phi\)

d\(_{xz}\)

\(\dfrac{1}{\sqrt{2}}(Y_2^1 + Y_2^{-1})\)

\(\left( \dfrac{15}{4\pi} \right)^{1/2} \sin\theta \cos\theta \cos\phi\)

d\(_{yz}\)

\(\dfrac{1}{i\sqrt{2}}(Y_2^1 - Y_2^{-1})\)

\(\left( \dfrac{15}{4\pi} \right)^{1/2} \sin\theta \cos\theta \sin\phi\)

d\(_{x^2-y^2}\)

\(\dfrac{1}{\sqrt{2}}(Y_2^2 + Y_2^{-2})\)

\(\left( \dfrac{15}{16\pi} \right)^{1/2} \sin^2\theta \cos 2\phi\)

d\(_{z^2}\)

\(Y_2^0\)

\(\left( \dfrac{5}{16\pi} \right)^{1/2} (3\cos^2\theta - 1)\)

Quantum Numbers: The Fundamental Parameters#

Mathematical Definition and Physical Significance#

Quantum numbers arise naturally as eigenvalues from solving the Schrödinger equation for atomic systems. They represent the discrete, quantized states available to electrons in atoms.

Angular Momentum Quantum Number (l)#

Mathematical Origin: Eigenvalue of the angular momentum squared operator: $\(\hat{L}^2 Y_l^m = \hbar^2 l(l+1) Y_l^m\)$

Physical Significance:

  • Quantizes the orbital angular momentum magnitude: \(|\vec{L}| = \hbar\sqrt{l(l+1)}\)

  • Determines the orbital shape and symmetry

  • Number of angular nodes = \(l\)

  • Defines the orbital subshell type

Allowed Values: \(l = 0, 1, 2, \ldots, n-1\) (constrained by \(n\))

Magnetic Quantum Number (m)#

Mathematical Origin: Eigenvalue of the z-component angular momentum operator:

\[\hat{L}_z Y_l^m = \hbar m Y_l^m\]

Physical Significance:

  • Quantizes the z-component of orbital angular momentum: \(L_z = \hbar m\)

  • Determines spatial orientation of the orbital

  • Related to the orbital’s projection along the quantization axis

  • In magnetic fields, different m values have different energies

Allowed Values: \(m = -l, -l+1, \ldots, 0, \ldots, l-1, l\) (\(2l + 1\) values for each \(l\))

Key Properties Summary#

Quantum Number

Physical Meaning

Allowed Values

Degeneracy

l

Angular momentum

0, 1, 2, 3, …

Determines shape

m

z-component of angular momentum

\(-l, -l+1, \ldots, 0, \ldots, l-1, l\)

Determines orientation

Nodes

Surfaces where \(\psi = 0\)

Exactly \(l\) angular nodes

Determines complexity

Degeneracy for each l: \(2l + 1\) different m values
Total angular momentum: \(|\vec{L}| = \hbar\sqrt{l(l+1)}\)
z-component: \(L_z = \hbar m\)

Visualizing Spherical Harmonics#

Use the drop-down menu below to visualize the effect of \(l\) and \(m\) on the Spherical Harmonic function.

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.special import sph_harm_y
import ipywidgets as widgets
from IPython.display import display
from ipywidgets import interactive_output

theta = np.linspace(0, np.pi, 100)
phi = np.linspace(0, 2*np.pi, 100)
theta, phi = np.meshgrid(theta, phi)

xyz = np.array([np.sin(theta) * np.sin(phi),
                np.sin(theta) * np.cos(phi),
                np.cos(theta)])

def plot_Y(ax, l, m): # Defines the equation using scipy.special package
    Y = sph_harm_y(l, abs(m), theta, phi)

    if m < 0: # Linear combination of l, m
        Y = np.sqrt(2) * (-1)**m * Y.imag
    elif m > 0: # Linear combination of l, -m to generate the real form
        Y = np.sqrt(2) * (-1)**m * Y.real
    Yx, Yy, Yz = np.abs(Y) * xyz

    # Color the plotted surface according to the sign of Y.
    cmap = plt.cm.ScalarMappable(cmap=plt.get_cmap('bwr'))
    cmap.set_clim(-0.5, 0.5)

    ax.plot_surface(Yx, Yy, Yz,
                    facecolors=cmap.to_rgba(Y.real),
                    rstride=2, cstride=2)

    # Plot with x, y, z axiis
    ax_lim = 0.5
    ax.plot([-ax_lim, ax_lim], [0,0], [0,0], c='0.5', lw=1, zorder=10)
    ax.plot([0,0], [-ax_lim, ax_lim], [0,0], c='0.5', lw=1, zorder=10)
    ax.plot([0,0], [0,0], [-ax_lim, ax_lim], c='0.5', lw=1, zorder=10)
    # Set the Axes limits and title, turn off the Axes frame.
    ax.set_title(r'$Y_{{{},{}}}$'.format(l, m))
    ax_lim = 0.5
    ax.set_xlim(-ax_lim, ax_lim)
    ax.set_ylim(-ax_lim, ax_lim)
    ax.set_zlim(-ax_lim, ax_lim)
    ax.axis('off')

# Define options for l
# change range() to any number you would like to see
# For example: range(4) will display l = 0 to l = 3
l_options = [(str(i), i) for i in range(4)]

l_dropdown = widgets.Dropdown(
    options=l_options,
    value=0,
    description='l:',
    disabled=False,
)

# Initial m options (for l=0)
m_options_initial = [(str(0), 0)]
m_dropdown = widgets.Dropdown(
    options=m_options_initial,
    value=0,
    description='m:',
    disabled=False,
)

# Available m options will change according to the l option selected
def update_m_options(*args):
    selected_l = l_dropdown.value
    new_m_options = [(str(i), i) for i in range(-selected_l, selected_l + 1)]
    m_dropdown.options = new_m_options
    if m_dropdown.value not in [val for label, val in new_m_options]:
        m_dropdown.value = 0 # Reset m to 0 if the current value is out of range

l_dropdown.observe(update_m_options, 'value')

def update_plot(l, m): # Update the plot when changes are made to drop down menus
    fig = plt.figure(figsize=plt.figaspect(1.))
    ax = fig.add_subplot(projection='3d')
    plot_Y(ax, l, m)
    plt.show()

out = interactive_output(update_plot, {'l': l_dropdown, 'm': m_dropdown})

# Display the dropdowns and the interactive output
display(l_dropdown, m_dropdown, out)

Summary#

Spherically symmetric systems can be described in spherical coordinates to solve its corresponding Schrödinger equation, forming a complete set of orthonormal functions on the surface of a sphere. The resulting wavefunction can then be expressed in terms of a radial part and an angular (Spherical Harmonic) part.

By applying the Rigid-Rotor model to the Spherical Harmonic portion, we obtain the solutions to these harmonics denoted by the quantum numbers \(l\) and \(m\) , which characterize the discrete, quantized states of electrons in the atom.

The orthonormality of the funtion ensures the independence of spherical harmonics with different quantum numbers and allows angular functions to be expanded as a sum of spherical harmonics.

By visualizing spherical harmonics with varying \(l\) and \(m\) values, we can better understand the unique atomic orbitals corresponding to each spherical harmonic, as well as the probability distribution of electrons in atoms.