Reck and Clements Meshes
Digital logic has a universality theorem: every Boolean function from enough NAND gates. This
lesson is photonics' counterpart, and it is arguably the intellectual heart of the whole course:
every N \times N unitary matrix can be built, exactly, from a
mesh of N(N-1)/2 programmable
two-mode
MZIs plus a final row of phase shifters. Proved constructively by Reck,
Zeilinger and colleagues in 1994 with a triangular layout, and sharpened in 2016 by Clements and
co-workers into a rectangle of half the optical depth, the result turns "design me an optical
circuit for this matrix" from art into compilation: run an algorithm on the matrix, read
off the phase settings, done. When a photonic chip multiplies a vector by a trained neural-network
weight matrix, this decomposition is the compiler that put the weights into glass.
First, believe the count: parameters
Before any construction, check the budget. An N \times N
unitary has
N^2 independent real parameters (its 2N^2
real numbers, minus N^2 constraints from
U^\dagger U = I). Each MZI contributes two knobs
(\theta, \varphi); a closing column of N
output phase shifters — the diagonal matrix D — contributes
N more. Balance the books:
2 \cdot \frac{N(N-1)}{2} \;+\; N \;=\; N^2 - N + N \;=\; N^2 .
The budget closes exactly: not one knob spare, not one missing. This is more than a
plausibility check — it proves no scheme of two-mode gates can ever use fewer than
N(N-1)/2 of them, since fewer gates would mean fewer than
N^2 parameters. Both meshes below are therefore optimal in
component count; they differ only in how the same gates are arranged in space and time. For a
feel for the scale: N = 8 needs 28 MZIs; N = 64
needs 2,016; a 256-mode mesh already carries 32,640 interferometers — which is why the fabrication
and calibration lessons ahead are not optional reading.
The construction: Givens elimination with light
The engine of both schemes is a single move. Embed a 2×2 MZI unitary into
N dimensions as T_{m}(\theta,\varphi) — the
identity everywhere except a 2×2 block straddling adjacent modes
m, m{+}1 (waveguides can only couple to their neighbours). Right- or
left-multiplying
a matrix by T_m mixes only two columns or rows — and here is the move:
the two knobs can always be chosen so that one designated entry of the product becomes
zero. (Nulling |A|e^{i\alpha} against
|B|e^{i\beta} takes \varphi to align their
phases and \theta to cancel their magnitudes — precisely the two degrees
of freedom an MZI offers.) Then the recipe is Gaussian elimination's polite cousin:
U \; T_{m_1}^{-1} T_{m_2}^{-1} \cdots T_{m_K}^{-1} = D
\qquad\Longrightarrow\qquad
U = D\, T_{m_K} \cdots T_{m_2} T_{m_1}, \quad K = \tfrac{N(N-1)}{2} .
Null every entry below the diagonal, one per MZI; unitarity then forces everything above the
diagonal to die too, leaving a diagonal (pure-phase) remainder D.
Reading the factorisation right-to-left is the chip: light meets
T_{m_1} first, D last. Reck's scheme nulls
column by column using multiplications from one side, which stacks the MZIs into a triangle;
Clements' insight was to alternate eliminations from the left and the right, interleaving the same
K gates into a compact brick-wall rectangle. Same count, same exactness
— different geometry, and geometry, it turns out, is destiny.
Reck's triangle (1994)
The triangle is the direct transcription of one-sided elimination, and its flaw is visible at a
glance: the mesh is lopsided. Optical depth is 2N-3 columns,
and different input–output paths traverse anywhere from 1 to
2N-3 MZIs. Since every real MZI leaks a little — a few tenths of a dB of
insertion loss each — the matrix the hardware actually implements is the ideal unitary multiplied
by a lopsided loss pattern: entries routed through the triangle's long edge arrive systematically
dimmer than entries skimming its short one. For small meshes you can calibrate around it; for large
ones the imbalance grows with N and quietly corrupts the computation.
Clements' rectangle (2016)
Same ten gates, half the depth, and — the property that made this the default layout of essentially
every photonic processor since — balance: every path threads a nearly equal number
of MZIs, so the inevitable per-device loss factors out as a harmless global attenuation
instead of a matrix-warping gradient. Balanced depth also means less accumulated phase error on the
worst path and a shorter chip. The comparison in full:
| Reck triangle (1994) | Clements rectangle (2016) |
| MZI count | N(N-1)/2 | N(N-1)/2 (identical — provably minimal) |
| optical depth | 2N-3 columns | N columns |
| path balance | paths cross 1 to 2N-3 MZIs | all paths cross \approx N MZIs |
| effect of uniform loss | matrix-dependent distortion | a single global attenuation factor |
| sensitivity to fabrication error | worse (long-path accumulation) | better — the practical default |
| nulling style | one-sided eliminations | alternating left/right eliminations |
Worked example: compile a 3×3 unitary in your head
For N = 3 the budget demands 3 \cdot 2/2 = 3
MZIs and 3 output phases: 9 parameters for
U(3)'s 3^2 = 9. The Clements layout is three columns — an MZI on modes
(1,2), then one on (2,3), then one on (1,2) again:
U = D \; T_{12}(\theta_3,\varphi_3)\; T_{23}(\theta_2,\varphi_2)\;
T_{12}(\theta_1,\varphi_1).
Follow the elimination: the first gate's two knobs are tuned to null the entry
U_{31}'s partner in the working matrix; the second nulls the remaining
sub-diagonal entry in its reach; the third finishes the job; what survives is diagonal. Try the
same bookkeeping for N = 4 (you should get 6 MZIs in 4 columns, pattern
2–1–2–1) and you have internalised the whole scheme. One habit to build now: the decomposition is a
bijection between matrices and knob settings. Forwards it is a compiler; backwards — read
the phases off a working chip and reconstruct the matrix — it is a diagnostic, and the
calibration
lesson will run it in both directions.
A numerical analyst reading this lesson experiences deja vu, because the Reck–Clements engine is a
Givens rotation — the plane rotation that QR factorisation uses to zero matrix entries one
at a time, introduced by Wallace Givens in the 1950s for some of the first digital eigenvalue
computations. The mesh theorem is, with complete honesty, the observation that QR
factorisation can be poured into glass: each rotation becomes an interferometer, the
factorisation's ordering becomes the circuit's layout, and the triangular "R" collapses to a
diagonal because unitary matrices have unit-length columns. The correspondence is load-bearing in
both directions. Numerical linear algebra's sixty years of wisdom about elimination orderings,
pivoting and error growth translate directly into mesh design — Clements' improvement over Reck
is at bottom a smarter elimination ordering — and conversely, a photonic mesh is the only computer
on which a Givens QR of a 64×64 matrix "executes" in picoseconds, because it isn't executed at
all: it is installed, and the light does the rest.
Two reflexes from digital hardware mislead here, in opposite directions. First: "surely a bigger,
deeper mesh implements more matrices." No — universality is already exact at
N(N-1)/2 MZIs. Both layouts hit every point of the unitary group; a
deeper mesh buys precisely nothing in expressiveness and pays for it in loss, footprint and phase
error. (Redundant meshes are used in practice, but for error correction and yield — spare
knobs to steer around dead devices — never for reach.) Second, the opposite trap: "any mesh of
that size will do." Also no — the count is necessary but not sufficient. The layout must let the
elimination argument run: a mesh of N(N-1)/2 MZIs arranged so some mode
pair is never bridged leaves unreachable unitaries, parameter count notwithstanding. The theorem
is constructive or it is nothing: Reck and Clements are not "big piles of MZIs" but
specific orderings with a proof attached. When a later page says "a universal mesh", it always
means one of these two shapes (or a provably equivalent one).
Where this goes next
Universality has one glaring restriction: unitary. The matrices machine learning actually
wants — weight layers, convolutions, arbitrary rectangular maps — conserve nothing and are
anything but unitary. The
next
lesson removes the restriction with one of linear algebra's crown jewels: the singular
value decomposition, which writes any matrix as unitary × diagonal × unitary — two
Clements meshes with a row of attenuators between them. After that, the payoff: light performing
full matrix–vector multiplication, end to end.