iqm.benchmarks.randomized_benchmarking.randomized_benchmarking_common.edge_grab#
- iqm.benchmarks.randomized_benchmarking.randomized_benchmarking_common.edge_grab(qubit_set: List[int] | Sequence[int], n_layers: int, backend_arg: IQMBackendBase | str, density_2q_gates: float = 0.25, two_qubit_gate_ensemble: Dict[str, float] | None = None, clifford_sqg_probability=1.0, sqg_gate_ensemble: Dict[str, float] | None = None) List[IQMCircuit] #
Generate a list of random layers containing single-qubit Cliffords and two-qubit gates, sampled according to the edge-grab algorithm (see arXiv:2204.07568 [quant-ph]).
- Parameters:
qubit_set (List[int]) – The set of qubits of the backend.
n_layers (int) – The number of layers.
backend_arg (IQMBackendBase | str) – IQM backend.
density_2q_gates (float) – The expected density of 2Q gates in a circuit formed by subsequent application of layers. * Default is 0.25
two_qubit_gate_ensemble (Optional[Dict[str, float]]) – A dictionary with keys being str specifying 2Q gates, and values being corresponding probabilities. * Default is None.
clifford_sqg_probability (float) – Probability with which to uniformly sample Clifford 1Q gates. * Default is 1.0.
sqg_gate_ensemble (Optional[Dict[str, float]]) – A dictionary with keys being str specifying 1Q gates, and values being corresponding probabilities. * Default is None.
- Raises:
ValueError – if the probabilities in the gate ensembles do not add up to unity.
- Returns:
the list of gate layers, in the form of quantum circuits.
- Return type:
List[QuantumCircuit]