Reading Loudon to improve a router: nine experiments, one ship
I read Rodney Loudon's The Quantum Theory of Light end-to-end to mine
ideas for two projects — photon-route (CV photonic retrieval) and meridian
(the orbital task router behind mcp.ask-meridian.uk). Ten experiments
grounded in chapters 3, 5, 6, and 9. Eight came back negative or decorative.
One — a g(1) coherence-time feature — shipped to
production in meridian-orbital@3.1.0 with 2× the discrimination of
the proxy it replaced. Here's the honest accounting, with every number.
The plan: ten Loudon-grounded experiments
The hypothesis was simple enough. Both projects already used quantum-optics vocabulary — meridian's classifier names a candidate's "physics signature" after orbital and optical scalars; photon-route literally encodes text into a Strawberry Fields program. The question: would Loudon's actual physics — the math behind coherence functions, photon-number distributions, parametric down-conversion — translate into measurable retrieval / classification gains?
I drafted ten items split across two tracks (A = photon-route's CV photonic retrieval; B = meridian's orbital classifier):
| Item | Loudon section | Hypothesis |
|---|---|---|
| A1 | Ch 5.3 | Train per-word photonic params (replacing SHA-init) |
| A2 | Ch 6.4 | Add g(2)(0) photon bunching as a ranking feature |
| A3-Simple | Ch 6.10 | Score by photon-number distribution (direct-detection metric) instead of Gaussian fidelity |
| A3-Real | Ch 9.4 + 6.10 | PNR-conditioned non-Gaussian heralded states (escape Gaussian-classical equivalence) |
| A4 | — | Build real eval set (20 arxiv quant-ph + held-out splits) |
| squeezing ablation | Ch 5.4 | Test whether the squeezing layer specifically pays |
| B1 | Ch 3.1 | Replace 3-bin entropy with g(1) coherence time τc |
| B2 | Ch 6.4 | g(2)(0) classifier reframe (planet/comet/asteroid) |
| B3 | — | Promote optical features into the SGD feature vector |
| B4 | Ch 6.8 | HOM-dip indistinguishability for parent-child detection |
Each item had a specific quantitative test before any code change. Most also had a self-contained simulation grounding it before commit. The discipline mattered more than I expected — every "obvious" idea that felt like it should work either matched the math (rare) or broke against it (common).
The negatives — what didn't work and why
The Dgate-only path is mathematically a Gaussian RBF kernel
Loudon eq 5.3.4 — the squared inner product of two coherent states:
Or equivalently: the Gaussian-state fidelity between two displaced vacua reduces
to exp(-‖Δμ‖² / (2ℏ)). A simulation against thewalrus.quantum.fidelity
confirmed it to 6 decimal places on a 2D (Δq, Δp) grid. The
consequence: without trained squeezing, photon-route's encoder is
mathematically equivalent to an RBF kernel on its learned word-displacement
vectors. It's a Word2Vec-shaped retrieval system in expensive clothing.
Squeezing was decorative
Five-split sweep, paired (full − no_squeeze) test nDCG@10:
| Seed | Full | No-squeeze | Δ |
|---|---|---|---|
| 1 | 0.908 | 0.908 | +0.000 |
| 2 | 0.572 | 0.750 | −0.178 |
| 3 | 1.000 | 0.908 | +0.092 |
| 4 | 0.783 | 0.733 | +0.050 |
| 5 | 0.687 | 0.589 | +0.098 |
| mean | 0.790 ± 0.170 | 0.778 ± 0.130 | +0.013 ± 0.114 |
The mean diff is well within noise. Worse: the no-squeeze model has half the trainable photonic params and a 2.5× smaller train-test gap (0.06 vs 0.15) at equal test performance. By Occam, no-squeeze is strictly better. The "photonic" part of photon-route earns its name only in the metaphor.
Photon-number metric is strictly less information than Gaussian fidelity
A3-Simple replaced Gaussian-state fidelity with a Bhattacharyya coefficient over
the joint photon-number distribution P(n₀, n₁) the state induces —
"what direct detection actually sees." Same trained encoder, both metrics evaluated
head-to-head on the held-out queries:
| Encoder | Gaussian fidelity | Photon-number BC | Δ |
|---|---|---|---|
| full (squeezing on) | 0.790 | 0.589 | −0.201 ± 0.246 |
| no-squeeze | 0.777 | 0.477 | −0.301 ± 0.182 |
Photon-number distribution is a marginal of (μ, σ) — strictly less
information. So for a Gaussian-state encoder, the marginal-aware metric loses
by 25–40%. The metric isn't the bottleneck. The encoder is.
Non-Gaussian heralded states didn't survive the eval scale either
A3-Real was the last serious shot at "photon-route's photonic structure pays." Architecture: 2-mode (signal + ancilla) cutoff-D Fock-basis encoder, a learned two-mode-squeezing gate entangling them, ancilla projected onto |1⟩ to herald a non-Gaussian state on the signal mode. With herald=1 the heralded state has Wigner-negative regions — the Gaussian-classical-simulability barrier is genuinely crossed. Same five-split sweep:
| Architecture | Test nDCG@10 |
|---|---|
| non-Gaussian (herald = 1) | 0.574 ± 0.235 |
| Gaussian (herald = 0, ablation) | 0.619 ± 0.052 |
| paired (non-Gaussian − Gaussian) | Δ = −0.045 ± 0.219 |
| SBERT-photon Gaussian (no Fock truncation) | 0.790 ± 0.170 |
| raw SBERT (no training) | 0.385 |
Not only does heralding fail to add signal — it doubles the split-to-split variance (0.235 vs 0.052) and even the Gaussian Fock path costs 0.17 nDCG@10 vs the non-Fock Gaussian baseline because cutoff = 6 isn't enough dynamic range for the displacement-squeezing combinations the trainer wants. At this corpus scale (20 docs / 26 queries), Loudon's non-Gaussian machinery doesn't get to defend itself.
That's four straight negatives for the photon-route track. The only reason photon-route still beats raw SBERT (+103% nDCG@10) is the 384-dim learned linear projection feeding into the Gaussian RBF. That's a normal dense retrieval trick wearing a photonic hat.
The win: g(1) coherence time as a classifier feature
Loudon Ch 3.1.3 defines the first-order coherence function of a chaotic source:
For a chaotic light source, |g(1)(τ)| decays
exponentially over a coherence time τc. Treat each
candidate's ordered token sequence as a chaotic stream where each unique
token is a wavetrain at a distinct frequency, and you get a one-scalar feature
that captures short-range token-stream structure. Implementation, in
mcp/_lib/orbital.mjs:
function coherence_time(orderedTokens, window = 8) {
const n = orderedTokens.length
if (n < 2) return 0
let tau_c = 0
const W = Math.min(window, n)
for (let tau = 1; tau < W; tau++) {
let matches = 0
for (let i = 0; i < n - tau; i++) {
if (orderedTokens[i] === orderedTokens[i + tau]) matches++
}
const gtau = matches / n
tau_c += gtau * gtau
}
return tau_c
}
The hypothesis: this beats meridian's existing cross_domain proxy —
a 3-bin Shannon entropy over {forge, signal, mind} term hits — at
discriminating across candidate shapes. The discrimination test, run on 9
archetypes (focused single-system, cross-system, scattered, narrow, broad):
| Feature | Mean | Std | Coefficient of variation |
|---|---|---|---|
| cross_domain (3-bin entropy) | 0.40 | 0.39 | 0.99 |
| τc (g(1)) | 0.36 | 0.73 | 2.06 |
2.08× more discriminative. And the win isn't just on aggregate — cross_domain literally collapses focused-forge (0.000) and focused-mind (0.000) to identical values. τc separates them at 0.190 vs 0.139 because different vocabularies have different short-range repetition patterns.
photon-route B1 simulation, May 2026
Inside meridian's worker, the change is additive — a new physics scalar alongside
the seven existing ones, plus an entry at f[24] in the SGD feature
vector. The version bump (FEATURE_VERSION v1 → v2) silently
re-initialises the stored online weights via the existing version-mismatch path,
so production didn't need a manual reset. Whether this 108% feature-level
discrimination translates to better routing accuracy is an empirical question
the SGD layer answers over the next few hundred user clicks — it has
to learn that the new feature is informative before it weights it.
Final accounting — every item, every verdict
Trained SBERT-photon Gaussian: +103% over raw SBERT (0.79 vs 0.39 nDCG@10). Real win, but the gain is the linear projection, not the photonic gates.
Subsumed by A3-Simple's negative result (photon-number metric < Gaussian fidelity).
Loses by 25–40% to Gaussian fidelity on the same trained encoder. Marginal < full state.
Δ = −0.045 ± 0.219 vs Gaussian. Heralded states are non-Gaussian but the trainer can't use them at this eval scale.
26 queries × 20 docs (arxiv quant-ph) with title-as-query expansion. BM25 + SBERT baselines as permanent comparison artifacts. Unblocks every A item.
Decorative. Mean Δ +0.013 ± 0.114, no-squeeze model has half the params and 2.5× smaller train-test gap.
CV 0.99 → 2.06 (+108%). Live in
meridian-orbital@3.1.0 on npm + mcp.ask-meridian.uk.
Carries signal, but synthetic-data thresholds don't transfer — needs calibration on real route_task output. Parked.
Blocked on real feedback data. Cheap to implement; expensive to validate.
Inherits the Gaussian-classical-equivalence ceiling A3-Real ran into. Skipped.
Two takeaways for anyone mining a textbook for production code
-
Sim before you commit. Every "obvious" Loudon idea I had a strong
intuition about — squeezing must add information, photon-number distribution must
be more semantically grounded, non-Gaussian states must escape the classical limit —
survived contact with a 50-line Python sim only sometimes. The good ones still
shipped. The bad ones died in
/tmpinstead of in production. - Negative results are the cheap-to-publish part of physics-grounded engineering. Eight of ten experiments came back null. None of those were wasted: they each ruled out a path so the remaining items got more attention. Memory of which Loudon chapter doesn't pay is itself a deliverable.
The actual deliverable in production is small: one new feature, ten lines of JS, +108% on a discrimination metric, and an empirical question the worker is answering live as users click candidates. The textbook hasn't paid yet at the routing-accuracy level — it might, it might not. But it's the kind of question that's now answerable with telemetry instead of speculation, which is where you want to be.
Source:
github.com/LuuOW/photon-route
(sims, baselines, Fock-basis trainer, the four cloud sweeps),
github.com/LuuOW/meridian-mcp
(commit f3d9fb9, tag v3.1.0),
meridian-orbital on npm.
Inspect the live signature
Every POST /v1/route response on mcp.ask-meridian.uk
now returns a coherence_time field inside each candidate's
physics block. The browser miniapp at
/miniapp/ exercises it on every routing
query — and trains the online layer with each candidate you click.