Skip to content

Latest commit

 

History

History
410 lines (264 loc) · 10.1 KB

File metadata and controls

410 lines (264 loc) · 10.1 KB

Quantum Physics Background

This document provides a complete derivation of the physics behind the hydrogen orbital visualization in Atoms_Rust.


Table of Contents

  1. The Hydrogen Atom
  2. Quantum Numbers
  3. Wave Function Derivation
  4. Radial Component
  5. Angular Component
  6. Probability Density
  7. Sampling Algorithm
  8. Probability Current
  9. Energy Levels
  10. Orbital Shapes

The Hydrogen Atom

The hydrogen atom consists of a single proton (nucleus) and one electron. It is the simplest atomic system and the only one with an exact analytical solution to the Schrödinger equation.

The Time-Independent Schrödinger Equation

$$\hat{H}\psi = E\psi$$

Where the Hamiltonian in spherical coordinates is:

$$\hat{H} = -\frac{\hbar^2}{2m_e}\nabla^2 - \frac{e^2}{4\pi\epsilon_0 r}$$

The Laplacian in spherical coordinates:

$$\nabla^2 = \frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{\partial}{\partial r}\right) + \frac{1}{r^2\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial}{\partial\theta}\right) + \frac{1}{r^2\sin^2\theta}\frac{\partial^2}{\partial\phi^2}$$


Quantum Numbers

The solution is characterized by three quantum numbers:

graph TB
    subgraph "Quantum Numbers"
        N[n<br/>Principal<br/>Energy Level]
        L[l<br/>Angular Momentum<br/>Orbital Shape]
        M[m<br/>Magnetic<br/>Orientation]
    end

    N --> |"l < n"| L
    L --> |"|m| ≤ l"| M

    style N fill:#e1f5fe
    style L fill:#fff3e0
    style M fill:#e8f5e9
Loading

Quantum Number Constraints

Symbol Name Range Physical Meaning
$n$ Principal $1, 2, 3, \ldots$ Energy level, shell
$l$ Angular momentum $0, 1, \ldots, n-1$ Orbital shape
$m$ Magnetic $-l, \ldots, 0, \ldots, +l$ Orbital orientation

Degeneracy

The number of states for a given $n$:

$$g_n = \sum_{l=0}^{n-1}(2l+1) = n^2$$


Wave Function Derivation

Separation of Variables

The wave function separates into radial and angular parts:

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

Where:

  • $R_{nl}(r)$ is the radial wave function
  • $Y_l^m(\theta,\phi)$ is the spherical harmonic

Complete Wave Function

$$\boxed{\psi_{nlm}(r,\theta,\phi) = R_{nl}(r) \cdot \Theta_{lm}(\theta) \cdot \Phi_m(\phi)}$$


Radial Component

Radial Wave Function

$$R_{nl}(r) = \sqrt{\left(\frac{2}{na_0}\right)^3 \frac{(n-l-1)!}{2n[(n+l)!]}} e^{-\rho/2} \rho^l L_{n-l-1}^{2l+1}(\rho)$$

Scaled Radial Coordinate

$$\rho = \frac{2r}{na_0}$$

Where $a_0$ is the Bohr radius:

$$a_0 = \frac{4\pi\epsilon_0\hbar^2}{m_e e^2} \approx 0.529 \times 10^{-10} \text{ m} = 0.529 \text{ Å}$$

Associated Laguerre Polynomials

The associated Laguerre polynomial $L_k^\alpha(x)$ is defined by:

$$L_k^\alpha(x) = \frac{x^{-\alpha}e^x}{k!}\frac{d^k}{dx^k}\left(x^{k+\alpha}e^{-x}\right)$$

Recurrence Relation

$$L_k^\alpha(x) = \frac{2k-1+\alpha-x}{k}L_{k-1}^\alpha(x) - \frac{k-1+\alpha}{k}L_{k-2}^\alpha(x)$$

Base Cases

$$L_0^\alpha(x) = 1$$

$$L_1^\alpha(x) = 1 + \alpha - x$$

Implementation Notes

In our code (physics/polynomials.rs), we compute this iteratively:

