Quantum Mechanics: Physics, Mathematics, Proofs, and Computation

From postulates to Hilbert space, exact solutions, rigorous proofs, and numerical computation — an interactive, graduate-level primer.

v1.0 • updated 2025

1. The Postulates of Quantum Mechanics

Quantum mechanics rests on a mathematical structure that replaces classical phase-space trajectories with vectors in a complex Hilbert space $\mathcal{H}$.

  1. State. The complete description of an isolated system is a normalized ket $|\psi(t)\rangle \in \mathcal{H}$ with $\langle\psi|\psi\rangle = 1$. In position representation, $\psi(x,t)=\langle x|\psi\rangle$, $\int |\psi|^2 dx =1$.
  2. Observables. Every physical observable $A$ corresponds to a self-adjoint (Hermitian) operator $\hat{A} = \hat{A}^\dagger$ acting on $\mathcal{H}$.
  3. Measurement. The possible outcomes are the eigenvalues $a_n$ of $\hat{A}$, $\hat{A}|a_n\rangle = a_n|a_n\rangle$. Probability: $p(a_n)=|\langle a_n|\psi\rangle|^2$. After outcome $a_n$, the state collapses to $|a_n\rangle$.
  4. Evolution. Closed system evolution is unitary: $$ i\hbar\frac{d}{dt}|\psi(t)\rangle = \hat{H}|\psi(t)\rangle $$ with Hamiltonian $\hat{H}$. Formal solution $|\psi(t)\rangle = \hat{U}(t)|\psi(0)\rangle$, $\hat{U}=e^{-i\hat{H}t/\hbar}$.
  5. Composition. For systems $A$ and $B$, $\mathcal{H}_{AB} = \mathcal{H}_A \otimes \mathcal{H}_B$. Entangled states cannot be factored.

2. Wavefunctions and the Schrödinger Equation

From de Broglie to Schrödinger

A free particle plane wave $\psi(x,t)=A e^{i(kx-\omega t)}$ satisfies de Broglie relations $p=\hbar k$, $E=\hbar\omega$. The classical energy $E=p^2/2m+V(x)$ suggests the operator substitutions $\hat{p}\to -i\hbar\partial_x$, $\hat{E}\to i\hbar\partial_t$:

$$ i\hbar\frac{\partial\psi}{\partial t} = -\frac{\hbar^2}{2m}\frac{\partial^2\psi}{\partial x^2} + V(x)\psi $$

Time-independent Schrödinger equation (TISE): with $\psi(x,t)=\phi(x)e^{-iEt/\hbar}$:

$$ \hat{H}\phi = E\phi,\quad -\frac{\hbar^2}{2m}\phi'' + V\phi = E\phi $$

Probability interpretation (Born, 1926)

$\rho(x,t)=|\psi(x,t)|^2$ is probability density. Probability current $j = \frac{\hbar}{m}\operatorname{Im}(\psi^*\partial_x\psi)$ obeys continuity $\partial_t\rho + \partial_x j =0$. Normalization is preserved by unitary evolution.

3. Mathematical Formalism

Hilbert space

$\mathcal{H}=L^2(\mathbb{R})$ with inner product $\langle\phi|\psi\rangle = \int \phi^*(x)\psi(x)dx$. Complete orthonormal bases satisfy $\sum_n |n\rangle\langle n| = \mathbb{I}$.

Hermitian operators

$\hat{A}^\dagger = \hat{A}$ implies $\langle\phi|\hat{A}\psi\rangle = \langle\hat{A}\phi|\psi\rangle$. Eigenvalues are real: if $\hat{A}|a\rangle=a|a\rangle$, then $a=a^*$.

Position and momentum: $[\hat{x},\hat{p}]=i\hbar$ since $(\hat{x}\hat{p}-\hat{p}\hat{x})\psi = i\hbar\psi$.

Commutators and uncertainty

Define $\Delta A^2 = \langle(\hat{A}-\langle A\rangle)^2\rangle$. The general Robertson relation:

$$ \Delta A\,\Delta B \ge \frac12 |\langle[\hat{A},\hat{B}]\rangle| $$

For $[\hat{x},\hat{p}]=i\hbar$, $\Delta x\,\Delta p \ge \hbar/2$.

4. Key Analytic Solutions

