Nadarasa
Draft · v0.2 · Unreviewed
← Index/Project · Nadarasa ReductionDraft · v0.2 · Selene Emulator

Gate G24 · Compilation

TKET grades the reductions

Every reduction claim on this site has so far been produced by our own rewriter and checked on the emulator — one toolchain marking its own homework. TKET is Quantinuum's production compiler, with an entirely separate optimiser and its own rebase onto the H-series native gate set. This gate rebuilds six circuit families as pytket circuits, runs them through TKET at optimisation levels 0, 1 and 2, and puts the resulting two-qubit counts next to the Nadarasa-reduced forms. Where the two agree, the reduction has independent corroboration. Where TKET wins, that is a gap to close.

cross-check verified36 compile rowsequivalence 36/36Selene 12/12 in envelopeoffline · no HQCs

What this lane actually runs

The extension's QuantinuumAPIOffline handler supplies the H2-2 device model without any credentials, project or job submission, so compilation targets the real native gate set at zero cost. Nothing is sent anywhere; the hardware switch documented in the benchmark suite is untouched.

Device model
H2-2
Optimisation levels
0, 1, 2
Two-qubit natives
TK2, ZZMax, ZZPhase
Shots per confirmation
512

No count in the tables below was allowed through until the compiled circuit was proved equal to its source on the full state space, up to global phase. Worst distance across all 36 rows: 6.33e-15. A circuit that fails the oracle is recorded as a failure and never scored — an optimiser that quietly changes semantics would otherwise look like the best optimiser in the table.

1 — Nadarasa reduction vs TKET optimiser

FamilyQubitsBaseline 2qNadarasa 2qTKET L2 on baselineTKET L2 on NadarasaVerdict
G1Coset-phase parity ladder46655both agree
G33-qubit QFT / AQFT_k=134332not scored
G4Feed-forward conditional core23111both agree
G16Ethylene QPDE interference cell24211both agree
G21ADAPT-GQE H2 UCCSD excitation22111both agree
G23Simon oracle, n = 365353Nadarasa ahead

Across 5 scored families: 4 where TKET independently reaches the same two-qubit count the rewriter reaches, 1 where the Nadarasa form is still ahead, 0 where TKET is ahead. The agreements are the useful part — for the QPDE cell, the UCCSD excitation and the feed-forward core, a production compiler with no knowledge of rules (N), (M) or (P) lands on exactly the reduced form, which is much stronger evidence than our own emulator agreeing with our own rewriter.

Where the two disagree, and why

G23 is the one family the optimiser does not crack. The Simon oracle emits CX(pivot, n+pivot) twice — once in the copy layer, once in the mask layer — separated by other CXs on unrelated wires. Cancelling them is an involution argument over commuting parity gates, which is exactly what rule (M) is for and what a peephole pass sweeping local windows does not see. Five two-qubit gates become three, a 40% cut that survives TKET's own level-2 pass on the reduced form.

G3 is excluded from scoring entirely. The AQFT band truncation drops a π/4 controlled phase, so it is an approximation, not a rewrite — no correctness-preserving compiler is allowed to find it. Listing it as a win would be comparing a compiler against a modelling decision.

2 — Every compile row

