Reading Loudon to improve a router — nine experiments, one ship · banner showing the 10-cell experiment grid with B1 marked as SHIPPED in gold and the +108% discrimination lift

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.

items planned
10
Loudon-grounded
items resolved
8/10
empirical answer
items shipped
1/10
live in production
discrimination lift
+108%
τc vs cross_domain

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):

ItemLoudon sectionHypothesis
A1Ch 5.3Train per-word photonic params (replacing SHA-init)
A2Ch 6.4Add g(2)(0) photon bunching as a ranking feature
A3-SimpleCh 6.10Score by photon-number distribution (direct-detection metric) instead of Gaussian fidelity
A3-RealCh 9.4 + 6.10PNR-conditioned non-Gaussian heralded states (escape Gaussian-classical equivalence)
A4Build real eval set (20 arxiv quant-ph + held-out splits)
squeezing ablationCh 5.4Test whether the squeezing layer specifically pays
B1Ch 3.1Replace 3-bin entropy with g(1) coherence time τc
B2Ch 6.4g(2)(0) classifier reframe (planet/comet/asteroid)
B3Promote optical features into the SGD feature vector
B4Ch 6.8HOM-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:

$$|\langle \beta | \alpha \rangle|^2 \;=\; \exp\!\bigl(-|\alpha - \beta|^2\bigr)$$

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:

SeedFullNo-squeezeΔ
10.9080.908+0.000
20.5720.750−0.178
31.0000.908+0.092
40.7830.733+0.050
50.6870.589+0.098
mean0.790 ± 0.1700.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:

EncoderGaussian fidelityPhoton-number BCΔ
full (squeezing on)0.7900.589−0.201 ± 0.246
no-squeeze0.7770.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:

ArchitectureTest 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:

$$g^{(1)}(\tau) \;=\; \frac{\langle E^{*}(t)\, E(t+\tau)\rangle}{\langle |E(t)|^{2} \rangle} \qquad\Longrightarrow\qquad \tau_{c} \;=\; \sum_{\tau=1}^{W-1} \bigl|g^{(1)}(\tau)\bigr|^{2}$$

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):

FeatureMeanStdCoefficient of variation
cross_domain (3-bin entropy)0.400.390.99
τc (g(1))0.360.732.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.

DISCRIMINATION (CV = std / mean) — higher is better cross_domain (3-bin entropy) 0.99 τ_c (g^(1) coherence time) 2.06 +108% lift · 9 archetypes · full sim in space/sim_b1_g1_coherence.py

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

A1 — train v2 params  [Ch 5.3]
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.
A2 — g(2) ranking  [Ch 6.4]
Subsumed by A3-Simple's negative result (photon-number metric < Gaussian fidelity).
A3-Simple — photon-number metric  [Ch 6.10]
Loses by 25–40% to Gaussian fidelity on the same trained encoder. Marginal < full state.
A3-Real — PNR non-Gaussian  [Ch 9.4 + 6.10]
Δ = −0.045 ± 0.219 vs Gaussian. Heralded states are non-Gaussian but the trainer can't use them at this eval scale.
A4 — eval set  [infra]
26 queries × 20 docs (arxiv quant-ph) with title-as-query expansion. BM25 + SBERT baselines as permanent comparison artifacts. Unblocks every A item.
squeezing ablation  [Ch 5.4]
Decorative. Mean Δ +0.013 ± 0.114, no-squeeze model has half the params and 2.5× smaller train-test gap.
B1 — coherence_time  [Ch 3.1]  SHIPPED
CV 0.99 → 2.06 (+108%). Live in meridian-orbital@3.1.0 on npm + mcp.ask-meridian.uk.
B2 — g(2) classifier  [Ch 6.4]
Carries signal, but synthetic-data thresholds don't transfer — needs calibration on real route_task output. Parked.
B3 — optical features in SGD  [infra]
Blocked on real feedback data. Cheap to implement; expensive to validate.
B4 — HOM-dip parents  [Ch 6.8]
Inherits the Gaussian-classical-equivalence ceiling A3-Real ran into. Skipped.

Two takeaways for anyone mining a textbook for production code

  1. 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 /tmp instead of in production.
  2. 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.