M4a-2: the Rabi procedure — the pi-gain calibration and the PiPulseReference belief entry - #34
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33
The amplitude-domain calibration lands, and the first belief entry crosses to the pulse side.
Verification (director-run): 818/818 bridge-exercised (18m45s); base-only HOLDS 270.