quchip.chip.transformations.active_patch¶
Schedule-aware active-patch reduction: eliminate spectators, keep the driven patch.
The activity analysis is structural — scheduled targets plus hops
coupling-graph steps. Amplitudes, detunings, and rigorous error bounds are
declared out-of-scope refinements; the honesty signal is the per-step
Schrieffer-Wolff validity carried on the result, plus a UserWarning (see
_warn_on_poor_validity()) raised at fold time for any step whose
validity comes back poor — the reduction still proceeds, but the caller is
told which fold to distrust.
- quchip.chip.transformations.active_patch.coupling_adjacency(chip)[source]¶
Device-label adjacency of the chip’s coupling graph.
- quchip.chip.transformations.active_patch.active_labels(sequence, *, hops=1)[source]¶
Devices touched by the schedule, expanded
hopscoupling-graph steps.- Parameters:
sequence (QuantumSequence)
hops (int)
- Return type:
- quchip.chip.transformations.active_patch.graph_distances(adjacency, sources)[source]¶
BFS distance from
sources; labels unreachable from them are absent.
- class quchip.chip.transformations.active_patch.ActivePatchResult(chip, sequence, active_labels, eliminated_labels, steps, notes)[source]¶
Bases:
objectA reduced patch chip, the re-bound sequence, and the reduction’s honesty record.
- Parameters:
- chip¶
The patch chip: schedule-active devices plus whatever spectators
active_patch()could not eliminate (unreachable, or where elimination itself declined — seenotes).- Type:
Any
- sequence¶
A
QuantumSequencebound tochip, replaying the source sequence’s entries verbatim.- Type:
Any
- eliminated_labels¶
Device labels actually folded away, in elimination order (farthest-from-active first).
- steps¶
The
EliminationResultfrom each successfuleliminate()call, verbatim and ineliminated_labelsorder — reshape nothing here; read.validity/.effective_paramsoff the step objects through the convenience properties below.- Type:
- notes¶
Every explicitly dropped or deferred piece of physics: unreachable spectators left in place, control lines stripped as unused, and (if elimination itself couldn’t proceed past some spectator) why the reduction stopped early — plus every step’s own notes.
- property validity: dict[str, Any]¶
{eliminated label: that step's .validity}— verbatim, per-coupling shape untouched.
- quchip.chip.transformations.active_patch.active_patch(sequence, *, hops=1, method='sw')[source]¶
Reduce a chip to its schedule-active patch by eliminating spectators.
Spectators are eliminated one at a time via
eliminate(), farthest-from-active first; every step’s validity metrics ride on the result untouched. Explicit opt-in — this approximates (Schrieffer-Wolff, or the exact dressed-spectrum route undermethod="exact"), unlike the exact automatic partitioningsimulate()performs internally at solve time.The elimination order and reachability are recomputed from the current reduced chip before every step, not just once up front: a fold can only ever add a bridging edge between the eliminated mode’s neighbors, never remove one, so a label’s distance from the active set can shorten but never make a previously reachable label unreachable — still, reading the graph fresh each time means a label that has already been folded away is never re-considered, and the order always reflects what
eliminatewill actually see. Bridging edges created by earlier folds may beCapacitiveedges carryinggorTunableCapacitiveedges carryingg_0. Both fold onward, so cycles among spectators reduce all the way down. Ifeliminatestill declines a step (its typedNotImplementedErrorsignal for an unsupported elimination — e.g. a Purcell decay fold onto a survivor that carries thermal occupation, which no collapse-channel API can represent without inventing physics that was never present), the reduction stops there: everything eliminated so far stays folded, and the remaining spectators — including the one that failed — are left on the patch chip untouched, with the reason recorded innotes.- Parameters:
sequence (QuantumSequence) – The schedule to reduce around.
hops (int) – Coupling-graph hops the active set expands beyond the scheduled targets (see
active_labels()).method (str) – Forwarded to
eliminate()for every device elimination.
- Return type: