iqm.benchmarks.quantum_volume.quantum_volume.QuantumVolumeBenchmark#

class iqm.benchmarks.quantum_volume.quantum_volume.QuantumVolumeBenchmark(backend_arg: IQMBackendBase | str, configuration: QuantumVolumeConfiguration)#

Bases: Benchmark

Quantum Volume reflects the deepest circuit a given number of qubits can execute with meaningful results.

Attributes

name

Methods

add_all_circuits_to_dataset(dataset)

Adds all generated circuits during execution to the dataset variable

add_all_meta_to_dataset(dataset)

Adds all configuration metadata and circuits to the dataset variable

analysis_function(run)

Analysis function for a Quantum Volume experiment

execute(backend)

Executes the benchmark.

generate_circuit_list(num_qubits[, depth, ...])

Generate a list of QV quantum circuits, with measurements at the end.

generate_single_circuit(num_qubits[, depth, ...])

Generate a single QV quantum circuit, with measurements at the end.

get_rem_quasidistro(...)

Computes readout-error-mitigated quasiprobabilities.

submit_single_qv_job(backend, qubits, ...)

Submit jobs for execution in the specified IQMBackend.

Parameters:
static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#

Analysis function for a Quantum Volume experiment

Parameters:

run (RunResult) – A Quantum Volume experiment run for which analysis result is created

Returns:

AnalysisResult corresponding to Quantum Volume

Return type:

BenchmarkAnalysisResult

add_all_meta_to_dataset(dataset: Dataset)#

Adds all configuration metadata and circuits to the dataset variable

Parameters:

dataset (xr.Dataset) – The xarray dataset

add_all_circuits_to_dataset(dataset: Dataset)#

Adds all generated circuits during execution to the dataset variable

Parameters:

dataset (xr.Dataset) – The xarray dataset

Returns:

static generate_single_circuit(num_qubits: int, depth: int | None = None, classical_permutation: bool = True) IQMCircuit#

Generate a single QV quantum circuit, with measurements at the end.

Parameters:
  • num_qubits (int) – number of qubits of the circuit

  • depth (Optional[int]) – The depth of the QV circuit. Defaults to None, which makes it equal to the number of qubits.

  • classical_permutation (bool, optional) – Whether permutations are classical, avoiding swapping layers. * Defaults to True.

Returns:

the QV quantum circuit.

Return type:

QuantumCircuit

generate_circuit_list(num_qubits: int, depth: int | None = None, classical_permutations: bool = True) List[IQMCircuit]#

Generate a list of QV quantum circuits, with measurements at the end.

Parameters:
  • num_qubits (int) – the number of qubits of the circuits.

  • depth (Optional[int]) – The depth of the QV circuit. Defaults to None, which makes it equal to the number of qubits.

  • classical_permutations (bool, optional) – Whether permutations are classical, avoiding swapping layers. * Defaults to True.

Returns:

the list of QV quantum circuits.

Return type:

List[QuantumCircuit]

get_rem_quasidistro(sorted_transpiled_qc_list: Dict[Tuple, List[IQMCircuit]], sorted_qc_list_indices: Dict[Tuple, List[int]], execution_results: List[Dict[str, int]], mit_shots: int) List[List[QuasiCollection]]#

Computes readout-error-mitigated quasiprobabilities.

Parameters:
  • sorted_transpiled_qc_list (Dict[Tuple, List[QuantumCircuit]]) – A dictionary of lists of quantum circuits, indexed by qubiy layouts.

  • sorted_qc_list_indices (Dict[Tuple, List[int]]) – dictionary of indices (integers) corresponding to those in the original (untranspiled) list of circuits, with keys being final physical qubit measurements.

  • execution_results (List[Dict[str, int]]) – counts from execution of all quantum circuits.

  • mit_shots (int) – The number of measurement shots to estimate the readout calibration errors.

Returns:

A list of lists of quasiprobabilities.

Return type:

List[List[QuasiCollection]]

submit_single_qv_job(backend: IQMBackendBase, qubits: Sequence[int], sorted_transpiled_qc_list: Dict[Tuple[int, ...], List[IQMCircuit]]) Dict[str, Any]#

Submit jobs for execution in the specified IQMBackend.

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

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

  • sorted_transpiled_qc_list (Dict[str, List[QuantumCircuit]]) – qubits to submit jobs to.

Returns:

Dict with qubit layout, submitted job objects, type (vanilla/DD) and submission time.

Return type:

Dict[str, Any]

execute(backend: IQMBackendBase) Dataset#

Executes the benchmark.

Parameters:

backend (IQMBackendBase) –

Return type:

Dataset