pub fn laguerre(n: i32, l: i32, rho: f64) -> f64 {
    let k = n - l - 1;  // Polynomial degree
    let alpha = 2 * l + 1;  // Superscript

    // Base cases
    if k == 0 { return 1.0; }
    if k == 1 { return 1.0 + alpha as f64 - rho; }

    // Recurrence relation
    let mut l_m1 = 1.0 + alpha as f64 - rho;
    let mut l_m2 = 1.0;
    // ... iterate
}

Angular Component

Spherical Harmonics

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

Associated Legendre Polynomials

$$P_l^m(x) = (-1)^m (1-x^2)^{m/2} \frac{d^m}{dx^m}P_l(x)$$

Where $P_l(x)$ is the ordinary Legendre polynomial.

Recurrence Relation

$$(l-m)P_l^m(x) = (2l-1)xP_{l-1}^m(x) - (l+m-1)P_{l-2}^m(x)$$

Base Cases

$$P_m^m(x) = (-1)^m(2m-1)!!(1-x^2)^{m/2}$$

$$P_{m+1}^m(x) = x(2m+1)P_m^m(x)$$


Probability Density

Full Probability Density

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

Since $|\Phi_m(\phi)|^2 = |e^{im\phi}|^2 = 1$:

$$|\psi_{nlm}|^2 = |R_{nl}(r)|^2 \cdot |\Theta_{lm}(\theta)|^2$$

Radial Probability Density

The probability of finding the electron between $r$ and $r+dr$:

$$P(r)dr = r^2 |R_{nl}(r)|^2 dr$$

The $r^2$ factor comes from the volume element in spherical coordinates: $dV = r^2\sin\theta,dr,d\theta,d\phi$

Angular Probability Density

The probability of finding the electron between $\theta$ and $\theta+d\theta$:

$$P(\theta)d\theta = \sin\theta |P_l^m(\cos\theta)|^2 d\theta$$

Azimuthal Distribution

The azimuthal angle $\phi$ is uniformly distributed:

$$P(\phi) = \frac{1}{2\pi}$$


Sampling Algorithm

CDF-Based Sampling

We sample particle positions from the probability distribution using Cumulative Distribution Function (CDF) inversion.

flowchart TD
    START[Start: n, l, m] --> BUILD_R[Build radial CDF<br/>N = 4096 points]
    BUILD_R --> BUILD_THETA[Build angular CDF<br/>N = 2048 points]
    BUILD_THETA --> SAMPLE[Enter sampling loop]
    SAMPLE --> R[1. Sample r from CDF<br/>r = CDF⁻¹U<0,1]
    R --> THETA[2. Sample θ from CDF<br/>θ = CDF⁻¹U<0,1]
    THETA --> PHI[3. Sample φ uniformly<br/>φ = 2π × U<0,1]
    PHI --> CART[4. Convert to Cartesian<br/>x = r sin θ cos φ<br/>y = r cos θ<br/>z = r sin θ sin φ]
    CART --> COLOR[5. Calculate intensity<br/>I = |R|² × |P|²]
    COLOR --> MAP[6. Map to inferno color]
    MAP --> RENDER[7. Render particle]
    RENDER --> MORE{More particles?}
    MORE -->|Yes| R
    MORE -->|No| DONE[Complete]
Loading

Radial CDF Construction

fn build_r_cdf(n: i32, l: i32) {
    let r_max = 10.0 * n * n * a0;  // Covers 99.9% of probability
    for i in 0..4096 {
        let r = i * dr;
        let rho = 2.0 * r / (n * a0);

        // Evaluate radial wave function
        let L = laguerre(n, l, rho);
        let R = sqrt(norm) * exp(-rho/2) * rho^l * L;

        // PDF = r² × |R|²
        let pdf = r * r * R * R;
        cdf[i] = cdf[i-1] + pdf;
    }
    // Normalize to [0, 1]
    for v in &mut cdf { *v /= cdf_last; }
}

Sampling by Inversion

Given a uniform random number $u \in [0,1]$:

$$r = \text{CDF}^{-1}(u)$$

In practice, we use binary search to find the index where $\text{CDF}[i] \leq u &lt; \text{CDF}[i+1]$.


Probability Current

For states with $m \neq 0$, the probability current is non-zero.

Definition

$$\vec{J} = \frac{\hbar}{m_e} \text{Im}(\psi^* \nabla\psi)$$

