Quantum Optics

Mach-Zehnder Interferometer

Simulate single-photon quantum optics in a Mach-Zehnder Interferometer. Adjust phase shift $\phi$ to control quantum interference between upper and lower arms and observe detector probabilities $P_1 = \sin^2(\phi/2)$ and $P_2 = \cos^2(\phi/2)$.

Phase Shift φ 0.0° (0.00π)
Detector D₁ Prob P₁ 0.0 %
Detector D₂ Prob P₂ 100.0 %

Phase Shifter Controls

Visual Overlay

Controls

Quantum State Transformation

Beam Splitter Matrix: BS = (1 / √2) · [[1, i], [i, 1]]
Phase Shifter: U(φ) = [[e^(iφ), 0], [0, 1]]
Output Probabilities: P(D₁) = sin²(φ / 2), P(D₂) = cos²(φ / 2)
Developer Reference

Core Algorithm & Standalone Script

// Mach-Zehnder quantum optics transfer matrix
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
// P1 = sin(phi / 2)^2, P2 = cos(phi / 2)^2