60 FPS
Drag: rotate  ·  Scroll: zoom  ·  Click electron: excite
Element
‹
H
Z = 1
›
NameHydrogen
Mass1.008 u
Period1
Blocks-block
1s¹
Visualization
Shells
K n=1
L n=2
M n=3
N n=4
Click to show/hide
Nucleus
Protons1
Neutrons0
NUCLEUS ZOOM
Emission Spectrum
Click electron to excite → emission
Selected Orbital
n (principal)—
l (angular)—
Type—
Energy (eV)—

Quantum Mechanics

The physics and mathematics of the quantum atom — from the Bohr model to wavefunction probability clouds and atomic emission spectra.

Bohr ModelSchrödinger Equation Quantum NumbersOrbital Shapes Probability DensityEmission Spectra Aufbau Principle
§ 01

The Bohr Model

1913

Niels Bohr proposed that electrons orbit the nucleus in discrete circular shells, each with a fixed energy. Electrons can jump between shells by absorbing or emitting photons of exactly the right energy.

Bohr energy levels for hydrogen-like atoms
$$E_n = -\frac{13.6\,\text{eV}}{n^2}\cdot Z^2$$
Orbital radius of shell n (Bohr radius a₀ = 0.0529 nm)
$$r_n = \frac{n^2 a_0}{Z}$$
Photon energy emitted on transition n₂ → n₁ (n₂ > n₁)
$$\Delta E = E_{n_1} - E_{n_2} = 13.6\,\text{eV}\left(\frac{1}{n_1^2}-\frac{1}{n_2^2}\right)$$
💡

The Bohr model correctly predicts hydrogen spectral lines but fails for multi-electron atoms. It was superseded by quantum mechanics, which describes electrons as probability waves rather than point particles on fixed orbits.

§ 02

Schrödinger's Wave Equation

Quantum Mechanics

The full quantum description of the electron comes from Schrödinger's equation. Its solutions — wavefunctions ψ — are characterised by three quantum numbers (n, l, mₗ) and describe the probability amplitude of finding the electron at any position.

Time-independent Schrödinger equation
$$\hat{H}\psi = E\psi \qquad \hat{H} = -\frac{\hbar^2}{2m}\nabla^2 + V(r)$$
Wavefunction in spherical coordinates (hydrogen)
$$\psi_{nlm}(r,\theta,\phi) = R_{nl}(r)\cdot Y_l^m(\theta,\phi)$$
Probability density — the quantum cloud
$$P(r,\theta,\phi) = |\psi_{nlm}|^2 = |R_{nl}(r)|^2\cdot|Y_l^m(\theta,\phi)|^2$$
🌊

The cloud visualization in this simulator places dots randomly with probability proportional to $|\psi|^2$. The shape you see is where the electron is most likely to be found — not a fixed orbit. The electron has no definite position until measured.

§ 03

Quantum Numbers

Orbital Classification

Each electron state is fully described by four quantum numbers. The first three come from the Schrödinger equation; the fourth (spin) comes from Dirac's relativistic quantum theory.

Principal quantum number — shell energy and size
$$n = 1, 2, 3, 4\ldots \quad\Rightarrow\quad \text{shells K, L, M, N}\ldots$$
Angular momentum quantum number — orbital shape
$$l = 0, 1, 2, 3\ldots(n-1) \quad\Rightarrow\quad s,\, p,\, d,\, f\,\text{ orbitals}$$
Magnetic quantum number — orbital orientation
$$m_l = -l, \ldots, 0, \ldots, +l \quad \Rightarrow \quad 2l+1\text{ orientations}$$
Pauli exclusion — max electrons per orbital
$$N_{\max}(l) = 2(2l+1) \quad\Rightarrow\quad s{:}2,\; p{:}6,\; d{:}10,\; f{:}14$$
📊

Shell capacities follow from this: K (n=1) holds $2(1)^2=2$ electrons, L holds $2(2)^2=8$, M holds $2(3)^2=18$, N holds $2(4)^2=32$.

§ 04

Orbital Shapes — Spherical Harmonics

3D Geometry

The angular part of the wavefunction is described by real spherical harmonics $Y_l^m(\theta,\phi)$. These give each orbital type its characteristic 3D shape.

s orbital (l=0) — spherically symmetric
$$Y_0^0 = \frac{1}{\sqrt{4\pi}}\quad\Rightarrow\quad|\psi|^2\propto e^{-2r/a_0}$$
p orbital (l=1) — dumbbell along an axis
$$Y_1^0 = \sqrt{\frac{3}{4\pi}}\cos\theta \quad (p_z)\qquad Y_1^{\pm1} = \sqrt{\frac{3}{8\pi}}\sin\theta\,e^{\pm i\phi} \quad (p_x,\,p_y)$$
d orbital (l=2) — four-lobe cloverleaf or ring+lobes
$$Y_2^0 = \sqrt{\frac{5}{16\pi}}(3\cos^2\theta-1)\qquad Y_2^{\pm1},Y_2^{\pm2}\text{ — rotated variants}$$
🔮

In the Orbital Shapes mode, this engine uses the squared spherical harmonics as a radial weighting to place cloud dots — larger $|Y_l^m|^2$ at a given angle means more dots there. The result is a 3D point-cloud isosurface of each orbital's probability lobe.

§ 05

Emission Spectra

Photon Physics

When an electron drops from a higher shell to a lower one it emits a photon whose energy exactly equals the energy difference. Different transitions emit different colours — this is the atom's unique spectral fingerprint.

