Case Study
IQP-MMD: Generative Quantum Machine Learning
A modular research toolkit for training IQP circuits with MMD loss, covering anti-concentration theory, scaling experiments, bandwidth analysis, Qiskit validation, and formal structural modeling.
At a Glance
Key Metrics
Circuit Families
4 families
Lattice, ER, Product, Complete
Datasets
6 targets
Ising, blobs, MNIST, D-Wave, genomic
Key Finding
MMD ≠ Shape
Low loss ≠ learned distribution
Validation
Exact + Qiskit
Statevector + shot + noise cross-check
TL;DR
Summary
Built a production-quality research toolkit on top of Xanadu AI's scaling GQML paper (arXiv:2503.02934). The project implements IQP circuit training with MMD² loss across four circuit families and three kernel types, then adds a rigorous anti-concentration analysis layer showing that low loss does not imply learned distribution shape. Validated classically, against Qiskit statevector/shot/noise modes, and on Grid5000 HPC. Formal Forge models provide structural guarantees on generator graphs.
Background
Context
Generative quantum ML asks whether an IQP circuit can learn a target binary distribution by minimizing MMD², a kernel-based divergence that decomposes into Z-word expectations. The Xanadu scaling paper claimed circuits trained classically transfer to quantum hardware at up to 1,000 qubits. This project builds the infrastructure to reproduce and extend those claims with rigorous diagnostics.
The central question driving the research: does a small MMD² loss mean the circuit has actually learned the target distribution? The anti-concentration track was designed specifically to stress-test this assumption.
The circuit model: |ψ(θ)⟩ = H⊗ⁿ · exp(i Σⱼ θⱼ X^gⱼ) · H⊗ⁿ |0⟩ⁿ, where each generator bitmask gⱼ ∈ {0,1}ⁿ determines which qubits interact. The circuit family defines which generators are used.
Architecture
Package Modules
circuits/
PennyLaneIQP circuit integration: parameterized gates, generator bitmasks, and exact output-probability extraction via Walsh-Hadamard transform.
tap to expand
mmd/
JAXMMD² loss with Gaussian/Laplacian/multi-scale kernels, locked spectral conventions, exact small-n path, analytic + autodiff gradients, and per-observable diagnostics.
tap to expand
training/
SGD/AdamFull training pipeline with per-step trajectory JSONL, .npz checkpoints, anti-concentration and marginal sidecars at every persisted step.
tap to expand
experiments/
CLIConfig-driven runners for scaling grid, Qiskit validation, training, and Forge structural search. Resolved manifest + JSONL per setting.
tap to expand
hypergraph/
NetworkXFour primary circuit families (lattice, ER, product, complete) with Hypothesis strategies for property-based testing.
tap to expand
distributions/
NumPyExact and sample-based marginals, per-order TV/chi-square/Fourier squared error, and Walsh coefficient helpers for anti-concentration analysis.
tap to expand
qiskit/
Qiskit AerSplit measured/unmeasured circuit builders, noise model factory (depolarizing, amplitude damping, thermal relaxation), and MMD² cross-check runners.
tap to expand
forge/
Formal ModelsStructural Forge exports: qubits, generators, overlap-graph facts, degree constraints, and threshold predicates for automated circuit-family searches.
tap to expand
Families
Circuit Families
| Family | Structure | Edge Density | Plateau Risk |
|---|---|---|---|
| ZZ Lattice | 2D nearest-neighbor grid | O(n) | Low |
| Sparse Erdős-Rényi | Bounded expected degree p = c/n | O(c) | Low |
| Product State | Single-qubit generators only | O(1) | Very low |
| Complete Graph | All pairwise ZZ interactions | O(n²) | High |
Key Finding
Anti-Concentration vs. Loss
A distribution is anti-concentrated when its probability mass is spread rather than spiked. The paper uses the scaled second moment S_q = 2ⁿ · E[q(x)²] as the diagnostic: values near 1 indicate concentration, values near 2ⁿ indicate anti-concentration.
The AC11 experiment trained a lattice IQP circuit on a binary-mixture target at n=9. The target has strong anti-concentration. The learned model reduces MMD² aggressively, but its distribution remains far smoother than the target at every bandwidth tested.
Target vs Learned Anti-Concentration (n=9, lattice, binary-mixture)
Key insight: Even when MMD² drives to near-zero (σ=9: loss = 0.0010), the learned distribution's scaled second moment remains far below the target. Low loss is not the same as matching the target's collision structure.
| σ | Final MMD² | Target S_q | Learned S_q | Gap |
|---|---|---|---|---|
| σ = 1 | 0.1019 | 70.98 | 20.33 | 50.65 |
| σ = 3 | 0.0255 | 100.66 | 4.83 | 95.83 |
| σ = 9 | 0.0010 | 85.14 | 12.13 | 73.01 |
AC12
Bandwidth & Marginal Agreement
Gaussian bandwidth σ controls which spectral orders the kernel emphasizes. Small σ focuses on low-order parity observables (single-qubit marginals). Large σ shifts weight toward higher-order correlations. The AC12 sweep ran σ ∈ {1, 3, 9, 27} and tracked per-order marginal TV error independently of the scalar MMD² loss.
Per-Order Marginal Agreement by Bandwidth (σ)
Higher σ shifts spectral weight toward higher-order Z-words, emphasizing fine-grained collision structure over marginal statistics.
Why this matters: Optimizing MMD² at one bandwidth can improve low-order marginals while leaving high-order structure unlearned, or vice versa. Per-order decomposition is the right diagnostic, not the scalar loss alone.
How
Methodology
Locked MMD² Derivation
Named RNG Streams
Anti-Concentration as a Separate Diagnostic
Qiskit Cross-Validation
Config-Driven Reproducibility
Depth
Technical Depth
Exact Small-n Engine
Walsh-Hadamard probability extraction paired with exact MMD² path. Enables ground-truth validation at n ≤ ~16 without approximation, confirmed against brute-force toy distributions.
JAX Autodiff Gradients
Analytic gradient estimator cross-validated against JAX value_and_grad and finite differences. Gradient summaries include IQR, MAD, p95/p50 tail ratio, and median-of-means for barren plateau diagnosis.
Hypothesis Property Tests
Strategies for all four primary families. Tests enforce exact lattice and ER structural invariants (open-boundary nearest-neighbor ZZ, bounded-degree sparse ER) at the generator-matrix level.
Forge Formal Modeling
Structural searches in Forge (Brown's relational model finder) over IQP generator graphs. Overlap-graph facts, degree constraints, and anti-concentration threshold predicates are exported as machine-readable instances.
Batched Streaming Expectation
Memory-bounded IQP expectation engine with online mean/variance accumulation. Large num_z_samples runs over bounded chunks without materializing all cosine samples at once.
Grid5000 HPC Experiments
Bandwidth and marginal sweeps scaled to n ∈ [9, 20+] across 512 nodes. Grid5000 payload bundle encodes experiment configs for reproducible remote submission.
Data
Supported Datasets
| Dataset | Qubits (n) | Source | Notes |
|---|---|---|---|
| 2D Ising lattice | 9–16 | MCMC sampling | Square-grid nearest-neighbor spin model |
| Scale-free Ising | 10–1000 | Barabási–Albert + MCMC | For large-n sampled experiments |
| Spin blobs | 16 | Synthetic | Binary classification baseline |
| MNIST (binarized) | 784 | torchvision | High-dimensional transfer target |
| D-Wave | 484 | Zenodo | Real quantum annealer samples |
| Genomic SNP | 805 / 10K | INRIA 1000 Genomes | 16-SNP projection validated exactly |
Authorship
Role
Team project for the Advanced Quantum Information course at Sorbonne Université, with Koshik Seeburrun and Mohamed Yaqub Alameen, supervised by Hela Mhiri. I owned the anti-concentration and marginal-agreement diagnostics, the Grid5000 distributed scaling experiments, the Qiskit statevector/shot/noise validation layer, and the Forge formal modeling of generator graphs. Koshik led the circuit family design (lattice, Erdős-Rényi, product, complete graph); Yaqub led the core training pipeline and initialization strategy experiments. Built on top of Xanadu AI's arXiv:2503.02934.
Future
What I'd Do Next
Run native n=805 genomic training on Grid5000 with reduced hyperparameters to test whether the AC gap persists at genomics-scale spin counts.
Implement a per-order loss decomposition that weights marginal agreement by spectral order explicitly, moving beyond the scalar MMD² to a multi-objective training signal.
Extend the Qiskit noise sweep to realistic IBM backend error rates and compare AC trajectories between simulated and emulated hardware executions.
Add a formal Forge check for anti-concentration sufficiency: whether the generator graph's overlap structure guarantees output-probability spreading at the circuit level.
Benchmark IQP training against the paper's RBM and DeepEBM baselines on the same datasets, using the same MMD² and marginal metrics.