4.1 Particle in a 1D infinite well ($0

With $V=0$ inside, $\phi''+k^2\phi=0$, $k=\sqrt{2mE}/\hbar$, boundary $\phi(0)=\phi(L)=0$:

$$ \phi_n(x)=\sqrt{\frac{2}{L}}\sin\frac{n\pi x}{L},\quad E_n=\frac{n^2\pi^2\hbar^2}{2mL^2},\; n=1,2,\dots $$

4.2 Quantum harmonic oscillator

$\hat{H}=\frac{\hat{p}^2}{2m}+\frac12 m\omega^2\hat{x}^2$. Define ladder operators:

$$ \hat{a}=\sqrt{\frac{m\omega}{2\hbar}}\left(\hat{x}+\frac{i\hat{p}}{m\omega}\right),\quad \hat{a}^\dagger=\sqrt{\frac{m\omega}{2\hbar}}\left(\hat{x}-\frac{i\hat{p}}{m\omega}\right),\quad [\hat{a},\hat{a}^\dagger]=1 $$
$$ \hat{H}=\hbar\omega\left(\hat{a}^\dagger\hat{a}+\tfrac12\right),\; E_n=\hbar\omega\left(n+\tfrac12\right) $$

Wavefunctions: $\psi_n(x) = \frac{1}{\sqrt{2^n n!}}\left(\frac{m\omega}{\pi\hbar}\right)^{1/4} H_n(\xi)e^{-\xi^2/2}$, $\xi=\sqrt{m\omega/\hbar}\,x$, $H_n$ Hermite polynomials.

4.3 Hydrogen atom

Radial TISE with Coulomb $V=-e^2/4\pi\epsilon_0 r$ yields $E_n = -13.6\,\text{eV}/n^2$, degeneracy $n^2$. Eigenstates $|nlm\rangle = R_{nl}(r)Y_l^m(\theta,\phi)$.

4.4 Tunneling through rectangular barrier

For $E

$$ T(E)=\left[1+\frac{V_0^2\sinh^2(\kappa a)}{4E(V_0-E)}\right]^{-1},\quad \kappa=\sqrt{2m(V_0-E)}/\hbar $$

5. Interactive Demos

5.1 Free Gaussian Wave Packet Spreading

Analytic: $|\psi(x,t)|^2 = \frac{1}{\sqrt{2\pi}\sigma(t)}\exp[-(x-x_0-p_0t/m)^2/2\sigma(t)^2]$, $\sigma(t)=\sigma_0\sqrt{1+(\hbar t/2m\sigma_0^2)^2}$.

5.2 Particle in a Box Eigenstates

Eₙ = (ħ=m=L=1)

5.3 Quantum Tunneling — Stationary Scattering

Numerov integration of TISE for $E

Transmission T ≈

5.4 Double-Slit Buildup

Particles arrive one by one sampling $P(y)\propto \cos^2(k d y /2) \exp(-y^2/2\sigma^2)$. Interference emerges statistically.

5.5 Stern–Gerlach Spin-½ Measurement

Prepare $|\psi\rangle = \cos(\theta/2)|\uparrow_z\rangle + \sin(\theta/2)|\downarrow_z\rangle$. Measure $\hat{S}_z$. Probabilities $p_\uparrow=\cos^2(\theta/2)$.

p↑=0.50

5.6 Harmonic Oscillator Ladder Operators

$\hat{a}^\dagger|n\rangle = \sqrt{n+1}|n+1\rangle$. Visualize $\psi_n$ and $\hat{a}^\dagger\psi_n$.

n = 0
Scale factor √(n+1)

6. Core Proofs

6.1 General Uncertainty Principle (Robertson)

Let $\hat{A}'=\hat{A}-\langle A\rangle$, $\hat{B}'=\hat{B}-\langle B\rangle$, $|f\rangle=\hat{A}'|\psi\rangle$, $|g\rangle=\hat{B}'|\psi\rangle$. Cauchy-Schwarz: $\|f\|^2\|g\|^2 \ge |\langle f|g\rangle|^2$.

$$ \Delta A^2\Delta B^2 \ge |\langle\psi|\hat{A}'\hat{B}'|\psi\rangle|^2 $$

Decompose $\hat{A}'\hat{B}' = \frac12\{\hat{A}',\hat{B}'\} + \frac12[\hat{A}',\hat{B}']$. The anticommutator is Hermitian (real expectation), commutator anti-Hermitian (imaginary). Thus

$$ |\langle \hat{A}'\hat{B}'\rangle|^2 = \tfrac14|\langle\{\hat{A}',\hat{B}'\}\rangle|^2 + \tfrac14|\langle[\hat{A},\hat{B}]\rangle|^2 \ge \tfrac14|\langle[\hat{A},\hat{B}]\rangle|^2 $$

Hence $\Delta A\Delta B \ge \tfrac12|\langle[\hat{A},\hat{B}]\rangle|$.

6.2 Ehrenfest Theorem

$\frac{d}{dt}\langle\hat{A}\rangle = \frac{d}{dt}\langle\psi|\hat{A}|\psi\rangle = \langle\dot\psi|\hat{A}|\psi\rangle + \langle\psi|\partial_t\hat{A}|\psi\rangle + \langle\psi|\hat{A}|\dot\psi\rangle$. With $|\dot\psi\rangle = -\frac{i}{\hbar}\hat{H}|\psi\rangle$:

$$ \frac{d\langle\hat{A}\rangle}{dt} = \frac{i}{\hbar}\langle[\hat{H},\hat{A}]\rangle + \left\langle\frac{\partial\hat{A}}{\partial t}\right\rangle $$

For $\hat{x},\hat{p}$ with $\hat{H}=\hat{p}^2/2m+V(\hat{x})$: $\frac{d\langle x\rangle}{dt}=\langle p\rangle/m$, $\frac{d\langle p\rangle}{dt}=-\langle V'(x)\rangle$ — Newton's laws for expectation values.

6.3 Ladder commutator

Using $[\hat{x},\hat{p}]=i\hbar$:

$$ [\hat{a},\hat{a}^\dagger]=\frac{m\omega}{2\hbar}\left[\hat{x}+\frac{i\hat{p}}{m\omega},\hat{x}-\frac{i\hat{p}}{m\omega}\right]=1 $$

7. Bra-Ket, Matrix Mechanics, and Operators

Any state expands as $|\psi\rangle = \sum_n c_n|n\rangle$, $c_n=\langle n|\psi\rangle$. Operator matrix elements $A_{mn}=\langle m|\hat{A}|n\rangle$.

Spin-½ basis $|\uparrow\rangle=[1,0]^T$, $|\downarrow\rangle=[0,1]^T$:

$$ \sigma_x=\begin{pmatrix}0&1\\1&0\end{pmatrix},\; \sigma_y=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\; \sigma_z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\; \hat{S}_i=\tfrac{\hbar}{2}\sigma_i $$

Rotation: $|\!+_{\mathbf{n}}\rangle = \cos\frac\theta2|\uparrow\rangle + e^{i\phi}\sin\frac\theta2|\downarrow\rangle$.

8. GNU Octave / MATLAB Examples

8.1 Particle in a box energies

% units: L=1nm, electron mass
hbar = 1.0545718e-34; m = 9.109e-31; L = 1e-9;
n = 1:5;
E = n.^2 * pi^2 * hbar^2 / (2*m*L^2) / 1.602e-19  % eV
disp(E);  % ~0.376, 1.50, 3.38, 6.02, 9.40 eV

8.2 Finite-difference TISE

N=1000; L=1; x=linspace(0,L,N)'; dx=x(2)-x(1);
V = 0*x;  % infinite well via BC
e = ones(N-2,1); H = (-hbar^2/(2*m*dx^2))*spdiags([e -2*e e],-1:1,N-2,N-2);
[V0,D] = eigs(H,5,'smallestabs'); E=diag(D);  % energies

8.3 HO wavefunctions via Hermite

x = linspace(-4,4,1000); xi = x;
for n=0:4
  Hn = hermiteH(n, xi);   % symbolic or custom recurrence
  psi = (pi^(-0.25)/sqrt(2^n*factorial(n))) * Hn .* exp(-xi.^2/2);
  plot(x, psi + n); hold on;
end

8.4 Split-step Fourier time evolution

% psi_t+dt = exp(-iVdt/2h) FFT^-1[ exp(-ih k^2 dt/2m) FFT[ exp(-iVdt/2h) psi ] ]
N=2^11; L=20; dx=L/N; x=(-N/2:N/2-1)*dx; k=2*pi/L*(-N/2:N/2-1);
dt=0.001; psi = exp(-(x+2).^2).*exp(1i*5*x); psi/=norm(psi);
V = 0.5*x.^2; % HO
for step=1:5000
  psi = exp(-1i*V*dt/2).*psi;
  psi = ifft( exp(-1i*hbar*k.^2*dt/(2*m)) .* fft(psi) );
  psi = exp(-1i*V*dt/2).*psi;
end

8.5 Tunneling coefficient

V0=1; a=1; m=1; hbar=1; E=linspace(0.01,2*V0,400);
kappa = sqrt(2*m*max(V0-E,0))/hbar; k2 = sqrt(2*m*abs(E-V0))/hbar;
T = 1./(1 + (V0^2 .* sinh(kappa*a).^2)./(4*E.*(V0-E+eps)));
T(E>V0) = 1./(1 + (V0^2 .* sin(k2(E>V0)*a).^2)./(4*E(E>V0).*(E(E>V0)-V0)));
plot(E,T); xlabel('E'); ylabel('T');

8.6 Expectation values & uncertainty

dx = x(2)-x(1);
rho = abs(psi).^2; rho/=sum(rho)*dx;
xmean = sum(x.*rho)*dx;
x2 = sum(x.^2.*rho)*dx; dx_std = sqrt(x2 - xmean^2);
p = -1i*hbar*gradient(psi,dx); pmean = sum(conj(psi).*p)*dx;
disp([dx_std, "check >= hbar/2"]);

9. Measurement and Interpretations

Copenhagen: wavefunction is epistemic; measurement causes irreversible projection. Many-Worlds: unitary evolution only; branching. Bohmian: particles have definite trajectories guided by $\psi$. QBism: $|\psi\rangle$ encodes agent's beliefs.

All reproduce Born rule $\,p = |\langle a|\psi\rangle|^2$. Decoherence explains rapid diagonalization of reduced density matrix via environment entanglement, without solving the measurement problem.

Study tip: Master the commutator algebra $[\hat{x},\hat{p}]=i\hbar$ and the spectral theorem for Hermitian operators — they underlie every derivation above.