uniqc.calibration.xeb.topology module¶
Chip topology utilities for parallel-CZ XEB calibration.
These helpers wrap a uniqc.cli.chip_info.ChipCharacterization
into a lightweight view (per-qubit / per-pair fidelities + adjacency)
that the parallel-CZ XEB workflow uses to pick a region and build
parallel CZ patterns.
The primitives here are generic — no UU15 or paper-specific logic.
Public API¶
ChipTopologyView— adapter overChipCharacterizationRegion— connected qubit subset + induced edgespick_region()— fidelity-weighted greedy seed-and-growpick_chain_region()— best chord-free linear chainparallel_patterns()— DSatur edge-coloring of a list of edgesthree_color_chip()— chip-wide partition into≤max_Kmatchings
- class uniqc.calibration.xeb.topology.ChipTopologyView(enabled_qubits, coupling_map, e_1q, e_2q, e_ro, notes=())[source]¶
Bases:
objectLightweight per-qubit / per-pair fidelity view over a chip.
e_1q[q],e_ro[q]ande_2q[(min(a,b), max(a,b))]are error rates in[0, 1]. Missing entries fall back to safe defaults (1e-3 single-qubit, 1e-2 readout, chip-wide 2q-median).- Parameters:
- class uniqc.calibration.xeb.topology.Region(qubits, edges, score)[source]¶
Bases:
objectA connected induced subgraph of a chip’s coupling graph.
- uniqc.calibration.xeb.topology.parallel_patterns(edges, *, max_K=8)[source]¶
DSatur edge-coloring of
edgesinto edge-disjoint matchings.Returns a tuple of patterns
(P_0, ..., P_{K-1}). Each pattern is a tuple of(a, b)edges with no qubit appearing twice in the same pattern. If the maximum vertex degree exceedsmax_Kthe coloring may spill an edge into a non-empty class — increasemax_KtoΔ + 1to avoid that.
- uniqc.calibration.xeb.topology.pick_chain_region(view, length, *, forced_qubits=None)[source]¶
Best chord-free linear chain
q0 — q1 — … — q_{L-1}of lengthlength.A “chord-free” chain has only the consecutive edges in its induced subgraph (no shortcuts). Useful for MPS-friendly experiments.
If
forced_qubitsis given, validate it as a chain and return it directly. Otherwise enumerate simple paths.- Parameters:
view (ChipTopologyView)
length (int)
- Return type:
- uniqc.calibration.xeb.topology.pick_region(view, n, *, seed=0)[source]¶
Select
nconnected qubits maximisingΣ log f_v + Σ log f_e.Uses greedy seed-and-grow over the highest-fidelity vertex, then a seed-deterministic SA polish. Raises if no connected region of the requested size exists.
- Parameters:
view (ChipTopologyView)
n (int)
seed (int)
- Return type: