Qubit Ramsey Frequency as a function of the coupler current#
This node locates the avoided crossings between a qubit and its coupler by sweeping the coupler’s DC bias current and running a Ramsey-fringes measurement (single artificial detuning) at every step. Near a crossing, hybridisation with the coupler mode is visible in two simultaneous signatures: the qubit’s dephasing time (T2*) dips sharply, and its frequency is repelled away from its unperturbed value. The node locates each crossing from the frequency jump and uses the T2* dip to validate it.
This is an alternative to qubit spectroscopy vs current for the same purpose — a Ramsey-based T2*/frequency crossing detector instead of a two-tone-spectroscopy frequency-jump detector. Both nodes report their QOI under the same qubit_crossing_points_{qubit} Redis keys, so either can feed cz_currents_from_spectroscopies interchangeably.
Code structure#
Measurement class: RamseyDetuningsMeasurement#
Reused unchanged from Ramsey fringes (qubit_control.ramsey_fringes.measurement); the current sweep is external to the pulse schedule and is applied via the SPI DAC before each measurement, same as the other _vs_current coupler nodes.
Analysis classes: QubitRamseyFreqVsCurrentAnalysis#
For each qubit of the coupler, a _QubitRamseyCurrentTracker fits a damped-sinusoid Ramsey trace at every current step (in a process pool, same convention as qubit_spectroscopy_vs_current).
Detected vs. faulty: _is_trustworthy_ramsey_fit#
A per-current fit is only trusted (“detected”) if it passes four checks (_is_trustworthy_ramsey_fit); failing any one marks it “faulty” (excluded from crossing detection, freq_at_step/T2 set to NaN):
min_r_squared_detune_fit: the baseline R² gate.tau_min_fraction_of_delay_span: R² alone is not enough — a trace whose oscillation decays much faster than the sampled delay window can still score a high R² while leaving the fitted frequency essentially unconstrained (found in practice: R²=0.94, tau=0.38 µs against a ~2 µs delay span, with a deceptively tight-looking frequency stderr). Rejects fits wheretauis below this fraction of the delay span.freq_min_cycles_in_delay_span: a flat, non-oscillating trace can also score a high R² against a degenerate near-zero-amplitude fit (found in practice: R²=0.99, amplitude0.0087 ± 0.0406— not statistically distinguishable from zero — fitted frequency 80 kHz, right on a crossing current, meaning a point with no real oscillation signal was being used as one of the two points bracketing a reported crossing). Rejects fits whose frequency falls below the Fourier/Rayleigh resolution limit of the trace (frequency must complete at least this many cycles within the delay span).freq_nyquist_margin_fraction: rejects fits whose frequency lands within this fractional margin of the trace’s own Nyquist frequency (1 / (2 * delay_step)) — a classic aliasing artifact rather than a resolved oscillation (found in practice: a fit converged to 7.8118 MHz against a trace whose Nyquist frequency is 7.8125 MHz).
The three checks beyond R² are scaled to each trace’s own ramsey_delays array (span and step), not a fixed absolute value, so they adapt automatically to a different delay sweep without re-tuning.
ramsey_grid_figure’s per-panel highlight gives faulty steps priority: a step that failed any of these four checks is always outlined in red, even if it’s also part of a crossing’s (possibly widened) bracket — being used to bracket a crossing doesn’t make an otherwise-untrustworthy fit trustworthy. Only a trustworthy step that is part of a bracket gets the gold outline.
Once every current’s fit is classified, crossings are located with one of two algorithms selected by crossing_detection_algorithm:
t2_and_frequency(default): a hybrid of the two approaches below. Candidate crossings are found with the same gap-tolerant frequency-jump detection asspectroscopy_style(_find_crossing_currents, using an adaptive threshold — see below), which tolerates runs of several consecutive faulty/failed fits since it searches ahead to the next successfully-fit point rather than only comparing adjacent steps. The adaptive threshold isfreq_crossing_fractionof the qubit’s own valid-frequency range, clamped betweenmin_crossing_jump_floor_hzandmin_crossing_freq_gradient_hz— the floor matters for a qubit with no real crossing in the swept range: its “valid-frequency range” is then pure measurement noise, and without a floor the threshold shrinks right along with it, reporting that noise itself as false crossings (found in practice: ~7-8 false crossings per 100 steps with no floor, against 10-200 kHz noise — a 300 kHz floor only suppressed about half of those; the default 1 MHz suppressed every one in a 500-trial synthetic test). Each candidate is then: (1) dropped unless there is at least one valid frequency point measured on both sides of it withincrossing_refine_search_radiussteps (a jump truncated at the sweep’s own edge, with nothing beyond to confirm it, is reported as no crossing rather than a guessed one); (2) refined by locating the steepest gap-tolerant frequency change within that same window, then widened (_widen_jump_bracket) outward to cover any chain of consecutive jumps that each individually exceed the same threshold, before reporting the midpoint of the two steps bracketing the (possibly widened) chain, rather than the coarser mean-of-swept-currents_find_crossing_currentsitself reports. The widening step matters because a single avoided crossing does not always show as one clean monotonic step: right at a crossing’s degeneracy point the dressed frequency can sweep so fast with current that the Ramsey fit aliases near the trace’s own Nyquist frequency from one step to the next, producing a rise-fall-rise zigzag (sometimes with a completely flat, zero-amplitude trace exactly at the center, where the qubit is maximally hybridized with the lossy coupler mode) — bracketing only the single steepest pair would silently discard the rest of that same physical crossing, undercounting it or mis-locating it. The true crossing is often the one step excluded from both the frequency and T2 data entirely (fastest dephasing is hardest to fit), i.e. it sits between the bracketing steps, not at either one, so T2 is used only to decide which bracketed step’s T2 represents the crossing (for sorting/validation), never to relocate it. Candidates left withinspectroscopy_style_min_interval_aof each other after refinement are merged, keeping whichever has the better-resolved (lower) T2. Each final crossing is still validated (local T2 minimum, parabolic residual, depth ratio) and logged. This replaced an earlier T2-threshold-gated step-to-step gradient/reversal pipeline that proved fragile in practice — on a single real 10-qubit measurement it variously missed obvious crossings or reported them substantially offset for several distinct reasons (a background T2 so short the adaptive threshold never triggered; a reversal split across a run of faulty fits; the step-to-step gradient check never trying the one pair that actually showed a reversal; snapping to whichever bracketing step had the lower T2 instead of the midpoint between them) — in favour of reusing the simpler, empirically more consistent frequency-jump detector and using T2 only to validate and rank its crossings.spectroscopy_style: frequency-only jump detection with its own fixed (non-adaptive) threshold (spectroscopy_style_jump_threshold_hz) and no T2 involvement at all — kept unchanged for direct comparison against the primary algorithm. Note that, unlike in qubit spectroscopy vs current, resonator crossings are not removed here: no resonator crossing points are read from Redis and there is noresonator_crossing_intervalfilter, so a jump caused by a resonator crossing can be reported as a coupler crossing.
The current thresholds are optimized for a current step size of 50 µA, same as the other _vs_current nodes.
Absolute frequency baseline: _lookup_previous_frequency#
The fitted Ramsey (beat) frequency is converted to the qubit’s actual frequency via f_qubit = f_previous + detuning - f_ramsey, where f_previous is that qubit’s f01 (or f12) baseline. This baseline is a per-qubit constant offset, so it has no effect on crossing detection (jump/T2-based detection is invariant to it) — it only affects the absolute frequency values reported and plotted.
f_previous always prefers the live, most-recently-calibrated value from the active device session (ActiveSession.get().device.elements[qubit].clock_freqs.f01/f12) — the value real upstream calibration nodes (e.g. qubit_spectroscopy) have written onto the device during the same bring-up chain. Only when no session is active, the qubit isn’t in the session’s device, or the live value is exactly 0.0 (e.g. analysing a recorded dataset offline, with no session at all) does it fall back to parameters.factory_device_yaml, reading that qubit’s clock_freqs.f01/f12 directly out of a device template YAML (e.g. device_templates/example_chip/device.yaml). That template value is a factory/design placeholder, never a calibrated measurement — using it is never silent: previous_frequency_is_factory_fallback is set, and add_trace adds a visible red warning directly on the per-qubit frequency plot. With factory_device_yaml unset (the default), the baseline is 0.0.
Parameters class: QubitRamseyFreqVsCurrentParameters#
Extends RamseyParameters (see Ramsey fringes) with the external DC-current sweep and crossing-detection settings below (see Parameter field categories).
Unlike plain ramsey_fringes, this node fits a single Ramsey trace (one artificial detuning) at every current step rather than sweeping several detunings for a linear frequency-correction fit — artificial_detunings is overridden to a single-value default, and only transition="01", sequence="x90_x90" is registered as a legal variant combination.
min_current/max_current/current_step: DC-current sweep range and step, in Amps (default -2.5e-3 / 2.5e-3 / 50e-6).tau_min_fraction_of_delay_span/freq_min_cycles_in_delay_span/freq_nyquist_margin_fraction: the three additional per-fit trustworthiness checks beyond R² — see_is_trustworthy_ramsey_fitabove (defaults 0.5, 0.5, 0.05).freq_crossing_fraction: minimum frequency jump to accept a candidate crossing, as a fraction of the qubit’s own full valid-frequency range (default 0.40) — scales per qubit/chip instead of one fixed Hz value.min_crossing_freq_gradient_hz: hard upper bound (Hz) for the adaptive threshold above; matchesspectroscopy_style_jump_threshold_hz’s default (2e6) since both algorithms share the same underlying jump detector.min_crossing_jump_floor_hz: hard lower bound (Hz) for the same adaptive threshold (default 1e6) — prevents false crossings on a qubit with no real crossing in the swept range (seet2_and_frequencyabove). Must be strictly belowmin_crossing_freq_gradient_hz.crossing_refine_search_radius: current steps searched on either side of a detected jump for the two-sided check and for locating the two steps that bracket it for midpoint refinement (default 6).crossing_detection_algorithm:"t2_and_frequency"(default) or"spectroscopy_style".spectroscopy_style_jump_threshold_hz: fixed jump threshold used only by the standalonespectroscopy_stylealgorithm.spectroscopy_style_spurious_threshold_hz/spectroscopy_style_min_interval_a: used by both algorithms — gap-filling a single failed-fit point, and (fort2_and_frequency) the distance within which two refined crossings are merged into one.max_fit_workers: worker processes for the per-current-slice fits;Noneauto-sizes to the machine’s core count.factory_device_yaml: path to a device template YAML read as a factory-value fallback for the f01/f12 baseline — see_lookup_previous_frequencyabove (defaultNone, disabling the fallback).