uniqc.calibration.xeb.circuits module¶
Random circuit generators for cross-entropy benchmarking (XEB).
Generates 1-qubit and 2-qubit XEB circuits in OriginIR format using the Circuit builder API.
- uniqc.calibration.xeb.circuits.generate_1q_xeb_circuits(qubit, depths, n_circuits=50, seed=None)[source]¶
Generate random 1-qubit XEB circuits.
Each circuit consists of
depthrandom single-qubit layers, followed by measurement. The circuits are designed to measure the per-layer depolarizing fidelity by fitting the exponential decay of the normalized linear XEB estimator as depth increases.- Parameters:
- Returns:
List of
Circuitobjects, one per (depth, circuit_index) pair. The total number of circuits islen(depths) * n_circuits.- Return type:
- uniqc.calibration.xeb.circuits.generate_2q_xeb_circuit(qubit_u, qubit_v, depth, entangler_gate='CNOT', seed=None)[source]¶
Generate a single random 2-qubit XEB circuit.
- Each layer consists of:
Random single-qubit gate on each qubit
The specified entangling gate on the pair
- Parameters:
- Returns:
A single
Circuitobject.- Return type:
- uniqc.calibration.xeb.circuits.generate_2q_xeb_circuits(qubit_u, qubit_v, depths, n_circuits=50, entangler_gate='CNOT', seed=None)[source]¶
Generate random 2-qubit XEB circuits for a single qubit pair.
- Parameters:
- Returns:
List of
Circuitobjects.- Return type:
- uniqc.calibration.xeb.circuits.generate_parallel_2q_xeb_circuits(pairs, depth, entangler_gates, n_circuits=50, seed=None)[source]¶
Generate parallel 2-qubit XEB circuits.
All pairs are executed in parallel (within a single multi-qubit circuit) at each layer. This simulates full-chip parallel execution where disjoint pairs of qubits execute 2-qubit gates simultaneously.
- Parameters:
pairs (list[tuple[int, int]]) – List of qubit pairs to include in parallel.
depth (int) – Number of random layers per pair.
entangler_gates (dict[tuple[int, int], str]) – Mapping from pair to entangler gate name. Falls back to “CNOT” for any pair not in the dict.
n_circuits (int) – Number of parallel circuits to generate.
seed (int | None) – Random seed.
- Returns:
one circuit per
n_circuits. Inner list: oneCircuitper pair (all measured in the same circuit object — a single multi-qubit circuit). Actually returns a list of Circuits where each Circuit operates on all qubits in the union of all pairs.- Return type:
List of lists of
Circuitobjects. Outer list