Controls
Presets
Parameters
Quality
Camera
Model checks
The science
The device. A Mach-Zehnder interferometer (MZI) is two 50:50 couplers with a phase shifter θ between them and a second phase φ on one input. Its 2×2 transfer matrix is T = i eiθ/2 [[eiφ sin(θ/2), cos(θ/2)], [eiφ cos(θ/2), -sin(θ/2)]]: θ = π passes light straight through (bar), θ = 0 swaps the two waveguides (cross), θ = π/2 splits 50:50. Six MZIs in a rectangular (Clements) layout form a programmable 4×4 unitary U; any 4-mode lossless linear optical circuit can be written this way.
One photon. Entering port p, the photon leaves port j with probability |Ujp|²; the glow along the waveguides shows the amplitude squared after each layer and the detectors sample that distribution. Two photons (ports p and p+1) are bosons: P(1j 1k) = |UjpUkq + UjqUkp|² and P(2j) = 2|UjpUjq|². On a balanced coupler the coincidence term cancels (Hong-Ou-Mandel dip): both photons leave together.
Programming. The "optimised" presets are found by a deterministic hill-climbing search over the 12 phases for a target output distribution; this is how real meshes are configured (calibrated phases, optimisation or exact decomposition).
Simplifications. The circuit is lossless, perfectly balanced and noiseless, with ideal single-photon sources and detectors, and the two photons are indistinguishable. Real devices have waveguide loss, coupler imbalance, thermo-optic crosstalk and imperfect photon indistinguishability. Checks: unitarity, the closed-form MZI against its component product, layer-by-layer propagation against the matrix product, two-photon normalisation and marginals, the HOM dip, a Monte-Carlo detection test and the splitter optimisation.