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

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.

name()

Returns the name of the benchmark.

submit_single_qv_job(backend, qubits, ...)

Submit a single set of QV jobs for execution in the specified IQMBackend.

Parameters:
static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#

Analysis function for a Quantum Volume experiment.

Parameters:

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

Returns:

AnalysisResult corresponding to Quantum Volume

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

add_all_circuits_to_dataset(dataset: Dataset) None#

Adds all generated circuits during execution to the dataset variable.

Parameters:

dataset (Dataset) – The xarray dataset

Return type:

None

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 (int | None) – The depth of the QV circuit. Defaults to None, which makes it equal to the number of qubits.

  • classical_permutation (bool) – Whether permutations are classical, avoiding swapping layers.

Returns:

The QV quantum circuit.

Return type:

IQMCircuit

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 (int | None) – The depth of the QV circuit. Defaults to None, which makes it equal to the number of

  • qubits.

  • classical_permutations (bool) – Whether permutations are classical, avoiding swapping layers.

Returns:

The list of QV quantum circuits.

Return type:

list[IQMCircuit]

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[IQMCircuit]]) – A dictionary of lists of quantum circuits, indexed by qubit 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 a single set of QV jobs for execution in the specified IQMBackend.

Organizes the results in a dictionary with the qubit layout, the submitted job objects, the type of QV results and submission time.

Parameters:
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