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

name

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(...)

param dict_parametrized_circs:

Dictionary with list of int (qubits) as keys and lists of parametrized quantum circuits as values

clops_cycle(backend, ...)

Executes a single CLOPS cycle (parameter assignment and execution) for the given update :param backend: the backend to execute the jobs with :type backend: IQMBackendBase :param sorted_transpiled_qc_list: A dictionary of lists of transpiled quantum circuits :type sorted_transpiled_qc_list: Dict[str, List[QuantumCircuit]] :param update: The current cycle update :type update: int

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

Parameters:
static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#

Analysis function for a CLOPS (v or h) experiment

Parameters:

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

Returns:

AnalysisResult corresponding to CLOPS

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

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 (QuantumCircuit) – 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[QuantumCircuit]

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:

np.ndarray[np.float64]

assign_random_parameters_to_all(dict_parametrized_circs: Dict[Tuple, List[IQMCircuit]], optimize_sqg: bool) Tuple[List[List[float]], Dict[Tuple, List[IQMCircuit]]]#
Parameters:
  • dict_parametrized_circs (Dict[Tuple, List[QuantumCircuit]]) – 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 :param backend: the backend to execute the jobs with :type backend: IQMBackendBase :param sorted_transpiled_qc_list: A dictionary of lists of transpiled quantum circuits :type sorted_transpiled_qc_list: Dict[str, List[QuantumCircuit]] :param update: The current cycle update :type update: int

Returns:

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

Return type:

Tuple[float, float, float]

Parameters:
  • backend (IQMBackendBase) –

  • sorted_transpiled_qc_list (Dict[Tuple, List[IQMCircuit]]) –

  • update (int) –

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[str, QuantumCircuit]

execute(backend: IQMBackendBase) Dataset#

Executes the benchmark

Parameters:

backend (IQMBackendBase) –

Return type:

Dataset