How a lens computes a Fourier transform and a 4f system a convolution, in one pass of light: where the Fourier plane is, how the pattern scales with wavelength and why the light must be coherent; spatial light modulators, what a pixelated detector reads, and coherent (balanced) detection; on-chip slab lenses, butterfly meshes and convolution on a chip; a photonic link module's signal path and its slab lens; the precision and energy bill: ENOB, noise, passes, binary bit planes and the converters around the optics; what a transformer layer's linear algebra would ask of optics, and why a fixed band suits optics where top-k does not; and, to close, a warning not to confuse the chip's spatial transform with the fibre's bit stream. It opens with the optics vocabulary (plane wave, ray, wavefront, phase, spatial frequency, focal plane) for readers new to optics. Every concept has a figure, and every mechanism an animation driven by a tested model.
Free-space physics first, then the same ideas on a chip and in a real module, then the bills (precision and energy), what it is for, and a closing warning.
Concepts used here, and where they are explained. Each links to a glossary entry: this series glossary, or the glossaries of LLM Inference Simulators, FHE Accelerator Simulators and the Simulation Engineering Toolkit for concepts those series already explain.
A lens performs a two-dimensional Fourier transform on a light field as the light propagates through it. Every pixel of the transform is produced at once, by physics rather than by arithmetic, so the transform has no O(n log n) operation count, only the cost of getting data into and out of the light. On a chip the same physics works in one dimension: light spreading through a slab, or a fixed mesh of couplers, transforms the values on its input waveguides (slide 13). That asymmetry is the whole story of this series.
Where the cost sits. Every value pays a conversion on the way in and out; the transform in the middle is done by propagation. Slides 17–20 put numbers on the edges.
The rest of the deck leans on a dozen terms from optics. For an engineer, most have a signal-processing twin: light is a carrier, the field at a point is a complex number (a phasor), and a spatial frequency is a frequency across space instead of time.
Four pictures behind every later slide. (a) A wave and its wavelength, amplitude and phase. (b) A plane wave: flat wavefronts, parallel rays. (c) A lens turns a plane wave into one converging on its focal point, one focal length f behind it. (d) Waves add as fields: in phase they reinforce, half a cycle apart they cancel.
Where spatial frequency comes from (tiltRipple). A plane wave meets a plane (right) at angle θ. Its wavefronts cross the plane one wavelength apart along the ray, so along the plane the field ripples with period λ/sinθ: a spatial frequency u = sinθ/λ cycles per metre. Head-on (θ = 0) the field is the same everywhere: u = 0, the DC term. Turned round, this says any pattern on a plane is a sum of plane waves leaving at the angles its frequencies dictate: what a lens sorts in 04. Angles exaggerated.
| Term | What it means | Engineer's analogue, and where it is used |
|---|---|---|
| Optical field (E) | The light's oscillating electric field. These decks treat it, at each point, as a complex number: an amplitude and a phase. | A phasor, or a complex baseband sample. Used throughout. |
| Wavelength (λ) | The distance between neighbouring crests: about 0.5–0.7 µm for visible light, 1.55 µm on telecom fibre. | The period, in space. Sets the scale of the Fourier plane (07). |
| Phase | Where in its cycle the wave is at a point. One wavelength of travel advances the phase by 360° (2π). | Phase of a phasor. Lost by ordinary detectors (10). |
| Optical path length | Distance travelled times the refractive index n (how much the material slows light: about 1.5 in glass). Phase depends on it, so glass delays light as if the path were longer. | Delay. Path differences decide interference (04). |
| Wavefront | A surface joining points of equal phase, such as all the crests at one instant. | A line of constant phase in a sampled field. |
| Plane wave | A wave whose wavefronts are flat, parallel planes: it travels in one direction, with the same amplitude everywhere across the beam. | A single complex exponential, in space. Any field is a sum of them (the figure above). |
| Ray | A line at right angles to the wavefronts, showing the direction the light travels. A plane wave is a bundle of parallel rays. Ray drawings ignore diffraction, so they show where light goes, not how it interferes. | A direction vector. The coloured bundles in 04. |
| Collimated | A beam whose rays are parallel: a plane wave, or close to one. | Required input for the Fourier transform (07). |
| Spherical wave | Wavefronts that are spheres, spreading from a point or closing onto one. | What a lens makes of a plane wave (panel c). |
| Focal length (f), focal plane | Parallel rays along the axis meet at the focal point, f behind the lens. The focal plane is the plane through it, at right angles to the axis; tilted parallel rays meet in it too, off the axis. | The back focal plane is the Fourier plane (04). |
| Optical axis | The line through the centre of the lenses; heights and angles are measured from it. | Zero frequency lands on it (DC). |
| Spatial frequency (u) | How many cycles a pattern goes through per metre across a plane. A plane wave tilted by θ makes u = sinθ/λ (the animation). | Frequency, with metres for seconds. What the Fourier plane sorts. |
| Interference | Overlapping waves add as fields: in phase they reinforce (constructive), half a cycle apart they cancel (destructive) (panel d). | Adding phasors. How a lens computes each Fourier sum (04). |
| Diffraction | Light spreading as it passes fine structure: the finer the structure, the wider the angles. A pattern diffracts into plane waves, one angle per spatial frequency. | A pattern's spectrum, as directions (03). |
| Far field (Fraunhofer) | The diffraction pattern a long way from the input, where it is the input's Fourier transform. A lens brings the far field to its focal plane. | The spectrum (03). |
| Intensity | Power per unit area, proportional to |E|². What photodetectors and cameras measure. | |X|²: a power spectrum, with the phase gone (10). |
| Coherent light | Light of one wavelength and a steady phase relation across the beam (a laser), so its fields can interfere predictably. | A stable, single-frequency carrier (08). |
| Paraxial | Close to the axis, at small angles, where sinθ ≈ tanθ ≈ θ. The simple formulas (x = λfu) assume it. | A small-angle linearisation. |
Place a transparency with field U0(x, y) in the front focal plane of a thin lens of focal length f, and illuminate it with a coherent plane wave of wavelength λ. In the back focal plane the field is, in the paraxial (Fresnel) approximation:
Uf(u, v) = 1⁄iλf ∬ U0(x, y) · exp[−i 2π (xu + yv) / (λf)] dx dy
Left: the input field U0 (128 × 128 samples). Right: what a camera in the back focal plane sees, |Uf|² on a log scale, computed by a 2-D FFT of the left panel (centred: zero frequency on the axis). A square gives a sinc² cross, a circle the Airy rings, two slits fringes, a grating a row of spots. Small features spread far; large ones stay near the axis.
The relation is the standard result of scalar diffraction theory, derived in any Fourier-optics text; the review by Wetzstein et al. puts it in the context of optical inference (Nature 588, 2020).
Any input field is a sum of plane waves, one per spatial frequency u, each leaving at its own angle (sinθ = λu). A lens maps every direction to one point of its back focal plane, so each component lands on its own spot:
x = f tanθ ≈ λ f u
Paraxial ray transfer, traced by the model (trace4f): every ray of slope s reaches height f·s in the Fourier plane, whatever its starting height, and leaves the output at height −y0. Five components (u = −2u0 … 2u0); angles exaggerated for visibility. Each colour is one plane-wave component, a bundle of parallel rays from the whole input, not a single input point.
Light from every input point reaches every point of the Fourier plane. The paths are millions of wavelengths long; only their differences, as fractions of a wavelength, matter, because they set the phase each contribution arrives with.
Twelve input points with amplitude 1 + cos(2π·2y/D), a ripple of two cycles across the input (bars), and one Fourier-plane point stepped from the axis outwards. Each dial is that point's extra path from the input point, one turn per wavelength; each arrow is that point's contribution, its length the amplitude and its angle the phase. The sum (dashed) is DFT bin k of the input, checked in the tests (pathPhasors): 12 at DC, 6 at 2u0, 0 elsewhere.
Input one focal length in front of the lens, read one focal length behind it. That back focal plane holds the far-field (Fraunhofer) pattern: the Fourier transform of the input. Put a camera there to read the spectrum, or a mask to filter it.
A second lens transforms again. Two forward transforms return the input mirrored (y → −y), multiplied by whatever the mask did in between: a filtered image. That is the convolver of slide 05.
The four planes, each computed: lens 1 = a forward 2-D FFT; the mask multiplies; lens 2 = a second forward FFT, so the output comes back mirrored (look at the shapes' positions). With the mask open the output equals the mirrored input to rounding, a check browser_check runs.
Learned 4f layers have been demonstrated for image classification, with an optimised diffractive element as the mask (Chang et al., Sci. Rep. 8, 2018), and an amplitude-only Fourier-plane processor runs convolutions on about 1,000×1,000 matrices (Miscuglio et al., arXiv:2008.05853; Optica 2020).
The digital twin of a 4f system: transform, multiply by the filter's spectrum, transform back. Compare it with a direct convolution, turn padding off to see the circular wrap, and add an ADC of a chosen ENOB at the output (noise of rms q/√12 with q = 2·peak/2ENOB, the definition of ENOB) to see the analogue error against the rule of slide 17.
The same checks, in NumPy, are in analysis/flop_share.py: padded FFT convolution against direct, 5.6e-16 of the peak; unpadded, 0.72.
Because spatial frequency u lands at x = λ f u, the same input gives a pattern whose size scales with wavelength. One wavelength gives one sharp pattern; several give differently scaled copies that smear into each other, worst at high frequencies.
An amplitude grating (period p = 20 µm, 64 periods) behind a lens of f = 100 mm: intensity across the back focal plane, log scale, from the grating's FFT read at u = x/(λf) (intensityAt). The first order sits at x1 = λf/p. Three wavelengths (450, 532 and 633 nm) make three patterns whose orders separate further at each order. Grating and lens are illustrative.
One wavelength (a narrow-linewidth laser), so every frequency lands in one place. Broadband light blurs the spectrum radially.
A collimated beam (a single plane wave in) so the input's own structure, not the source's, sets the pattern. An extended source convolves the spectrum with its own angular spread.
Still convolves, but intensities, with the intensity point-spread function: a real, non-negative kernel and no field Fourier transform (slide 08).
Two equal beams, relative phase φ stepped round a full cycle (twoBeam). Coherent: the fields add as arrows, and the intensity |1 + eiφ|² swings from 4 to 0: signed values can cancel. Incoherent: intensities add, always 2.
Data enters a free-space system through a spatial light modulator (SLM): a pixel array that writes amplitude or phase into the beam. One sits at the input plane; another can hold the Fourier-plane mask.
Pixels × rate is the throughput either way. Free space: millions of slow pixels. On chip: a few fast channels. Rates as in the table below (Miscuglio et al.; Feldmann et al.).
| Device | Writes | Update rate | Notes |
|---|---|---|---|
| Liquid-crystal SLM (e.g. LCoS) | Phase (or amplitude), many grey levels | Settles in tens of milliseconds (“tens of Hz” in Miscuglio et al.'s comparison) | High pixel counts; the usual choice for phase masks |
| Digital micromirror device (DMD) | Amplitude (on/off mirrors; grey levels by time-multiplexing) | 2 million mirrors at 1,031 Hz with 8-bit depth, about 20 kHz binary, in Miscuglio et al.'s processor | At least two orders of magnitude faster than liquid crystal at the same resolution, per the same paper |
| Integrated modulators (on chip) | Amplitude or phase per waveguide | GHz: Feldmann et al. report operation above 14 GHz, limited by modulators and detectors | Demonstrations have few channels, not millions of pixels |
Photodetectors are square-law: they measure intensity |E|2, not the field E. A coherent 4f system, or an on-chip transform, computes a signed or complex field, and the detector throws away its sign and phase. Four remedies:
Top: a signed field E across the detector (solid) and a different field, −E (dashed). Bottom: what square-law pixels read, |E|²: identical for both. Sign and phase are gone before the ADC sees anything.
| Remedy | How | Cost |
|---|---|---|
| Coherent (homodyne) detection | Interfere the output with a reference beam; the cross term is linear in E | A phase-stable reference, extra optics or balanced detectors |
| Bias | Add a constant so the field stays positive, take √intensity, subtract | Dynamic range: the bias uses ADC codes |
| Split passes | Run positive and negative parts separately and subtract digitally | Twice the passes and conversions |
| Phase retrieval | Recover phase from intensity-only measurements iteratively | Many iterations; not exact in general |
A pixelated input (an SLM, or one modulator per waveguide) and a pixelated detector turn the lens's continuous transform into, approximately, a discrete Fourier transform: N input pixels, N output samples, each sample the DFT bin times a gentle sinc envelope from the pixel shape.
Top: 16 input pixel values. Bottom: |F(u)|² of the pixel row as a continuous curve (pixelFT), and the 16 detector pixels sampling it at u = k/16 (dots): sinc(k/16) × DFT bin k, checked against the DFT in the tests.
Coherent (balanced) detection, bin by bin, of a signed 8-pixel input (balanced). A 50:50 coupler mixes the signal E with a local oscillator (LO) of the same laser; the two photodiodes read |E + LO|²/2 and |E − LO|²/2; their difference is 2·Re(E·LO*), linear in E. LO at 0° reads the real part, at 90° the imaginary part. A camera reads only |E|² (grey bars).
Go deeper → FOptInf 04, slide 08 (the balanced pair and the LO in a real receiver) and slide 10 (the DFT alphabet a four-port transform produces from bits).
A free-space 4f system is large and slow to reconfigure. On a chip there are three ways to compute a Fourier transform or a linear transform:
Schematics, not layouts. Left: a rectangular (Clements) grid of 2×2 interferometers, each with a phase shifter (dot). Middle: waveguides feed a slab with diffractive layers. Right: a butterfly of couplers with delay lines between stages. Slide 13 animates the two that compute an exact or sampled DFT. ★ The photonic link module of slide 15 uses the middle kind, in its plainest form: an unpatterned slab whose shape makes it a lens (slide 16).
| Approach | What it computes | Scale and limits | Example |
|---|---|---|---|
| MZI meshes | Any N×N unitary, the DFT included, as a grid of Mach–Zehnder interferometers | N(N−1)/2 MZIs, each with a calibrated phase shifter; loss and error grow with N | Reck et al. (PRL 1994); Clements et al. (arXiv:1603.08788); Shen et al.'s coherent nanophotonic network (arXiv:1610.02365) |
| On-chip diffraction | Diffractive layers in a silicon slab: a passive, learned linear transform (an on-chip lens is the Fourier special case) | Passive and compact (0.15–0.3 mm2 footprints in the example); fixed once fabricated | Fu et al. (Nat. Commun. 14, 2023) |
| Coupler and delay FFT circuits | The FFT butterfly network built from couplers and delay lines | Fixed transform at very high line rate, used for optical OFDM | Hillerkuss et al., 26 Tbit/s with an all-optical FFT (Nat. Photon. 5, 2011) |
Two families compute a Fourier transform on a chip. Both are 1-D, both take their data from a modulator per waveguide (not an illuminated picture), and both are read by a detector per output.
Both panels transform the same 8 modulated inputs. (a) Slab: the field on the output arc is the continuous transform (slabField, curve); output waveguides sample it (dots), giving the DFT. (b) Mesh: bit-reversed wiring, then log28 = 3 layers of N/2 = 4 butterflies (fftStages); bar height = |value| on each waveguide. Both final outputs equal the DFT (checked).
| (a) Diffractive or slab “on-chip lens” | (b) Interferometer mesh as FFT butterflies | |
|---|---|---|
| Physics | Free diffraction across a planar waveguide region | 2×2 couplers and fixed phase shifters wired as radix-2 (or radix-4) butterflies |
| Computes | A continuous transform, sampled by the output waveguides: approximately a DFT | An exact N-point DFT, by construction |
| Errors | Aberration, sampling, crosstalk between outputs | Coupler ratio and phase errors that compound over log2N layers |
The 4f convolver works on a chip too, by the same theorem: transform, multiply, transform back. The difference is the mask. In free space it is a transparency in the Fourier plane, free once made. On a chip it becomes a row of elements on the waveguides between two transforms.
Eight inputs, a smoothing filter h = (¼, ½, ¼), two slabs (chipConv, tested against a direct cyclic convolution). As in 4f, the second transform is a forward one, so the output is mirrored; on a chip the fix is just wiring the output ports in reverse order.
| What sits between the transforms | What it gives | Cost |
|---|---|---|
| Fixed attenuators and phase shifters, set once | A fixed filter: the chip version of a 4f mask | Passive once set; thermal phase shifters draw holding power and need calibration |
| Modulators, driven per value | A filter that changes with the data or holds learned weights | A conversion per value, as on the input side (slide 22) |
| Nothing: detect, multiply in electronics, send back | Any filter | Two passes and a conversion each way between them |
A photonic link module (arXiv:2608.21536, Kundu et al., “Programmable Compute-in-Transit using Integrated Photonics”) puts an optical Fourier transform inside a pluggable network module, between a host card and the fibre. Its signal path:
Each step highlights one stage and what the paper says about it. Tags: paper arXiv:2608.21536 (full text); website the developer's website; derived arithmetic shown here; inference this deck's reading, not stated in the paper.
| Item | What is reported | Source |
|---|---|---|
| Host and port | A QSFP56 port connects the module to a host Alveo V80 FPGA card | paper |
| Input | Four Mach–Zehnder modulator (MZM) channels; “The transmitted data to the module is restricted to binary (NRZ) levels.” | paper |
| Transform | “a proprietary passive diffractive device that computes Optical Fourier Transform (OFT)” | paper |
| Detection | Balanced photodiodes: coherent detection | paper |
| Rates | Process-design-kit devices at 14 GBaud; drivers and TIAs up to 56 GBaud | paper |
| Power | 9.7 W for the module | paper |
| Operations | “1xN FFT with Radix-4 decimation, 1 x N NTT with Radix-4 decimation, Addition & Subtraction, Multiplication, MAC, Modular Addition & Subtraction, Modular Multiplication, Modular MAC, Modular Multiplication & Subtraction (MSUB), Floating Point MAC.” No comparisons, rounding or top-k (slide 23). | paper |
| Digital side | Modular arithmetic in the FPGA driver IP (“prototype modular arithmetic logic”), and a “proprietary Error Correction IP” | paper |
| FHE run | 65,536-point NTTs “decomposed into 256-point transforms and then further distributed across the four optical channels using a radix-4 decomposition” | paper |
| Headline | “enabling tens of GFLOPs of operations on data links”: in the abstract only, with no breakdown | abstract |
| Projections | “Estimated 2.76 pJ/bit link energy on 45nm silicon photonics, excluding laser”; “Native 384 GOPS / lambda @ 32GSps (GF45nm)” | website |
| Into the optics | 4 channels × 14 GBaud × 1 bit per NRZ symbol = 56 Gb/s = 7 GB/s, below the QSFP56 port's rate | derived |
| Not reported | Precision, ENOB, latency, energy per operation, measured throughput | paper |
The paper's description of its FHE run, drawn. That 256 = 44 (four radix-4 stages) is arithmetic; how the stages map onto the four channels is not described in the paper.
Go deeper → FOptInf 04, slide 09: the module's hardware, its modulators, bias points, coherent receivers and TIAs, with one input followed through the whole chain as constellations.
The Compute in Transit series asks which LLM training and inference traffic such a module could work on, with its operations-per-byte budget (CiT 01) and a fixed-band training experiment (CiT 04).
Of the three on-chip routes, the photonic link module (arXiv:2608.21536, slide 15) uses the diffractive slab. Not a learned, patterned slab like Fu et al.'s, but its plainest form: an open slab whose two curved edges make it a lens, the 2f system of slide 04 drawn on a chip.
| What it says | Source |
|---|---|
| The chip holds “a proprietary passive diffractive device that computes Optical Fourier Transform (OFT)”, cited to a patent among others. | paper |
| That patent, EP4677399A1 “Optical Fourier transform device” (Google Patents), describes “a Fourier Transform slab waveguide where the light is constrained in one (cartesian) dimension (z) and diffracts freely in the other two dimensions (x and y)”. | patent |
| Geometry: “the input and output arrays arranged on the arc of a different circle, on which lies the centre of the other circle”; the port spacing is chosen “so that the output ports sample a single order of the Fourier transform”; for an FFT, “the number of output ports used to extract data must be the same as the number of input ports”. | patent |
| The patent's own contribution: a “stray light region” round the slab, which redirects or absorbs (“light sink”) light that misses the output ports, so it cannot scatter back into them. | patent |
Four modulated inputs, four outputs, as on the module (geometry schematic, not to scale). Each input's wave crosses the slab and reaches the output arc tilted by an amount set by where the input sits, so it adds a phase that steps by a fixed amount from output to output (dials). Each output adds up the dials it receives (slabPorts, tested against the DFT). With four ports the steps are quarter turns, so the only weights are 1, −j, −1 and j.
paper The light routing round the slab, as the paper describes it. A laser feeds seven channels. Four go through the Mach–Zehnder modulators (MZM) and thermo-optic phase shifters (PS) into the slab. One becomes the reference (local oscillator, LO): a slow MZI sets its phase and level, it splits four ways, and each copy beats against one slab output on a balanced photodiode pair. Two feed monitors: mixed with taps from the modulators, read slowly by a microcontroller that sets the phase shifters (dashed loop). The paper's word for the whole is “phase balanced”.
The effective number of bits (ENOB) of an analogue chain is defined from its signal-to-noise-and-distortion ratio, SINAD = 6.02·ENOB + 1.76 dB for a full-scale sine (Walden's ADC survey, IEEE JSAC 1999). It lumps every error source into one number: shot and thermal noise, laser intensity noise, crosstalk between pixels, aberrations, modulator non-linearity, and the converters' own quantisation.
For floating-point workloads the requirement is a noise level, not exactness. With the ADC's full scale set to the output's peak, the relative RMS error is crest × 2−ENOB × 2/√12, where the crest factor is the output's peak-to-RMS ratio. Measured on a causal FFT convolution:
| Length | Crest | ENOB 4 | ENOB 6 | ENOB 8 | ENOB 10 | ENOB 12 | ENOB 14 | Rule at ENOB 8 |
|---|---|---|---|---|---|---|---|---|
| 256 | 2.97 | 1.1e-01 | 2.7e-02 | 6.7e-03 | 1.4e-03 | 4.1e-04 | 1.0e-04 | 6.7e-03 |
| 4,096 | 3.64 | 1.3e-01 | 3.3e-02 | 8.3e-03 | 2.1e-03 | 5.1e-04 | 1.3e-04 | 8.2e-03 |
| 65,536 | 4.43 | 1.6e-01 | 4.0e-02 | 1.0e-02 | 2.5e-03 | 6.2e-04 | 1.6e-04 | 1.0e-02 |
Source: results.md, section “6. Analogue precision”
The table above, drawn (read from the table on this slide, which is built from results.md): each 2 bits of ENOB cut the error 4×; longer convolutions sit slightly higher because of their crest factor.
How many bits does inference need, and how do you buy more than the hardware has? The format's own rounding error sets the target (same metric, length 4,096):
| Format | Rounding error (relative RMS) | ENOB to match | Averaged passes at ENOB 8 |
|---|---|---|---|
| BF16 | 1.6e-03 | 10.3 | 26 |
| FP8 E4M3 | 2.6e-02 | 6.3 | 1 |
| INT8 | 8.3e-03 | 8.0 | 1 |
Source: results.md, section “6. Analogue precision”
Two ways to buy precision at ENOB 8:
| Length | 1 pass | 4 passes averaged | 16 passes averaged | 2 digit planes of 8 bits |
|---|---|---|---|---|
| 256 | 6.7e-03 | 3.3e-03 | 1.5e-03 | 6.7e-03 |
| 4,096 | 8.3e-03 | 4.2e-03 | 2.1e-03 | 8.1e-03 |
| 65,536 | 1.0e-02 | 5.0e-03 | 2.5e-03 | 9.9e-03 |
Source: results.md, section “6. Analogue precision”
Left: ENOB to match each format (first table), against the 8 effective bits this series assumes for the analogue chain (illustrative). Right: error at ENOB 8 for length 4,096 (second table): averaging moves it, digit planes do not. A simulator of a stacked photonic chip later found far fewer: with the transform modelled as the passive slab it is, 2.746 effective bits for one optical stage and 1.872 for six chained stages, with 8-bit converters (deck 05).
A link module that accepts only binary (NRZ) input (slide 15) must feed a multi-bit value as bit planes: plane b holds bit b of every value, each plane goes through the same transform, and the outputs are recombined with weights 2b. Linearity makes that exact: T(x) = Σb 2b T(xb).
Eight 8-bit inputs, a known integer transform (cyclic convolution with kernel h = [3, 1, 4, 1, 5, 9, 2, 6], which a 4f system, a pair of on-chip transforms with modulators between them, or an FFT computes), and Gaussian readout noise σ per plane (bitPlaneRun). Each plane's outputs are integers from 0 to Σh = 31, so rounding them needs only about 5 bits of clean readout, while the full result spans 13 bits. As σ grows towards a quarter of an output unit, rounding starts to fail and the recombined result is wrong; the panel counts the wrong outputs.
With binary input and a known transform, each plane's output only needs reading accurately enough to round. Add error correction and modular arithmetic in the FPGA, and that is a plausible way an exact NTT can run on analogue optics. This is the deck's reading of the published parts list, not a description from the paper. It also shows why the same trick does not help floats (slide 18): there the result is not an integer to round to.
Energy per sample ≈ Walden FoM × 2ENOB: each extra bit doubles it. With the illustrative FoMs of FHESim 04 (DAC 10 fJ, ADC 20 fJ per conversion step):
| ENOB | DAC pJ | ADC pJ | Pair pJ |
|---|---|---|---|
| 4 | 0.16 | 0.32 | 0.48 |
| 6 | 0.64 | 1.28 | 1.92 |
| 8 | 2.56 | 5.12 | 7.68 |
| 10 | 10.24 | 20.48 | 30.72 |
| 12 | 40.96 | 81.92 | 122.88 |
| 14 | 163.84 | 327.68 | 491.52 |
| 16 | 655.36 | 1,310.72 | 1,966.08 |
Source: results.md, section “7. Conversion energy”
The pair column above, drawn: each bit doubles it.
The costs side is heavier unless each converted value is reused by many operations and the engine is kept busy. The two builds trade differently: free space is wide but slow to change; a chip is fast but narrow and fixed.
| Property | Free-space 4f engine | On-chip, as in the link module (15) | What it means for a workload |
|---|---|---|---|
| Transform cost | Time of flight; no operation count | Time of flight too (picoseconds across the chip); the size is fixed by the waveguides, larger transforms by decomposition (the module's FHE run: 256-point pieces) | Long transforms are as cheap as short ones, once the data is in; on a chip, only up to the device's size per pass |
| Parallelism and rate | Millions of pixels; many 1-D transforms per frame, frames at the SLM's rate | Tens to hundreds of waveguides, 1-D; a new vector per modulator symbol (14 GBaud, four channels in the module); WDM could multiply it | Free space wants batches of independent transforms; a chip wants a fast stream of small ones, such as data passing through a link |
| Precision | Analogue; this series assumes about 8 effective bits (illustrative). A simulator of a stacked photonic chip finds about 3 in its approximate mode (deck 05) | Analogue; not reported for the module, which takes binary (NRZ) input and adds error correction (bit planes, 19) | Fine for FP8/INT8-like error, short of BF16 without averaging; exact integer arithmetic only for small blocks or by bit planes |
| Conversions | One DAC sample in and one ADC sample out per value, energy ∝ 2ENOB | A modulator symbol in and a detector read-out per value; binary input needs only 1-bit drivers, but one pass per bit plane | Needs many operations per converted value to pay |
| Weights | On the Fourier-plane mask, rewritten at the SLM's frame rate | A passive diffractive device is fixed when it is made: one transform, no mask; a fixed band means reading only some outputs (23). Learned weights need a programmable mesh or the digital side | Free space wants weights held across a batch (prefill, not decode); a passive chip suits a transform that never changes |
| Signs and phase | Lost at a square-law detector unless detected coherently | Balanced photodiodes: coherent detection, built in | Coherent detection, or twice the passes |
| Static power | Lasers, tuning, drivers | Laser, modulator drivers, detectors and TIAs: 9.7 W for the module (the host FPGA card is extra) | Must be kept busy |
| Size | A bench of lenses, SLM and camera, kept aligned | Fits a QSFP56 pluggable, in the data path | Only the chip sits where the data already flows |
For Compute in Transit the on-chip column is the one that matters: its transform is fixed and fast, so it suits operations that never change, such as a fixed frequency band, and not data-dependent choices or learned weights. The sister series applied the same accounting to FHE, where exact modular arithmetic made the precision tax severe (FHESim 04, “When It Wins and When It Loses”). Deck 02 applies it to LLM inference.
Fourier optics computes one fixed linear map, the Fourier transform, whether it is built as a lens in free space or as a passive transform device on a chip (the link module's, 15). A free-space 4f system adds one pointwise multiply, a mask in the Fourier plane; on a chip that multiply needs a row of modulators between a transform and an inverse transform (slide 14), or else it happens after detection, in electronics. A transformer layer needs something else: learned weight matrices, products of two data streams, and nonlinear steps between them. Follow one layer through, step by step, and see which steps light could take.
Each step is tagged by what optics could do with it: FT a transform or convolution (Fourier optics: a lens or an on-chip transform; for a convolution, 4f + mask, or transform, modulators, inverse transform on a chip), MM a matrix multiply by learned weights or by other data (needs a programmable matmul, which is not Fourier optics), NL nonlinear or data × data (must leave the optics). Every crossing between light and electronics is a DAC or ADC per value. Consecutive optical steps are assumed to stay in light, which is optimistic. The sequence is computed by opticalPlan and checked by a node test. Untick the box: a standard decoder then has nothing for optics to do at all.
Left: a circulant matrix (every row a shift of one vector) is exactly what a transform, a pointwise multiply and an inverse transform apply: a 4f system with a mask, or on a chip two transform devices with a row of modulators between them; the check computes Wx both ways (circulant, circApplyFFT). Right: a general learned matrix needs a programmable mesh: two unitary meshes of N(N−1)/2 Mach–Zehnder interferometers and N attenuators, N² settings in all (Reck/Clements; mziCount).
Transform, pointwise multiply, inverse transform (4f + mask in free space; two transforms with modulators between them on a chip) multiplies by a circulant matrix, so it helps only if the weights are circulant. With block-circulant weights the transform work is 13.99% of prefill FLOPs at 2,048 tokens, or 84.54% (Amdahl bound 6.469x) with the LM head on the last token only. That is speculative: no published LLM uses such weights (deck 02, “Structured Weights: Circulant and Monarch”).
The mask is the weights: 269 mask rewrites per Hyena-2 forward pass at 2,048 tokens take 261 ms on an 8-bit micromirror device (1.03 kHz), against 59.033 ms for a GPU's whole prefill (deck 02, “Holding the Weights: Fourier-Plane Mask Capacity”). On a chip the frame-rate limit goes: the filter values are driven onto modulators at the electrical clock. But each one is another DAC sample per value per pass, and a chip offers tens to hundreds of channels, not millions of pixels. A passive transform device, like the link module's, has no place for the multiply in the light at all; the paper does not say how its multiply and MAC operations map onto the optics.
FNet and Hyena put a real transform in the layer, but it is what makes them cheap, so it is a small share: 0.09% of prefill FLOPs for FNet-shaped mixing and 0.20% for Hyena-2 (Amdahl bound 1.002x) at 2,048 tokens. The projections and the MLP are the rest (deck 02, “The Amdahl Analysis: Prefill FLOP Shares”).
Programmable MZI meshes apply a weight matrix through its SVD (Shen et al., arXiv:1610.02365); wavelength-multiplexed crossbars hold the weights in phase-change cells (Feldmann et al., arXiv:2002.00281). They pay the same bills: a conversion per value, analogue precision, and weight reloads. With this series' illustrative converter figures, conversions break even with digital FFT work at about ENOB 12.0 (deck 02, “Precision and Energy per Token”).
Softmax, LayerNorm or RMSNorm, the activations and the data × data gates cannot be done by a fixed linear optical system. Each one forces a trip out of the light and back, so a layer pays conversions both ways several times (the animation counts them), and every conversion is a DAC or ADC sample the optics must win back (slide 20).
The photonic link module of slide 15 lists MAC and floating-point MAC among its operations, alongside the FFT and NTT. Its future-work section projects “45 GFLOPS of FP4 (E2M1) MAC … on a 112 GBaud/s photonic transceiver link for an additional 1 pJ/bit” (arXiv:2608.21536). That is a projection for a future chip, not a measurement, and it is MAC only.
It joins this deck's optics to the question the Compute in Transit series asks: could a link module like 15's compress data while the data crosses it, for free?
Successive 64-sample chunks of a smooth random signal (chunk), their bin energies, and two ways to keep k = 4 bins: the fixed low band (shaded: the same aperture every time) and top-k (orange: wherever the energy is). Top-k captures at least as much energy on every chunk (checked), but finding it needs every bin detected and compared.
The module holds light in two different roles. Inside the chip the transform happens across space: a pattern over waveguides at one instant. On the fibre the data travels in time: one bit after another, NRZ.
“Fourier transform” and “spectrum” mean different things in the two domains. In the chip, the transform is of the data, taken across the waveguides. On the fibre, the spectrum is of the bit stream in time, and says nothing about the data's frequencies. So a band of the data cannot be picked out by filtering the light on the fibre: it has to be chosen in the chip, or at the source, before the bits are serialised.
A 256-bit NRZ stream (16 samples a bit) with a brick-wall mask applied to its spectrum, the cut-off stepped down from 2× to 0.3× the bit rate (lowpass, eye). Left: the first 24 bits. Middle: the eye (every 2-bit window overlaid). Right: the spectrum and the mask. Below the bit rate, inter-symbol interference closes the eye and decisions at the centre start to fail.
Filtering the line signal does not filter the data: it smears neighbouring bits into each other (inter-symbol interference). One flipped exponent bit wrecks a float: 1.0 becomes …
A single-mode fibre carries one spatial mode, so a Fourier-plane pattern cannot be sent down it. The transform's output must be detected and re-serialised first.
Filtering in transit does not free link time: the bits still cross the wire. The saving comes from sending fewer samples at the source (Nyquist): transform, keep the band, then transmit.
McMahon's review of optical computing argues that the speed of light is not what gives optics an advantage; any advantage comes from combining several of optics' features (parallelism, passive linear operations, low-loss data movement) while avoiding the pitfalls of conversion and precision (arXiv:2308.00088). The sister series makes the same point about power (LLM Inference Simulators 07, “Power in Photonic and Novel Compute”).