iqm.benchmarks.quantum_volume.clops.CLOPSBenchmark#

class iqm.benchmarks.quantum_volume.clops.CLOPSBenchmark(backend_arg: IQMBackendBase | str, configuration: CLOPSConfiguration)#

Bases: Benchmark

CLOPS reflect the speed of execution of parametrized QV circuits.

Attributes

Methods

add_all_meta_to_dataset(dataset)

Adds all configuration metadata and circuits to the dataset variable.

analysis_function(run)

Analysis function for a CLOPS (v or h) experiment.

append_parameterized_unitary(qc, q0, q1, ...)

Append a decomposed, parametrized SU(4) gate using CX gates to the given quantum circuit.

assign_random_parameters_to_all(...)

Assigns random parameters to all parametrized circuits.

clops_cycle(backend, ...)

Executes a single CLOPS cycle (parameter assignment and execution) for the given update.

execute(backend)

Executes the benchmark.

generate_circuit_list()

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

generate_random_parameters()

Generate an array of as many random parameters as needed by the QV template circuits.

generate_single_circuit()

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

generate_transpiled_clops_templates()

Generates CLOPS circuit templates transpiled to the backend's physical layout.

name()

Returns the name of the benchmark.

Parameters:
static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#

Analysis function for a CLOPS (v or h) experiment.

Parameters:

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

Returns:

AnalysisResult corresponding to CLOPS

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

append_parameterized_unitary(qc: IQMCircuit, q0: int, q1: int, layer: int, pair: int) None#

Append a decomposed, parametrized SU(4) gate using CX gates to the given quantum circuit.

Parameters:
  • qc (IQMCircuit) – The quantum circuit to append the SU(4) gate to

  • q0 (int) – The first qubit involved in the gate

  • q1 (int) – The second qubit involved in the gate

  • layer (int) – The QV layer the gate belongs to

  • pair (int) – The pair index corresponding to the gate

Return type:

None

generate_single_circuit() IQMCircuit#

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

Returns:

the QV quantum circuit.

Return type:

QuantumCircuit

generate_circuit_list() list[IQMCircuit]#

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

Returns:

The list of parametrized QV quantum circuits.

Return type:

list[IQMCircuit]

generate_random_parameters() ndarray#

Generate an array of as many random parameters as needed by the QV template circuits.

Returns:

The array of random parameters

Return type:

ndarray

assign_random_parameters_to_all(dict_parametrized_circs: dict[tuple, list[IQMCircuit]], optimize_sqg: bool) tuple[list[list[float]], dict[tuple, list[IQMCircuit]]]#

Assigns random parameters to all parametrized circuits.

Parameters:
  • dict_parametrized_circs (dict[tuple, list[IQMCircuit]]) – Dictionary with list of int (qubits) as keys and lists of parametrized quantum circuits as values

  • optimize_sqg (bool) – Whether single qubit gate optimization is applied

Returns:

  • lists of list of float parameter values corresponding to param updates

  • dictionary with lists of int (qubits) as keys and lists of quantum circuits as values

Return type:

A tuple of dictionaries

clops_cycle(backend: IQMBackendBase, sorted_transpiled_qc_list: dict[tuple, list[IQMCircuit]], update: int) tuple[float, float, float]#

Executes a single CLOPS cycle (parameter assignment and execution) for the given update.

Parameters:
  • backend (IQMBackendBase) – The backend to execute the jobs with

  • sorted_transpiled_qc_list (dict[tuple, list[IQMCircuit]]) – A dictionary of lists of transpiled quantum circuits

  • update (int) – The current cycle update

Returns:

The elapsed times for parameter assignment, submission and retrieval of jobs

Return type:

tuple[float, float, float]

generate_transpiled_clops_templates() dict[tuple, list[IQMCircuit]]#

Generates CLOPS circuit templates transpiled to the backend’s physical layout.

Returns:

A dictionary of quantum circuits with keys being str(qubit layout)

Return type:

dict[tuple, list[IQMCircuit]]

execute(backend: IQMBackendBase) Dataset#

Executes the benchmark.

Parameters:

backend (IQMBackendBase)

Return type:

Dataset