iqm.benchmarks.randomized_benchmarking.direct_rb.direct_rb.DirectRandomizedBenchmarking#

class iqm.benchmarks.randomized_benchmarking.direct_rb.direct_rb.DirectRandomizedBenchmarking(backend_arg: IQMBackendBase | str, configuration: DirectRBConfiguration)#

Bases: Benchmark

Direct RB estimates the fidelity of layers of canonical gates.

Attributes

Methods

add_all_meta_to_dataset(dataset)

Adds all configuration metadata and circuits to the dataset variable.

analysis_function(run)

Direct RB analysis function.

assign_inputs_to_qubits()

Assigns all DRB inputs to input qubit layouts.

execute(backend)

Executes the Direct Randomized Benchmarking benchmark.

name()

Returns the name of the benchmark.

submit_single_drb_job(backend_arg, qubits, ...)

Submit fixed-depth DRB jobs for execution in the specified IQMBackend.

Parameters:
static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#

Direct RB analysis function.

Parameters:

run (BenchmarkRunResult) – The result of the benchmark run.

Returns:

AnalysisResult corresponding to DRB.

Return type:

BenchmarkAnalysisResult

classmethod name() str#

Returns the name of the benchmark.

Return type:

str

add_all_meta_to_dataset(dataset: Dataset) None#

Adds all configuration metadata and circuits to the dataset variable.

Parameters:

dataset (Dataset) – The xarray dataset

Return type:

None

assign_inputs_to_qubits() tuple[Sequence[int], dict[str, dict[str, float]], dict[str, float], dict[str, float], dict[str, dict[str, float] | None]]#

Assigns all DRB inputs to input qubit layouts.

This method processes optional configuration parameters and assigns them to each qubit layout. If a parameter is not provided or has insufficient values for all qubit layouts, default values are assigned. The method handles different behaviors for EPLG (Edge-Grab Pauli Layers) mode.

Returns:

  • assigned_drb_depths: Sequence of DRB circuit depths.

  • assigned_two_qubit_gate_ensembles: Dictionary mapping qubit layout strings to dictionaries of two-qubit gate names and their sampling probabilities.

  • assigned_density_2q_gates: Dictionary mapping qubit layout strings to the density of two-qubit gates (probability of sampling 2Q gates per qubit per layer).

  • assigned_clifford_sqg_probabilities: Dictionary mapping qubit layout strings to the probability of sampling Clifford single-qubit gates.

  • assigned_sqg_gate_ensembles: Dictionary mapping qubit layout strings to dictionaries of single-qubit gate names and their sampling probabilities, or None to indicate Clifford-only sampling.

Return type:

A tuple containing

submit_single_drb_job(backend_arg: IQMBackendBase, qubits: Sequence[int], depth: int, sorted_transpiled_circuit_dicts: dict[tuple[int, ...], list[IQMCircuit]]) dict[str, Any]#

Submit fixed-depth DRB jobs for execution in the specified IQMBackend.

Parameters:
  • backend_arg (IQMBackendBase) – the IQM backend to submit the job to

  • qubits (Sequence[int]) – the qubits to identify the submitted job

  • depth (int) – the depth (number of canonical layers) of the circuits to identify the submitted job

  • sorted_transpiled_circuit_dicts (dict[tuple[int, ...], list[IQMCircuit]]) – A dictionary containing all MRB circuits

Returns:

Dict with qubit layout, depth, submitted job objects, and submission time

Return type:

dict[str, Any]

execute(backend: IQMBackendBase) Dataset#

Executes the Direct Randomized Benchmarking benchmark.

Parameters:

backend (IQMBackendBase) – The IQM backend to execute the benchmark on

Returns:

Dataset containing benchmark results and metadata

Return type:

Dataset