iqm.benchmarks.optimization.qscore.QScoreBenchmark#
- class iqm.benchmarks.optimization.qscore.QScoreBenchmark(backend_arg: IQMBackendBase, configuration: QScoreConfiguration)#
Bases:
BenchmarkQ-score estimates the size of combinatorial optimization problems a given number of qubits can execute with meaningful results.
Attributes
nameMethods
add_all_meta_to_dataset(dataset)Adds all configuration metadata and circuits to the dataset variable
analysis_function(run)Analysis function for a QScore experiment
choose_qubits_custom(num_qubits)Choose the qubits to execute the circuits on, according to elements in custom_qubits_array matching num_qubits number of qubits
choose_qubits_naive(num_qubits)Choose the qubits to execute the circuits on, sequentially starting at qubit 0.
execute(backend)Executes the benchmark.
generate_maxcut_ansatz(graph, theta[, rzz_list])Generate an ansatz circuit for QAOA MaxCut, with measurements at the end.
generate_maxcut_ansatz_star(graph, theta)Generate an ansatz circuit for QAOA MaxCut, with measurements at the end.
Approximate a minimum vertex cover for a given graph, providing a mapping of nodes to the edges they cover.
- Parameters:
backend_arg (IQMBackendBase) –
configuration (QScoreConfiguration) –
- static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#
Analysis function for a QScore experiment
- Parameters:
run (RunResult) – A QScore experiment run for which analysis result is created
- Returns:
AnalysisResult corresponding to QScore
- Return type:
- greedy_vertex_cover_with_mapping(G: Graph)#
Approximate a minimum vertex cover for a given graph, providing a mapping of nodes to the edges they cover.
- Parameters:
G (nx.Graph) – The input graph for which the vertex cover is to be computed.
- Returns:
A dictionary where keys are nodes and values are lists of edges that each node covers.
- Return type:
- generate_maxcut_ansatz_star(graph, theta)#
Generate an ansatz circuit for QAOA MaxCut, with measurements at the end.
- generate_maxcut_ansatz(graph: Graph, theta: list[float], rzz_list=None) QuantumCircuit#
Generate an ansatz circuit for QAOA MaxCut, with measurements at the end.
- add_all_meta_to_dataset(dataset: Dataset)#
Adds all configuration metadata and circuits to the dataset variable
- Parameters:
dataset (xr.Dataset) – The xarray dataset
- static choose_qubits_naive(num_qubits: int) list[int]#
Choose the qubits to execute the circuits on, sequentially starting at qubit 0.
- choose_qubits_custom(num_qubits: int) list[int]#
Choose the qubits to execute the circuits on, according to elements in custom_qubits_array matching num_qubits number of qubits
- execute(backend: IQMBackendBase) Dataset#
Executes the benchmark.
- Parameters:
backend (IQMBackendBase) –
- Return type:
Dataset