FamilyVariantLevelGates2qDepth2q depthCompile sOracle
G1raw015 → 476 → 62560.0114.5e-15
G1raw115 → 226 → 61460.0264.4e-15
G1raw215 → 196 → 51250.1073.3e-15
G1nadarasa015 → 476 → 62140.0154.8e-15
G1nadarasa115 → 206 → 61040.0203.5e-15
G1nadarasa215 → 206 → 5830.0763.2e-15
G3raw07 → 214 → 31330.0112.4e-15
G3raw17 → 114 → 3630.0144.0e-15
G3raw27 → 114 → 3630.0704.1e-15
G3nadarasa06 → 163 → 21220.0072.5e-15
G3nadarasa16 → 103 → 2620.0151.5e-15
G3nadarasa26 → 103 → 2620.0671.5e-15
G4raw04 → 173 → 31330.0061.3e-15
G4raw14 → 63 → 1410.0136.8e-16
G4raw24 → 73 → 1410.0291.2e-15
G4nadarasa02 → 71 → 1510.0031.3e-15
G4nadarasa12 → 61 → 1410.0076.9e-16
G4nadarasa22 → 61 → 1410.0191.2e-15
G16raw011 → 314 → 42240.0111.6e-15
G16raw111 → 124 → 41040.0261.1e-15
G16raw211 → 64 → 1410.0261.9e-15
G16nadarasa07 → 112 → 2720.0018.8e-16
G16nadarasa17 → 72 → 2520.0128.9e-16
G16nadarasa27 → 62 → 1410.0151.2e-15
G21raw07 → 172 → 21320.0091.4e-15
G21raw17 → 82 → 2620.0229.8e-16
G21raw27 → 52 → 1310.0348.8e-16
G21nadarasa05 → 71 → 1510.0017.6e-16
G21nadarasa15 → 51 → 1310.0098.1e-16
G21nadarasa25 → 51 → 1310.0208.1e-16
G23raw011 → 375 → 51230.0126.3e-15
G23raw111 → 235 → 5630.0285.4e-15
G23raw211 → 235 → 5630.0915.2e-15
G23nadarasa09 → 273 → 31020.0105.5e-15
G23nadarasa19 → 183 → 3520.0245.8e-15
G23nadarasa29 → 183 → 3520.0865.9e-15

Level 0 is rebase-only and shows what the native gate set costs before any optimisation; levels 1 and 2 add TKET's peephole and two-qubit resynthesis passes. Note that level 0 already reduces some two-qubit counts: the rebase itself maps a CX–Rz–CX sandwich onto a single ZZPhase, so part of what looks like optimisation is really the native gate set being a better fit for phase-type circuits than the CX basis they were written in.

3 — Selene confirmation of the compiled circuits

Gate counts are a static claim. To close the loop, each level-2 compiled circuit is transpiled from its native TKET ops (PhasedX, Rz, ZZPhase, ZZMax) into the matching guppylang.std.qsystem calls and sampled on Selene at 512 shots, then compared against the exact distribution of the original source circuit. Both sides use half-turns, so the transpile is one-to-one with no angle conversion.

FamilyVariantQubitsGuppy opsTVD vs exact4σ envelopeVerdict
G1raw4230.01560.1250within
G1nadarasa4240.00580.1250within
G3raw3150.04100.1250within
G3nadarasa3140.06640.1250within
G4raw2110.01370.1250within
G4nadarasa2100.02730.1250within
G16raw2100.00320.1250within
G16nadarasa2100.03250.1250within
G21raw290.01230.1250within
G21nadarasa290.00840.1250within
G23raw6270.08980.1250within
G23nadarasa6220.04690.1250within

All 12 rows land inside the 4σ binomial envelope, worst total-variation distance 0.0898. Two independent compilers, one emulator, same distributions.

4 — Honest limits

  • Offline compilation only: QuantinuumAPIOffline supplies the H2-2 gate set and no job is submitted, so no HQCs are consumed and no number here is hardware-measured.
  • Every gate count is reported only after the compiled circuit was proved equal to its source up to global phase.
  • G3 is an approximation family (AQFT band truncation), so TKET cannot reach the Nadarasa form without changing semantics; it is excluded from win/loss scoring.
  • Optimisation-level runtimes are pytket wall-clock inside the Lovable sandbox and are comparative only.
  • Six families at two to six qubits is a sample, not a survey. The agreements say the reductions are reachable by a production compiler on these circuits; they do not establish that the rules generalise.

References

Arun Nadarasa · Refutation-first research notebook · Selene emulator runs, source open
Credit is aspirational until independently verified · © 2026