Case Study · Updated September 10, 2026
MerLin Photonic Generative Modeling
A photonic generative-modeling study spanning a simulated two-ring generator, corrected IQP trainability and loss experiments, and an additive classical-training pipeline with bounded photonic deployment checks.
v4.0
Closed bounded release
What the release establishes
v4.0 is merged and closed for its selected bounded scope. It adds classical IQP training, matched comparisons with my sibling project, and separate small-circuit optical simulations. Several target fits remain poor, and postselection makes expected sampling costs large. No hardware experiment or quantum advantage is demonstrated. The original broader scientific program remains incomplete.
Classical ring training
6–8 qubits
Exact NumPy main runs. two kernels
Ring comparisons
22 cells
20 main artifacts and two smoke cells
Sibling comparisons
8 cells
Matched available source experiments
Direct optical simulation
2–4 qubits
Registered controls and ring smoke only
The release report and requirement ledger record the evidence and remaining qualifications.
History
Three different experimental questions
| Stage | Implementation | Supported conclusion |
|---|---|---|
| v1.0 generator | Latent-input QuantumLayer.simple. 462 outcomes mapped to a spatial grid | Classical simulator training improves MMD, but the two-ring shape criterion is unmet. |
| v2–v3 and v3.1 correction | Explicit IQP encoding, gate checks, trainability and loss sweeps | Small-circuit checks survive. The two headline trainability/hardness interpretations were withdrawn. |
| v4.0 | Separate NumPy IQP trainer, spatial/Hamming objectives, matched deployment references | Bounded implementation and comparison evidence. Broader realistic-noise research remains open. |
The v1 latent-input model and the later IQP circuit are different ansatzes. V1 already trained through classical simulation. V4 adds IQP expectation mathematics that avoids an optical simulator during training. It does not replace the earlier pipeline.
v1.0
A lower loss did not recover the full ring shape
| Historical benchmark | Recorded value | Interpretation |
|---|---|---|
| Trained held-out MMD² | 0.0125 ± 0.0003 | Reported over 20 fresh latent draws. not an optical-shot confidence interval. |
| Untrained MMD² | 0.0360 ± 0.0048 | Same historical benchmark protocol. |
| Real-versus-real MMD² | 0.0114 | Finite-data reference, not a mathematical floor. |
| Probability on target rings | 0.68–0.69 | GEN-07: recognizably forming two rings remains unmet. |
The generator outputs a probability vector, mapped to 2D bin centers and compared with the target using a Gaussian spatial kernel. The reported ring mass increased from 0.609 to 0.691 after changing both outcome grouping and the output-to-center mapping. Because those changed together, the result does not isolate a causal benefit from radius ordering. Neighboring Fock-state indices have no established spatial smoothness that guarantees this effect.
The spatial kernel is a different objective from the sibling project's Hamming kernel. A weak classifier baseline does not rule out the loss function as a contributor to poor generative fit. See the mapping correction and historical benchmark.
v3.1 correction
What the original sweeps actually measured
The original v3 write-up interpreted small-n gradient-variance fits as trainability findings. Classical null models reproduce the headline curves for the tested scopes. At n≤4 the chosen Euclidean kernel is numerically close to the identity. At n=5,6 its off-diagonal entries matter, but the null still reproduces the curve. These results do not establish an asymptotic barren plateau or an additional photonic trainability effect.
The loss sweep used classically sampleable families: independent single-qubit factors, or one fixed correlated pair with independent remaining qubits. There was no established sampling hardness to preserve. A half-L1 comparison involving subnormalized surviving mass was also interpreted too strongly. If the accepted mass is m=sq for normalized q, half-L1 against q is (1−s)/2. Conditional TVD is zero when the shape is unchanged. These answer different questions.
Under fixed photon number, uniform independent loss and acceptance requiring all n photons, loss contributes ηⁿ to success while preserving the conditional shape. Real ancilla photons in a heralded-CZ construction add transmission cost. Vacuum-ancilla CP gates avoid that extra photon-loss exponent but still incur postselection cost. Neither statement extends automatically to multiphoton sources or nonuniform loss.
The dated correction record preserves the original evidence. The earlier portfolio conclusions about transferred plateaus and the promise of photonic IQP are superseded by this account.
v4 methods
Train classically, compare the deployed model
IQP parity expectations can be expressed as classical cosine averages. This implementation enumerates finite bitstrings exactly and differentiates those expectations in NumPy. Enumeration still grows exponentially. This is not a demonstration of the literature's thousand-qubit sampled training method. Cheap expectation estimation also does not guarantee successful optimization.
The Hamming objective uses K(x,y)=exp(−H(x,y)/(2σ²)), where H counts differing bits, with σ=0.5√n for the ring profile. Its Walsh spectrum is diagonal. The spatial objective has a finite Walsh representation too, generally with off-diagonal terms. Kernel geometry, normalization and bandwidth must match before comparing losses.
Frozen parameters pass through an unquantized compiler control, catalog-angle quantization, and analytic trace-decreasing CP maps. Maps retain absolute success mass and normalize once at the end. Analytic tomography is synthetic reference data. Separate Perceval checks provide the bounded direct optical evidence. A product of gate maps does not itself prove final-only full-Fock equivalence.
See kernel definitions and deployment assumptions.
v4 results
Ring fit and expected sampling cost
Each main profile ran 300 Adam updates on the frozen 320/80 split of the 400-point circles dataset. Five seed IDs per profile produce identical parameters under deterministic parity initialization: the 20 main artifacts represent four unique runs, not 20 independent replications. Two n=4 three-update smoke cells complete the 22 comparisons.
Total variation distance (TVD) ranges from zero for agreement to one for maximal disagreement. Support validity is probability on states with supplied training-target probability above 10⁻⁶. It does not certify the unknown population support. The fit/support columns below use raw models. Cost uses the quantized analytic deployment at η=1, which still includes gate postselection.
| Profile | Train TVD | Held-out TVD | Support validity | Attempts for 20,000 accepted outcomes |
|---|---|---|---|---|
| Hamming, n=6 | 0.5539 | 0.5673 | 0.5438 | 2.65 billion |
| Spatial, n=6 | 0.5118 | 0.5493 | 0.6269 | 1.53 billion |
| Hamming, n=8 | 0.6052 | 0.7348 | 0.4399 | 360.97 billion |
| Spatial, n=8 | 0.5809 | 0.6869 | 0.5133 | 86.27 billion |
These fits remain imperfect. The n=6/n=8 deployment estimates are analytic references, not direct optical simulations. The nominal 20,000 outcomes are a cost calculation, not collected shots. no hardware attempt rate or sampling confidence interval is established.
Matched evidence
Sibling-to-substrate comparisons
Eight available experiments were retrained with the pinned sibling trainer and compared using matched generators, parameters, target data, kernels and bit order. The arms are sibling IQP, equivalent local IQP, unquantized compilation, quantized compilation and an analytic fixed-photon deployment at η=0.9. This is stronger than replaying a checkpoint, but it covers only the registered available experiments. Other source experiments remain qualified or blocked.
| Cell | Analytic deployed TVD | Support validity | Attempts for 20,000 accepted outcomes |
|---|---|---|---|
| n=6 training smoke | 0.9351 | 1.0000 | 37,634 |
| n=9 bandwidth, σ=1 | 0.9883 | 0.0118 | 2.59 × 10¹⁶ |
| n=9 bandwidth, σ=3 | 0.9157 | 0.0965 | 1.28 × 10¹⁶ |
| n=9 bandwidth, σ=9 | 0.9908 | 0.0170 | 7.89 × 10¹⁵ |
| n=9 bandwidth, σ=27 | 0.9733 | 0.0315 | 1.44 × 10¹⁵ |
| n=9 Ghosh–Kim, σ=1 | 0.8509 | 0.2933 | 1.02 × 10¹⁶ |
| n=9 Ghosh–Kim, σ=3 | 0.9766 | 0.0234 | 7.02 × 10¹⁶ |
| n=9 Ghosh–Kim, σ=9 | 0.9138 | 0.1626 | 6.17 × 10¹⁶ |
The n=6 target has full support, so support validity of one coexists with poor fit. The n=9 targets have only 7–19 supported states out of 512. Their analytic acceptance probabilities are about 2.85×10⁻¹³ to 1.39×10⁻¹¹: roughly 72 billion to 3.51 trillion independent source attempts per accepted outcome. Matching implementations does not make these target fits good or the sampling costs practical.
Expected attempts are N/s for N accepted outcomes and independent attempts with success probability s. All eight deployed arms are analytic references, not n=9 optical or hardware experiments. The comparison report links the frozen artifacts and controls.
Verification
What was checked, and at what scale
| Check | Evidence | Limit |
|---|---|---|
| Direct Perceval simulation | Registered n=2/n=3 no-gate, bystander and shared-gate controls. two n=4 ring smoke evaluations | Fixed-photon model. No general multiphoton or larger-n validation. |
| Final-only projection | Shared-gate fixture conditional TVD ≈1.94×10⁻¹⁶ with unchanged accepted mass | One registered fixture is not a general projection theorem. |
| NAT continuation | Discrete pair-angle keys, continuous singles and matched arms from one warm start | Optimizer mechanics and controls pass. Realistic-noise efficacy is not established. |
| Resource pilot | Analytic path at n=4/6/8/10. n=10 peak RSS growth ≈110 MiB | Not full-Fock scaling or a hardware runtime prediction. |
| Clean-checkout software checks | 726 tests passed, one default-suite skip. 37 explicit sibling integration tests passed | Implementation validation is not full scientific acceptance. |
| Julia and Forge history | Separate small-circuit numerical checks. bounded ancilla mapping/allocation/lifecycle models | Shared assumptions can survive cross-checks. Formal bookkeeping is not an optical correctness proof. |
Literature
An implementation study within established research
KLM established linear-optical quantum computation. This project does not claim a new proof that qubit IQP circuits can be realized optically. Recio-Armengol, Ahmed and Bowles provide the classical-training approach motivating v4. Salavrakos et al. demonstrate a related photonic Born machine with loss mitigation, using a different model and experimental route.
IQP sampling-hardness results concern specified families and complexity assumptions. They do not certify these trained instances. Bandwidth and trainability theorems likewise require matching the cost, initialization ensemble and notation. The literature scope and baseline state those boundaries. No exhaustive novelty claim is made.
Open research
What remains beyond the closed release
The original frontier question was whether a classically trained model remains useful under realistic photonic source imperfections, and whether noise-aware training or mitigation closes the deployment gap. The bounded release supplies infrastructure and baselines for that question. It does not answer it.
Remaining work includes validated distinguishability and multiphoton source models, broader full-Fock checks, direct larger-n deployment, matched sampled uncertainty, and a scientific test of NAT efficacy. The owner's source-gap hypothesis is recorded, but its source-mutation experiment is unperformed. A gate-based versus graph-state IQP comparison was not implemented. No general gate-count scaling law or photonic advantage follows from this release.
Authorship
Implementation, interpretation and correction
This is a solo project developed with AI assistance. I own the research choices, interpretation and published claims. The correction history records where earlier explanations exceeded the evidence. Software checks alone did not prevent those mistakes. The repository retains owner explanations, dated audits and reproducible artifacts so readers can distinguish measurements from interpretations.
Documentation reconciliation · Owner explanation · Source repository