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.
- 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 a list of parametrized QV quantum circuits, with measurements at the end.
Generate an array of as many random parameters as needed by the QV template circuits.
Generate a single parametrized QV quantum circuit, with measurements at the end.
Generates CLOPS circuit templates transpiled to the backend's physical layout
- Parameters:
backend_arg (IQMBackendBase | str) –
configuration (CLOPSConfiguration) –
- 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:
- 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.
- 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
- 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