Skip to content

M4a-2: the Rabi procedure — the pi-gain calibration and the PiPulseReference belief entry - #34

Merged
aarontrowbridge merged 4 commits into
mainfrom
33-rabi-pigain
Sep 3, 2026
Merged

aarontrowbridge merged 4 commits into
mainfrom
33-rabi-pigain

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #33

The amplitude-domain calibration lands, and the first belief entry crosses to the pulse side.

  • The Rabi procedure: the stock cqed AmplitudeRabi sweep compiled through the bridge (the CloseLoop gain ladder, +3 codes/expt — the v1 swept axis), over the wire, fit with the certification class whole (one fitter home) — the G-curve modeling idiom removes a 6.9-sigma recovery bias (fixed pulse shape means ONE response curve read at theta-rescaled gains); the pi-gain recovered at 1.7 sigma against a derived 5-sigma tolerance, chi2/dof 0.74; the bracket is data-anchored, never hand-picked
  • The PiPulseReference belief entry: calibrate! writes the PAIR pi_gain (the gain fraction the v2 ge_pi gain= override consumes) + pi_rabi_mhz — belief keys beyond record parameters, verified as the existing merge contract (tested live: belief grows, truth untouched, drift moves truth only)
  • THE DOWNSTREAM PROOF: the calibrated compile flips Pe = 0.9277 vs the uncalibrated baseline 0.5036 (the stale 8192-code cal = 190x overdrive into T1-saturated 50/50) — delta 0.424, >10x the paired binomial noise; the believed fraction quantizes onto the true pi DAC code (43) — the calibration is real at wire resolution
  • Replay: fresh-process diff-empty across PYTHONHASHSEED values; the fixture lane runs the whole chain Python-free (764/764); the bridge lane 818/818
  • Fixture note, documented: the demo device pulse sigmas moved to 1.0 us (30-ns gaussians = 1.5 samples on the 12.5 MHz rehearsal fabric; qick refuses <3 cycles) — the earlier fixtures byte-identical after regeneration

Verification (director-run): 818/818 bridge-exercised (18m45s); base-only HOLDS 270.

…r + the ge_pi factory

The device fixture's g-e pulse cals move to the rehearsal overlay's slow
fabric (sigma 1.0 us: the stock 30-ns gauss is 1.5 samples at 12.5 MHz and
qick refuses it); gain 8192 stays the STALE amplitude calibration the
procedure corrects. The fixture lane gains two payloads
(generate_rehearsal_payloads.py): rabi_rehearsal.json (the stock cqed
AmplitudeRabi experiment — the ge_pi gauss swept 0..120 int codes over 41
points — riding the CloseLoop gain ladder, +3 codes/expt) and
gepi_baseline_rehearsal.json (the uncalibrated-baseline ge_pi compile).
The bridge gains compile_rabi_sweep (the stock experiment through the pack's
own sequence + the core compile path; refuses a non-integral ladder step)
and compile_ge_pi (the downstream consumption path: gain_frac is the
believed pi_gain in v2 fraction units, the factory's explicit override;
nothing = the calibration's own gain, the baseline). All comb/cavity
fixtures byte-identical after regeneration.
…llation fit, the pi_gain belief entry

The procedure (ext/bringup.jl, the bring-up extension): RabiSweepDesign
(the ladder geometry 0..120 codes over 41 points, the data-anchored fit
params), propose_rabi (shape + recalibration belief-span validation),
fixture_rabi_job (the fixture lane), run_rabi_over_wire (ONE payload; the
decoded axis validated against the declared one; per-expt e-frequencies),
fit_rabi (the certification fit class: weighted binomial chi^2 on
_CertModelCache + _cert_fit_1d, bracket anchored on the first measured
oscillation maximum, sigma from the observed information, tolerance
5*BOSONIC_CERT_TOLERANCE_SIGMA... = 5 sigma), write_back! (calibrate!
writes pi_gain + pi_rabi_mhz — the PiPulseReference pair, the first BELIEF
keys beyond the record's parameter set; the twin contract's merge
semantics admits them with no extension, documented), run_rabi_sweep.

The model: the swept pulse's shape is fixed, so the twin's response is ONE
curve G(gain) — payload-driven rollouts on a gain grid (half the ladder
step), read at theta-rescaled gains by local-quadratic interpolation. The
theta-cache nodes are then pure interpolations, so the cache is dense: the
oscillation phase pi*g/theta twists too fast in theta at the sweep's far
points for a sparse uniform grid (the first attempt's sparse cache biased
the recovery 6.9 sigma; the G-curve removed the bias — recovery now within
tolerance with chi2/dof in the sound band).

Testitems: the procedure chain (fixture lane, Python-free: recovery within
the DERIVED tolerance against the payload-derived analytic truth pi/I_env,
the belief entry + invariants live, the extra-key contract explicit,
refusals actionable, in-process seeded replay) and the degenerate
cross-path pin (the belief-side model == the server's execution per expt,
bit-exact).
…beats the uncalibrated baseline

The bridge-lane testitem (python-optional): two fresh rigs, the SAME seed
and drift path, aged identically — everything but the gain calibration is
shared. The calibrated rig runs the whole loop live (Python compiles the
Rabi sweep, the wire executes, Julia fits and writes the belief); then the
same downstream compile — the ge_pi factory — runs through both wires: at
the BELIEVED pi_gain (the belief-scaled factory path) vs the device
calibration's own stale gain (the uncalibrated baseline).

Pins: the believed fraction quantizes onto the true pi DAC CODE (the
payload's own envelope fixes pi/I_env; the calibration is REAL at wire
resolution); the calibrated response wins sampled AND exact, by more than
10x the paired binomial noise; the calibrated flip reaches the readout's
own confusion ceiling within 5 points; the sampled pair agrees with its
exact truth within 5 sigma; the calibration moved belief only. Plus the
fit's honest refusal on a live short ladder whose span never peaks (the
no-oscillation-maximum error, surfaced through the live compile because
the committed fixture carries the 0..120 geometry).
…play check

test/configurations/rabi_replay_check.jl (the keystone's bringup_replay
pattern): the whole Rabi chain + the downstream pair run end-to-end in one
fresh process and print a canonical serialization — the lane, every
compiled payload's wire JSON, the fit's canonical fields, the believed
entries, and the paired downstream responses. Run twice, diff: byte-empty.
The bridge lane (live Python compile) verified diff-empty across
PYTHONHASHSEED 0/1/random; the fixture lane (Python strumento absent, the
chain against the committed payload) verified diff-empty too — and its
pi_gain matches the bridge lane's bit-for-bit (same payload, same seed ->
same fit).

Also: a soft-scope rename in the downstream proof testitem (bridge ->
bridge2 in the paired section) and the replay section's b -> b_replay.
@aarontrowbridge
aarontrowbridge marked this pull request as ready for review September 3, 2026 06:46
@aarontrowbridge
aarontrowbridge merged commit 0508978 into main Sep 3, 2026
1 check passed
@aarontrowbridge
aarontrowbridge deleted the 33-rabi-pigain branch September 3, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M4a-2: the Rabi procedure — the pi-gain calibration and the PiPulseReference belief entry

1 participant