Kernel fusion across slopes
Compile once; parameterize angles per-shot via Guppy comptime constants. Cuts G3 wall-clock from minutes to seconds.
Results · real Selene shots
host_fusion_verified_3.47x · in_kernel_variant_tracked_upstreamHost-level reuse of one built runner is verified at 3.47× faster than per-slope re-compilation, with shot statistics indistinguishable from the baseline. The in-kernel parametric-entry-point variant is blocked upstream (guppylang 0.21.16 EntrypointArgsError) and tracked there — outside this repo's surface area.
Why this matters
G3 today regenerates and re-imports a .py file per slope. That round-trip dominates wall-clock. Compile once, sweep many — re-use the built Selene runner across slopes — is the engineering claim the card makes.
What the repo already has
Host-fused runner in nadarasa_g7.py: one compile, one builder, N×run_shots — verified to match per-slope shot statistics exactly.
What's missing
True in-kernel parametric fusion (`angles: array[float, n]` as entry-point arg) requires Guppy entry-point support that 0.21.16 does not have; tracked upstream.
Smallest experiment
Build it or kill itQubits
Same as G3 (n + 1).
Ancilla pattern
Same as G3.
Shots
6 slopes × 200 shots = 1200, same as current G3.
Predicted outcome
Host-fused wall-clock drops by >1.5×; shot statistics indistinguishable from per-slope baseline.
Refutation criterion
If host fusion gives <1.5× speedup or alters shot statistics, the card is refuted.
Kernel sketch
Untested — sketch only# host-side fusion (verified · G7)
compiled = program.compile() # once
runner = build(compiled) # once
for angles in slope_grid:
shots = runner.run_shots(Quest(), n_qubits=n+1, n_shots=200, angles=angles)
# wall_clock = compile_once + sum(run_shots) vs. per-slope re-compileHost pipeline
Driver compiles once; per-slope = one runner.run_shots call with new angles. Verified speedup A/B = 3.47×.
Related
Files in this repo
- · quantum/nadarasa_g7.py
- · src/data/demos/nadarasa_g7.json
- · quantum/nadarasa_g3.py
- · quantum/nadarasa_g3_lib.py