Rydberg formula — wavelength of emitted photon
$$\frac{1}{\lambda} = R_H\left(\frac{1}{n_1^2}-\frac{1}{n_2^2}\right)\qquad R_H = 1.097\times10^7\,\text{m}^{-1}$$
Photon wavelength from energy gap (h·c = 1240 eV·nm)
$$\lambda = \frac{hc}{\Delta E} = \frac{1240\,\text{eV·nm}}{\Delta E}$$

Named series: Lyman (n→1, UV), Balmer (n→2, visible), Paschen (n→3, infrared). The visible Balmer lines — red (Hα 656nm), cyan (Hβ 486nm), violet (Hγ 434nm) — are the classic hydrogen spectrum.

🌈

Click any electron in the simulation to excite it. The emitted wavelength appears as a bright line in the spectrum bar. The color maps wavelength 380–700nm → visible RGB using a piecewise linear approximation of the human eye's response.

§ 06

Aufbau & Electron Configuration

Filling Rules

Electrons fill orbitals in a specific order — lowest energy first. The Aufbau principle, Hund's rule, and the Pauli exclusion principle together determine the ground-state electron configuration of every element.

Filling order (Madelung rule)
$$1s \to 2s \to 2p \to 3s \to 3p \to 4s \to 3d \to 4p \to 5s \to 4d \to 5p \to \cdots$$
Orbital energy anomalies (Chromium, Copper)
$$\text{Cr}: [\text{Ar}]\,3d^5\,4s^1 \quad\text{not}\quad 3d^4\,4s^2\qquad\text{(half-filled d is extra stable)}$$
📋

This engine covers H (Z=1) to Kr (Z=36) with correct configurations including the Cr and Cu anomalies. Use the arrows or keyboard ← → to browse elements. ↑ ↓ jumps by 10.

All Controls
InputAction
Mouse drag (canvas)Rotate atom in 3D
Scroll wheelZoom in / out
Click electronExcite → emission line appears
← → arrows / panel buttonsPrevious / next element
↑ ↓ arrowsJump 10 elements forward / back
Mode buttonsSwitch: Bohr / Quantum Cloud / Orbital Shapes
Shell buttonsToggle individual shell visibility
Nucleus zoom sliderZoom into nucleus to see protons / neutrons

Algorithm Source

Implementation notes and pseudocode for the 3D quantum atom rendering engine.

3D Rotation + Perspective Projection O(N) per frame
// Applied to every point: electrons, nucleus particles, cloud dots
function project(x, y, z):
  // 1. Rotate around Y axis (user drag — left/right)
  x1 = x*cos(rotY) + z*sin(rotY)
  z1 =-x*sin(rotY) + z*cos(rotY)

  // 2. Rotate around X axis (user drag — up/down)
  y2 = y*cos(rotX) - z1*sin(rotX)
  z2 = y*sin(rotX) + z1*cos(rotX)

  // 3. Perspective divide
  depth = z2 + 700           // push behind camera
  if depth < 5: return null
  s  = 500 / depth           // focal length = 500
  sx = centreX + x1 * s * zoom
  sy = centreY + y2 * s * zoom
  return { sx, sy, s, depth }
Probability Cloud Generation Rejection Sampling
// Precomputed once per orbital type (n, l)
// Uses hydrogen-like radial + angular wavefunctions
function buildCloud(n, l, shellRadius):
  pts = []
  while pts.length < N_CLOUD_POINTS:
    r     = random(0, shellRadius * 2.2)       // radial distance
    theta = acos(2*random() - 1)               // polar angle
    phi   = random(0, 2π)                      // azimuthal angle

    // Radial probability (simplified hydrogen-like)
    rn = r / shellRadius
    P_radial = r² * exp(-2*rn/n) * (polynomial in rn)

    // Angular probability (real spherical harmonics)
    if   l==0: P_ang = 1                          // s: sphere
    elif l==1: P_ang = |cos(theta)|² + ...        // p: dumbbell
    elif l==2: P_ang = sin²θ*cos²θ*(1+cos2φ)     // d: cloverleaf
    elif l==3: P_ang = |cos(3φ)|*sin³θ*cos²θ     // f: complex

    if random() < P_radial * P_ang * K:
      pts.push(sphericalToCartesian(r, theta, phi))
  return pts
Electron Excitation + Emission Quantum Jump
function exciteElectron(eIdx):
  e  = electrons[eIdx]
  n1 = orbitals[e.orbIdx].n           // ground shell
  n2 = random(n1+1, min(n1+2, 4))    // excited shell

  // Energy of emitted photon
  dE  = 13.6 * (1/n1² - 1/n2²)       // eV
  lam = 1240 / dE                     // wavelength in nm

  // Animate excitation
  e.exciteLevel = 1
  e.exciteTimer = 1.5               // seconds until drop back

  // Add line to emission spectrum
  if 380 < lam < 750:
    specLines.push({ lam, life: 1 })
    drawSpectrumLine(lam)
Performance Notes
SystemComplexityCount per frame
Cloud point projectionO(C)~4000 pts per active orbital
Depth sort (cloud)O(C log C)Sort then draw back→front
Nucleus projectionO(P)P = protons + neutrons
Electron updateO(E)E ≤ 36 electrons (Kr)
3D rotationO(N)6 multiplies per point
Cloud precomputeOnce per orbital~8 clouds × 4000 pts cached