Result for Hydrogen Orbitals

$$\vec{J} = \frac{\hbar m}{m_e r \sin\theta} \hat{e}_\phi$$

Interpretation

  • Particles circulate around the z-axis
  • Direction depends on sign of $m$
  • Magnitude increases with $|m|$
  • Visualized as rotating motion in our simulation

Cartesian Components

$$\vec{J} = v_\phi \hat{e}_\phi = v_\phi(-\sin\phi,\hat{x} + \cos\phi,\hat{z})$$

Where $v_\phi = \frac{\hbar m}{m_e r \sin\theta}$


Energy Levels

Energy Formula

$$E_n = -\frac{m_e e^4}{2(4\pi\epsilon_0)^2\hbar^2 n^2} = -\frac{13.6 \text{ eV}}{n^2}$$

Energy Level Diagram

graph TB
    subgraph "Energy Levels eV"
        N4["n=4<br/>E = -0.85 eV"]
        N3["n=3<br/>E = -1.51 eV"]
        N2["n=2<br/>E = -3.4 eV"]
        N1["n=1<br/>E = -13.6 eV<br/>Ground State"]
        ION["E = 0<br/>Ionization"]
    end

    N4 -.->|λ = 1875 nm| N3
    N4 -.->|λ = 1282 nm| N2
    N4 -.->|λ = 97.3 nm| N1

    N3 -.->|λ = 656 nm<br/>Balmer-α| N2
    N3 -.->|λ = 103 nm| N1

    N2 -.->|λ = 122 nm<br/>Lyman-α| N1

    N1 --> ION
Loading

Energy Values

n Energy (eV) Name
1 -13.6 Ground state
2 -3.4 First excited
3 -1.51 Second excited
4 -0.85 Third excited
0 Ionization limit

Transition Energies

For a transition from $n_2$ to $n_1$ ($n_2 &gt; n_1$):

$$\Delta E = E_{n_2} - E_{n_1} = 13.6 \text{ eV}\left(\frac{1}{n_1^2} - \frac{1}{n_2^2}\right)$$


Orbital Shapes

Radial Nodes

Number of radial nodes: $n_r = n - l - 1$

Angular Nodes

Number of angular nodes: $n_\theta = l$

Total Nodes

Total nodes: $n_{\text{total}} = n - 1$

Orbital Shapes by l

graph LR
    subgraph "s orbitals l=0"
        S1[1s: No nodes]
        S2[2s: 1 radial node]
        S3[3s: 2 radial nodes]
    end

    subgraph "p orbitals l=1"
        P1[2p: 1 angular node]
        P2[3p: 1 radial + 1 angular]
    end

    subgraph "d orbitals l=2"
        D1[3d: 2 angular nodes]
        D2[4d: 1 radial + 2 angular]
    end
Loading

s Orbitals (l = 0)

  • Shape: Spherically symmetric
  • Angular nodes: 0
  • Radial nodes: n-1
  • Examples: 1s (no nodes), 2s (1 radial node), 3s (2 radial nodes)

p Orbitals (l = 1)

  • Shape: Dumbbell, oriented along one axis
  • Angular nodes: 1 (a plane)
  • Radial nodes: n-2
  • Examples: 2p₀ (along z), 2p₊₁/2p₋₁ (toroidal + dumbbell)

d Orbitals (l = 2)

  • Shape: Cloverleaf or double dumbbell
  • Angular nodes: 2
  • Radial nodes: n-3
  • Examples: 3dxy, 3dxz, 3dyz, 3dx²-y², 3dz²

f Orbitals (l = 3)

  • Shape: Complex multi-lobed patterns
  • Angular nodes: 3
  • Radial nodes: n-4
  • Example: 4f orbitals

Summary

The hydrogen orbital visualization in Atoms_Rust is based on:

  1. Exact quantum mechanics: The Schrödinger equation solution for hydrogen
  2. Correct mathematics: Laguerre and Legendre polynomials computed via recurrence
  3. Proper probability sampling: CDF inversion from the correct probability densities
  4. Physical accuracy: Probability current flow for m ≠ 0 states

The result is a scientifically accurate visualization that correctly represents:

  • Orbital shapes and symmetries
  • Radial and angular node structure
  • Probability density distributions
  • Quantum mechanical flow patterns