iqm-benchmarks 2.24__py3-none-any.whl → 2.26__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of iqm-benchmarks might be problematic. Click here for more details.
- iqm/benchmarks/benchmark.py +5 -1
- iqm/benchmarks/compressive_gst/compressive_gst.py +26 -21
- iqm/benchmarks/compressive_gst/gst_analysis.py +27 -22
- iqm/benchmarks/entanglement/ghz.py +1 -0
- iqm/benchmarks/optimization/qscore.py +7 -5
- iqm/benchmarks/quantum_volume/clops.py +1 -0
- iqm/benchmarks/quantum_volume/quantum_volume.py +3 -2
- iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py +11 -4
- iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py +10 -6
- iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py +4 -3
- iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py +23 -13
- iqm/benchmarks/utils.py +38 -14
- {iqm_benchmarks-2.24.dist-info → iqm_benchmarks-2.26.dist-info}/METADATA +6 -4
- {iqm_benchmarks-2.24.dist-info → iqm_benchmarks-2.26.dist-info}/RECORD +17 -17
- {iqm_benchmarks-2.24.dist-info → iqm_benchmarks-2.26.dist-info}/WHEEL +1 -1
- {iqm_benchmarks-2.24.dist-info → iqm_benchmarks-2.26.dist-info/licenses}/LICENSE +0 -0
- {iqm_benchmarks-2.24.dist-info → iqm_benchmarks-2.26.dist-info}/top_level.txt +0 -0
iqm/benchmarks/benchmark.py
CHANGED
|
@@ -51,6 +51,7 @@ class BenchmarkBase(ABC):
|
|
|
51
51
|
self.shots = self.configuration.shots
|
|
52
52
|
self.calset_id = self.configuration.calset_id
|
|
53
53
|
self.max_gates_per_batch = self.configuration.max_gates_per_batch
|
|
54
|
+
self.max_circuits_per_batch = self.configuration.max_circuits_per_batch
|
|
54
55
|
|
|
55
56
|
self.routing_method = self.configuration.routing_method
|
|
56
57
|
self.physical_layout = self.configuration.physical_layout
|
|
@@ -92,6 +93,8 @@ class BenchmarkConfigurationBase(BaseModel):
|
|
|
92
93
|
* Default for all benchmarks is 2**8.
|
|
93
94
|
max_gates_per_batch (Optional[int]): the maximum number of gates per circuit batch.
|
|
94
95
|
* Default for all benchmarks is None.
|
|
96
|
+
max_circuits_per_batch (Optional[int]): the maximum number of circuits per batch.
|
|
97
|
+
* Default for all benchmarks is None.
|
|
95
98
|
calset_id (Optional[str]): the calibration ID to use in circuit execution.
|
|
96
99
|
* Default for all benchmarks is None (uses last available calibration ID).
|
|
97
100
|
routing_method (Literal["basic", "lookahead", "stochastic", "sabre", "none"]): the Qiskit routing method to use in transpilation.
|
|
@@ -100,13 +103,14 @@ class BenchmarkConfigurationBase(BaseModel):
|
|
|
100
103
|
- "fixed": physical layout is constrained during transpilation to the selected initial physical qubits.
|
|
101
104
|
- "batching": physical layout is allowed to use any other physical qubits, and circuits are batched according to final measured qubits.
|
|
102
105
|
* Default for all benchmarks is "fixed".
|
|
103
|
-
|
|
106
|
+
use_dd (bool): Boolean flag determining whether to enable dynamical decoupling during circuit execution.
|
|
104
107
|
* Default: False
|
|
105
108
|
"""
|
|
106
109
|
|
|
107
110
|
benchmark: Type[BenchmarkBase]
|
|
108
111
|
shots: int = 2**8
|
|
109
112
|
max_gates_per_batch: Optional[int] = None
|
|
113
|
+
max_circuits_per_batch: Optional[int] = None
|
|
110
114
|
calset_id: Optional[str] = None
|
|
111
115
|
routing_method: Literal["basic", "lookahead", "stochastic", "sabre", "none"] = "sabre"
|
|
112
116
|
physical_layout: Literal["fixed", "batching"] = "fixed"
|
|
@@ -81,10 +81,7 @@ class CompressiveGST(Benchmark):
|
|
|
81
81
|
if configuration.opt_method not in ["GD", "SFN", "auto"]:
|
|
82
82
|
raise ValueError("Invalid optimization method, valid options are: GD, SFN, auto")
|
|
83
83
|
if configuration.opt_method == "auto":
|
|
84
|
-
|
|
85
|
-
self.opt_method = "GD"
|
|
86
|
-
else:
|
|
87
|
-
self.opt_method = "SFN"
|
|
84
|
+
self.opt_method = "GD" # Currently the fastest method in all cases
|
|
88
85
|
else:
|
|
89
86
|
self.opt_method = configuration.opt_method
|
|
90
87
|
|
|
@@ -160,17 +157,23 @@ class CompressiveGST(Benchmark):
|
|
|
160
157
|
"Qubit layouts can't overlap when parallel_execution is enabled, please choose non-overlapping layouts."
|
|
161
158
|
)
|
|
162
159
|
raw_qc_list_parallel = []
|
|
160
|
+
if "move" in self.backend.operation_names:
|
|
161
|
+
backend_qubits = np.arange(1, self.backend.num_qubits)
|
|
162
|
+
qubit_layouts = [[q - 1 for q in layout] for layout in self.qubit_layouts]
|
|
163
|
+
else:
|
|
164
|
+
backend_qubits = np.arange(self.backend.num_qubits)
|
|
165
|
+
qubit_layouts = self.qubit_layouts
|
|
163
166
|
for circ in raw_qc_list:
|
|
164
|
-
circ_parallel = QuantumCircuit(
|
|
167
|
+
circ_parallel = QuantumCircuit(len(backend_qubits), len(set(all_qubits)))
|
|
165
168
|
clbits = np.arange(self.num_qubits)
|
|
166
|
-
for qubit_layout in
|
|
169
|
+
for qubit_layout in qubit_layouts:
|
|
167
170
|
circ_parallel.compose(circ, qubits=qubit_layout, clbits=clbits, inplace=True)
|
|
168
171
|
clbits += self.num_qubits
|
|
169
172
|
raw_qc_list_parallel.append(circ_parallel)
|
|
170
173
|
transpiled_qc_list, _ = perform_backend_transpilation(
|
|
171
174
|
raw_qc_list_parallel,
|
|
172
175
|
self.backend,
|
|
173
|
-
qubits=
|
|
176
|
+
qubits=backend_qubits,
|
|
174
177
|
coupling_map=self.backend.coupling_map,
|
|
175
178
|
qiskit_optim_level=0,
|
|
176
179
|
optimize_sqg=False,
|
|
@@ -239,6 +242,7 @@ class CompressiveGST(Benchmark):
|
|
|
239
242
|
self.configuration.shots,
|
|
240
243
|
self.calset_id,
|
|
241
244
|
max_gates_per_batch=self.configuration.max_gates_per_batch,
|
|
245
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
242
246
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
243
247
|
)
|
|
244
248
|
# Retrieve
|
|
@@ -255,6 +259,7 @@ class CompressiveGST(Benchmark):
|
|
|
255
259
|
self.configuration.shots,
|
|
256
260
|
self.calset_id,
|
|
257
261
|
max_gates_per_batch=self.configuration.max_gates_per_batch,
|
|
262
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
258
263
|
)
|
|
259
264
|
# Retrieve all
|
|
260
265
|
qcvv_logger.info(f"Now executing the corresponding circuit batch")
|
|
@@ -386,7 +391,7 @@ def parse_gate_set(
|
|
|
386
391
|
gate_set: List[QuantumCircuit]
|
|
387
392
|
A list of gates defined as quantum circuit objects
|
|
388
393
|
gate_labels_dict: Dict[str, Dict[int, str]]
|
|
389
|
-
The names of gates, i.e. "
|
|
394
|
+
The names of gates, i.e. "Rx_pi_2" for a pi/2 rotation around the x-axis.
|
|
390
395
|
num_gates: int
|
|
391
396
|
The number of gates in the gate set
|
|
392
397
|
|
|
@@ -445,7 +450,7 @@ def create_predefined_gate_set(
|
|
|
445
450
|
gates: List[QuantumCircuit]
|
|
446
451
|
The gate set as a list of circuits
|
|
447
452
|
gate_labels_dict: Dict[str, Dict[int, str]]
|
|
448
|
-
The names of gates, i.e. "
|
|
453
|
+
The names of gates, i.e. "Rx_pi_2" for a pi/2 rotation around the x-axis.
|
|
449
454
|
num_gates: int
|
|
450
455
|
The number of gates in the gate set
|
|
451
456
|
|
|
@@ -458,7 +463,7 @@ def create_predefined_gate_set(
|
|
|
458
463
|
gate_qubits = [[0], [0], [0]]
|
|
459
464
|
for i, gate in enumerate(gate_list):
|
|
460
465
|
gates[i].append(gate, gate_qubits[i])
|
|
461
|
-
gate_labels = ["Idle", "
|
|
466
|
+
gate_labels = ["Idle", "Rx_pi_2", "Ry_pi_2"]
|
|
462
467
|
elif gate_set == "2QXYCZ":
|
|
463
468
|
gate_qubits = [[0], [1], [0], [1], [0, 1]]
|
|
464
469
|
gates = [QuantumCircuit(num_qubits, 0) for _ in range(5)]
|
|
@@ -467,7 +472,7 @@ def create_predefined_gate_set(
|
|
|
467
472
|
gates[2].append(RGate(0.5 * np.pi, np.pi / 2), [0])
|
|
468
473
|
gates[3].append(RGate(0.5 * np.pi, np.pi / 2), [1])
|
|
469
474
|
gates[4].append(CZGate(), [0, 1])
|
|
470
|
-
gate_labels = ["
|
|
475
|
+
gate_labels = ["Rx_pi_2", "Rx_pi_2", "Ry_pi_2", "Ry_pi_2", "cz"]
|
|
471
476
|
elif gate_set == "2QXYCZ_extended":
|
|
472
477
|
gate_qubits = [[0], [1], [0], [1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1]]
|
|
473
478
|
gates = [QuantumCircuit(num_qubits, 0) for _ in range(9)]
|
|
@@ -485,14 +490,14 @@ def create_predefined_gate_set(
|
|
|
485
490
|
gates[7].append(RGate(0.5 * np.pi, np.pi / 2), [1])
|
|
486
491
|
gates[8].append(CZGate(), [[0], [1]])
|
|
487
492
|
gate_labels = [
|
|
488
|
-
"
|
|
489
|
-
"
|
|
490
|
-
"
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
"
|
|
494
|
-
"
|
|
495
|
-
"
|
|
493
|
+
"Rx_pi_2",
|
|
494
|
+
"Rx_pi_2",
|
|
495
|
+
"Ry_pi_2",
|
|
496
|
+
"Ry_pi_2",
|
|
497
|
+
"Rx_pi_2-Rx_pi_2",
|
|
498
|
+
"Rx_pi_2-Ry_pi_2",
|
|
499
|
+
"Ry_pi_2-Rx_pi_2",
|
|
500
|
+
"Ry_pi_2-Ry_pi_2",
|
|
496
501
|
"CZ",
|
|
497
502
|
]
|
|
498
503
|
elif gate_set == "3QXYCZ":
|
|
@@ -510,7 +515,7 @@ def create_predefined_gate_set(
|
|
|
510
515
|
gate_qubits = [[0], [1], [2], [0], [1], [2], [0, 1], [0, 2]]
|
|
511
516
|
for i, gate in enumerate(gate_list):
|
|
512
517
|
gates[i].append(gate, gate_qubits[i])
|
|
513
|
-
gate_labels = ["
|
|
518
|
+
gate_labels = ["Rx_pi_2", "Rx_pi_2", "Rx_pi_2", "Ry_pi_2", "Ry_pi_2", "Ry_pi_2", "cz", "cz"]
|
|
514
519
|
else:
|
|
515
520
|
raise ValueError(
|
|
516
521
|
f"Invalid gate set, choose among 1QXYI, 2QXYCZ, 2QXYCZ_extended,"
|
|
@@ -526,6 +531,6 @@ def create_predefined_gate_set(
|
|
|
526
531
|
iqm_qubits = [f"QB{q + 1}" for q in qubit_layout]
|
|
527
532
|
gate_qubits_iqm = [(iqm_qubits[q] for q in qubits) for qubits in gate_qubits]
|
|
528
533
|
for key, value in layout_label_dict.items():
|
|
529
|
-
layout_label_dict[key] = value + ":" + "
|
|
534
|
+
layout_label_dict[key] = value + ":" + "__".join(gate_qubits_iqm[key])
|
|
530
535
|
gate_label_dict.update({BenchmarkObservationIdentifier(qubit_layout).string_identifier: layout_label_dict})
|
|
531
536
|
return gates, gate_label_dict, len(gates)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Data analysis code for compressive gate set tomography
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
import ast
|
|
5
6
|
from itertools import product
|
|
6
7
|
from time import perf_counter
|
|
7
8
|
from typing import Any, List, Tuple, Union
|
|
@@ -218,16 +219,16 @@ def generate_non_gate_results(
|
|
|
218
219
|
percentiles_o_low, percentiles_o_high = np.nanpercentile(df_o_array, [2.5, 97.5], axis=0)
|
|
219
220
|
df_o_final = DataFrame(
|
|
220
221
|
{
|
|
221
|
-
f"
|
|
222
|
+
f"mean_total_variation_distance_estimate_data": reporting.number_to_str(
|
|
222
223
|
df_o.values[0, 1].copy(), [percentiles_o_high[0, 1], percentiles_o_low[0, 1]], precision=5
|
|
223
224
|
),
|
|
224
|
-
f"
|
|
225
|
+
f"mean_total_variation_distance_target_data": reporting.number_to_str(
|
|
225
226
|
df_o.values[0, 2].copy(), [percentiles_o_high[0, 2], percentiles_o_low[0, 2]], precision=5
|
|
226
227
|
),
|
|
227
|
-
f"
|
|
228
|
+
f"povm_diamond_distance": reporting.number_to_str(
|
|
228
229
|
df_o.values[0, 3].copy(), [percentiles_o_high[0, 3], percentiles_o_low[0, 3]], precision=5
|
|
229
230
|
),
|
|
230
|
-
f"
|
|
231
|
+
f"state_trace_distance": reporting.number_to_str(
|
|
231
232
|
df_o.values[0, 4].copy(), [percentiles_o_high[0, 4], percentiles_o_low[0, 4]], precision=5
|
|
232
233
|
),
|
|
233
234
|
},
|
|
@@ -236,10 +237,10 @@ def generate_non_gate_results(
|
|
|
236
237
|
else:
|
|
237
238
|
df_o_final = DataFrame(
|
|
238
239
|
{
|
|
239
|
-
f"
|
|
240
|
-
f"
|
|
241
|
-
f"
|
|
242
|
-
f"
|
|
240
|
+
f"mean_total_variation_distance_estimate_data": reporting.number_to_str(df_o.values[0, 1].copy(), precision=5),
|
|
241
|
+
f"mean_total_variation_distance_target_data": reporting.number_to_str(df_o.values[0, 2].copy(), precision=5),
|
|
242
|
+
f"povm_diamond_distance": reporting.number_to_str(df_o.values[0, 3].copy(), precision=5),
|
|
243
|
+
f"state_trace_distance": reporting.number_to_str(df_o.values[0, 4].copy(), precision=5),
|
|
243
244
|
},
|
|
244
245
|
index=[""],
|
|
245
246
|
)
|
|
@@ -290,13 +291,13 @@ def generate_unit_rank_gate_results(
|
|
|
290
291
|
|
|
291
292
|
df_g_final = DataFrame(
|
|
292
293
|
{
|
|
293
|
-
r"
|
|
294
|
+
r"average_gate_fidelity": [
|
|
294
295
|
reporting.number_to_str(
|
|
295
296
|
df_g.values[i, 0], [percentiles_g_high[i, 0], percentiles_g_low[i, 0]], precision=5
|
|
296
297
|
)
|
|
297
298
|
for i in range(len(dataset.attrs["gate_labels"][identifier]))
|
|
298
299
|
],
|
|
299
|
-
r"
|
|
300
|
+
r"diamond_distance": [
|
|
300
301
|
reporting.number_to_str(
|
|
301
302
|
df_g.values[i, 1], [percentiles_g_high[i, 1], percentiles_g_low[i, 1]], precision=5
|
|
302
303
|
)
|
|
@@ -338,10 +339,10 @@ def generate_unit_rank_gate_results(
|
|
|
338
339
|
else:
|
|
339
340
|
df_g_final = DataFrame(
|
|
340
341
|
{
|
|
341
|
-
"
|
|
342
|
+
"average_gate_fidelity": [
|
|
342
343
|
reporting.number_to_str(df_g.values[i, 0], precision=5) for i in range(dataset.attrs["num_gates"])
|
|
343
344
|
],
|
|
344
|
-
"
|
|
345
|
+
"diamond_distance": [
|
|
345
346
|
reporting.number_to_str(df_g.values[i, 1], precision=5) for i in range(dataset.attrs["num_gates"])
|
|
346
347
|
],
|
|
347
348
|
}
|
|
@@ -442,19 +443,19 @@ def generate_gate_results(
|
|
|
442
443
|
|
|
443
444
|
df_g_final = DataFrame(
|
|
444
445
|
{
|
|
445
|
-
r"
|
|
446
|
+
r"average_gate_fidelity": [
|
|
446
447
|
reporting.number_to_str(
|
|
447
448
|
df_g.values[i, 0], [percentiles_g_high[i, 0], percentiles_g_low[i, 0]], precision=5
|
|
448
449
|
)
|
|
449
450
|
for i in range(dataset.attrs["num_gates"])
|
|
450
451
|
],
|
|
451
|
-
r"
|
|
452
|
+
r"diamond_distance": [
|
|
452
453
|
reporting.number_to_str(
|
|
453
454
|
df_g.values[i, 1], [percentiles_g_high[i, 1], percentiles_g_low[i, 1]], precision=5
|
|
454
455
|
)
|
|
455
456
|
for i in range(dataset.attrs["num_gates"])
|
|
456
457
|
],
|
|
457
|
-
r"
|
|
458
|
+
r"unitarity": [
|
|
458
459
|
reporting.number_to_str(
|
|
459
460
|
reporting.unitarities(X_opt_pp)[i],
|
|
460
461
|
[percentiles_u_high[i], percentiles_u_low[i]],
|
|
@@ -468,15 +469,15 @@ def generate_gate_results(
|
|
|
468
469
|
else:
|
|
469
470
|
df_g_final = DataFrame(
|
|
470
471
|
{
|
|
471
|
-
"
|
|
472
|
+
"average_gate_fidelity": [
|
|
472
473
|
reporting.number_to_str(df_g.values[i, 0].copy(), precision=5)
|
|
473
474
|
for i in range(len(dataset.attrs["gate_labels"][identifier]))
|
|
474
475
|
],
|
|
475
|
-
"
|
|
476
|
+
"diamond_distance": [
|
|
476
477
|
reporting.number_to_str(df_g.values[i, 1].copy(), precision=5)
|
|
477
478
|
for i in range(len(dataset.attrs["gate_labels"][identifier]))
|
|
478
479
|
],
|
|
479
|
-
"
|
|
480
|
+
"unitarity": [
|
|
480
481
|
reporting.number_to_str(reporting.unitarities(X_opt_pp)[i], precision=5)
|
|
481
482
|
for i in range(len(dataset.attrs["gate_labels"][identifier]))
|
|
482
483
|
],
|
|
@@ -574,11 +575,12 @@ def pandas_results_to_observations(
|
|
|
574
575
|
"""
|
|
575
576
|
observation_list: list[BenchmarkObservation] = []
|
|
576
577
|
err = dataset.attrs["bootstrap_samples"] > 0
|
|
578
|
+
qubits = "__".join([f"QB{i+1}" for i in ast.literal_eval(identifier.string_identifier)])
|
|
577
579
|
for idx, gate_label in enumerate(dataset.attrs["gate_labels"][identifier.string_identifier].values()):
|
|
578
580
|
observation_list.extend(
|
|
579
581
|
[
|
|
580
582
|
BenchmarkObservation(
|
|
581
|
-
name=f"{name}
|
|
583
|
+
name=f"{name}_{gate_label}:crosstalk_components={qubits}",
|
|
582
584
|
identifier=identifier,
|
|
583
585
|
value=result_str_to_floats(df_g[name].iloc[idx], err)[0],
|
|
584
586
|
uncertainty=result_str_to_floats(df_g[name].iloc[idx], err)[1],
|
|
@@ -754,6 +756,7 @@ def mgst_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
754
756
|
dataset = run.dataset
|
|
755
757
|
pdim = dataset.attrs["pdim"]
|
|
756
758
|
plots = {}
|
|
759
|
+
observations = []
|
|
757
760
|
for i, qubit_layout in enumerate(dataset.attrs["qubit_layouts"]):
|
|
758
761
|
identifier = BenchmarkObservationIdentifier(qubit_layout).string_identifier
|
|
759
762
|
|
|
@@ -820,8 +823,10 @@ def mgst_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
820
823
|
plots[f"layout_{qubit_layout}_gate_metrics"] = fig_g
|
|
821
824
|
plots[f"layout_{qubit_layout}_other_metrics"] = fig_o
|
|
822
825
|
|
|
823
|
-
|
|
824
|
-
|
|
826
|
+
observations.extend(
|
|
827
|
+
pandas_results_to_observations(
|
|
828
|
+
dataset, df_g_final, df_o_final, BenchmarkObservationIdentifier(qubit_layout)
|
|
829
|
+
)
|
|
825
830
|
)
|
|
826
831
|
|
|
827
832
|
dataset.attrs["results_layout_" + identifier].update(
|
|
@@ -865,4 +870,4 @@ def mgst_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
865
870
|
)
|
|
866
871
|
plt.close("all")
|
|
867
872
|
|
|
868
|
-
return BenchmarkAnalysisResult(dataset=dataset, observations=
|
|
873
|
+
return BenchmarkAnalysisResult(dataset=dataset, observations=observations, plots=plots)
|
|
@@ -851,6 +851,7 @@ class GHZBenchmark(Benchmark):
|
|
|
851
851
|
self.shots,
|
|
852
852
|
self.calset_id,
|
|
853
853
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
854
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
854
855
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
855
856
|
)
|
|
856
857
|
|
|
@@ -475,23 +475,24 @@ def qscore_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
475
475
|
qcvv_logger.info(
|
|
476
476
|
f"Q-Score = {num_nodes} failed with approximation ratio (Beta) {approximation_ratio:.4f} < 0.2; Avg MaxCut size: {np.mean(cut_sizes_list):.4f}"
|
|
477
477
|
)
|
|
478
|
+
qubit_indices = dataset.attrs[num_nodes]["qubit_set"][0]
|
|
478
479
|
observations.extend(
|
|
479
480
|
[
|
|
480
481
|
BenchmarkObservation(
|
|
481
482
|
name="mean_approximation_ratio",
|
|
482
483
|
value=approximation_ratio,
|
|
483
484
|
uncertainty=std_of_approximation_ratio,
|
|
484
|
-
identifier=BenchmarkObservationIdentifier(
|
|
485
|
+
identifier=BenchmarkObservationIdentifier(qubit_indices),
|
|
485
486
|
),
|
|
486
487
|
BenchmarkObservation(
|
|
487
488
|
name="is_succesful",
|
|
488
489
|
value=str(success),
|
|
489
|
-
identifier=BenchmarkObservationIdentifier(
|
|
490
|
+
identifier=BenchmarkObservationIdentifier(qubit_indices),
|
|
490
491
|
),
|
|
491
492
|
BenchmarkObservation(
|
|
492
493
|
name="Qscore_result",
|
|
493
494
|
value=qscore if success else 1,
|
|
494
|
-
identifier=BenchmarkObservationIdentifier(
|
|
495
|
+
identifier=BenchmarkObservationIdentifier(qubit_indices),
|
|
495
496
|
),
|
|
496
497
|
]
|
|
497
498
|
)
|
|
@@ -751,7 +752,7 @@ class QScoreBenchmark(Benchmark):
|
|
|
751
752
|
else:
|
|
752
753
|
nqubits = self.backend.num_qubits
|
|
753
754
|
|
|
754
|
-
if self.
|
|
755
|
+
if self.choose_qubits_routine == "custom":
|
|
755
756
|
if self.use_virtual_node:
|
|
756
757
|
node_numbers = [len(qubit_layout) + 1 for qubit_layout in self.custom_qubits_array]
|
|
757
758
|
else:
|
|
@@ -765,7 +766,7 @@ class QScoreBenchmark(Benchmark):
|
|
|
765
766
|
max_num_nodes = nqubits
|
|
766
767
|
else:
|
|
767
768
|
max_num_nodes = self.max_num_nodes
|
|
768
|
-
node_numbers = range(self.min_num_nodes, max_num_nodes + 1)
|
|
769
|
+
node_numbers = list(range(self.min_num_nodes, max_num_nodes + 1))
|
|
769
770
|
|
|
770
771
|
dataset.attrs.update({"max_num_nodes": node_numbers[-1]})
|
|
771
772
|
dataset.attrs.update({"node_numbers": node_numbers})
|
|
@@ -881,6 +882,7 @@ class QScoreBenchmark(Benchmark):
|
|
|
881
882
|
self.shots,
|
|
882
883
|
self.calset_id,
|
|
883
884
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
885
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
884
886
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
885
887
|
)
|
|
886
888
|
qc_transpiled_list.append(transpiled_qc)
|
|
@@ -565,6 +565,7 @@ class CLOPSBenchmark(Benchmark):
|
|
|
565
565
|
self.num_shots,
|
|
566
566
|
self.calset_id,
|
|
567
567
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
568
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
568
569
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
569
570
|
)
|
|
570
571
|
|
|
@@ -26,7 +26,7 @@ from mthree.classes import QuasiCollection
|
|
|
26
26
|
from mthree.utils import expval
|
|
27
27
|
import numpy as np
|
|
28
28
|
from qiskit.circuit.library import QuantumVolume
|
|
29
|
-
from qiskit_aer import
|
|
29
|
+
from qiskit_aer import StatevectorSimulator
|
|
30
30
|
import xarray as xr
|
|
31
31
|
|
|
32
32
|
from iqm.benchmarks.benchmark import BenchmarkConfigurationBase
|
|
@@ -119,7 +119,7 @@ def get_ideal_heavy_outputs(
|
|
|
119
119
|
"""
|
|
120
120
|
simulable_circuits = deepcopy(qc_list)
|
|
121
121
|
ideal_heavy_outputs: List[Dict[str, float]] = []
|
|
122
|
-
ideal_simulator =
|
|
122
|
+
ideal_simulator = StatevectorSimulator()
|
|
123
123
|
|
|
124
124
|
# Separate according to sorted indices
|
|
125
125
|
circuit_batches = {
|
|
@@ -698,6 +698,7 @@ class QuantumVolumeBenchmark(Benchmark):
|
|
|
698
698
|
self.shots,
|
|
699
699
|
self.calset_id,
|
|
700
700
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
701
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
701
702
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
702
703
|
)
|
|
703
704
|
# qcvv_logger.info(
|
|
@@ -125,13 +125,18 @@ def clifford_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
125
125
|
fidelity = rb_fit_results.params["fidelity_per_clifford"]
|
|
126
126
|
|
|
127
127
|
processed_results = {
|
|
128
|
-
"
|
|
128
|
+
"average_gate_fidelity": {"value": fidelity.value, "uncertainty": fidelity.stderr},
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
if len(qubits) == 1:
|
|
132
132
|
fidelity_native = rb_fit_results.params["fidelity_per_native_sqg"]
|
|
133
133
|
processed_results.update(
|
|
134
|
-
{
|
|
134
|
+
{
|
|
135
|
+
"average_native_gate_fidelity": {
|
|
136
|
+
"value": fidelity_native.value,
|
|
137
|
+
"uncertainty": fidelity_native.stderr,
|
|
138
|
+
}
|
|
139
|
+
}
|
|
135
140
|
)
|
|
136
141
|
|
|
137
142
|
dataset.attrs[qubits_idx].update(
|
|
@@ -140,8 +145,8 @@ def clifford_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
140
145
|
"fit_amplitude": {"value": popt["amplitude"].value, "uncertainty": popt["amplitude"].stderr},
|
|
141
146
|
"fit_offset": {"value": popt["offset"].value, "uncertainty": popt["offset"].stderr},
|
|
142
147
|
"fidelities": fidelities[str(qubits)],
|
|
143
|
-
"
|
|
144
|
-
"
|
|
148
|
+
"average_fidelities_nominal_values": average_fidelities,
|
|
149
|
+
"average_fidelities_stderr": stddevs_from_mean,
|
|
145
150
|
"fitting_method": str(rb_fit_results.method),
|
|
146
151
|
"num_function_evals": int(rb_fit_results.nfev),
|
|
147
152
|
"data_points": int(rb_fit_results.ndata),
|
|
@@ -294,6 +299,7 @@ class CliffordRandomizedBenchmarking(Benchmark):
|
|
|
294
299
|
self.shots,
|
|
295
300
|
self.calset_id,
|
|
296
301
|
self.max_gates_per_batch,
|
|
302
|
+
self.configuration.max_circuits_per_batch,
|
|
297
303
|
)
|
|
298
304
|
)
|
|
299
305
|
qcvv_logger.info(f"Job for sequence length {seq_length} submitted successfully!")
|
|
@@ -353,6 +359,7 @@ class CliffordRandomizedBenchmarking(Benchmark):
|
|
|
353
359
|
self.backend,
|
|
354
360
|
self.calset_id,
|
|
355
361
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
362
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
356
363
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
357
364
|
)
|
|
358
365
|
)
|
|
@@ -173,14 +173,14 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
173
173
|
)
|
|
174
174
|
|
|
175
175
|
processed_results[rb_type] = {
|
|
176
|
-
"
|
|
176
|
+
"average_gate_fidelity": {"value": fidelity.value, "uncertainty": fidelity.stderr},
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
if len(qubits) == 1 and rb_type == "clifford":
|
|
180
180
|
fidelity_native = rb_fit_results.params["fidelity_per_native_sqg"]
|
|
181
181
|
processed_results[rb_type].update(
|
|
182
182
|
{
|
|
183
|
-
"
|
|
183
|
+
"average_gate_fidelity_native": {
|
|
184
184
|
"value": fidelity_native.value,
|
|
185
185
|
"uncertainty": fidelity_native.stderr,
|
|
186
186
|
}
|
|
@@ -190,7 +190,7 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
190
190
|
fidelity_native_sqg = rb_fit_results.params["fidelity_per_native_sqg"]
|
|
191
191
|
processed_results[rb_type].update(
|
|
192
192
|
{
|
|
193
|
-
"
|
|
193
|
+
"average_gate_fidelity_native_sqg": {
|
|
194
194
|
"value": fidelity_native_sqg.value,
|
|
195
195
|
"uncertainty": fidelity_native_sqg.stderr,
|
|
196
196
|
}
|
|
@@ -200,7 +200,7 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
200
200
|
observations.extend(
|
|
201
201
|
[
|
|
202
202
|
BenchmarkObservation(
|
|
203
|
-
name=f"{key}_{
|
|
203
|
+
name=f"{key}_{interleaved_gate}" if "native" not in key else f"{key}",
|
|
204
204
|
identifier=BenchmarkObservationIdentifier(qubits),
|
|
205
205
|
value=values["value"],
|
|
206
206
|
uncertainty=values["uncertainty"],
|
|
@@ -216,8 +216,8 @@ def interleaved_rb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
216
216
|
"fit_amplitude": {"value": popt["amplitude"].value, "uncertainty": popt["amplitude"].stderr},
|
|
217
217
|
"fit_offset": {"value": popt["offset"].value, "uncertainty": popt["offset"].stderr},
|
|
218
218
|
"fidelities": fidelities[str(qubits)][rb_type],
|
|
219
|
-
"
|
|
220
|
-
"
|
|
219
|
+
"average_fidelities_nominal_values": average_fidelities,
|
|
220
|
+
"average_fidelities_stderr": stddevs_from_mean,
|
|
221
221
|
"fitting_method": str(rb_fit_results.method),
|
|
222
222
|
"num_function_evals": int(rb_fit_results.nfev),
|
|
223
223
|
"data_points": int(rb_fit_results.ndata),
|
|
@@ -407,6 +407,7 @@ class InterleavedRandomizedBenchmarking(Benchmark):
|
|
|
407
407
|
self.shots,
|
|
408
408
|
self.calset_id,
|
|
409
409
|
self.max_gates_per_batch,
|
|
410
|
+
self.configuration.max_circuits_per_batch,
|
|
410
411
|
)
|
|
411
412
|
)
|
|
412
413
|
all_rb_jobs["interleaved"].append(
|
|
@@ -418,6 +419,7 @@ class InterleavedRandomizedBenchmarking(Benchmark):
|
|
|
418
419
|
self.shots,
|
|
419
420
|
self.calset_id,
|
|
420
421
|
self.max_gates_per_batch,
|
|
422
|
+
self.configuration.max_circuits_per_batch,
|
|
421
423
|
)
|
|
422
424
|
)
|
|
423
425
|
qcvv_logger.info(f"Both jobs for sequence length {seq_length} submitted successfully!")
|
|
@@ -513,6 +515,7 @@ class InterleavedRandomizedBenchmarking(Benchmark):
|
|
|
513
515
|
backend,
|
|
514
516
|
self.calset_id,
|
|
515
517
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
518
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
516
519
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
517
520
|
)
|
|
518
521
|
)
|
|
@@ -524,6 +527,7 @@ class InterleavedRandomizedBenchmarking(Benchmark):
|
|
|
524
527
|
backend,
|
|
525
528
|
self.calset_id,
|
|
526
529
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
530
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
527
531
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
528
532
|
)
|
|
529
533
|
)
|
|
@@ -522,7 +522,7 @@ def mrb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
522
522
|
fidelity = rb_fit_results.params["fidelity_mrb"]
|
|
523
523
|
|
|
524
524
|
processed_results = {
|
|
525
|
-
"
|
|
525
|
+
"average_gate_fidelity": {"value": fidelity.value, "uncertainty": fidelity.stderr},
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
dataset.attrs[qubits_idx].update(
|
|
@@ -531,8 +531,8 @@ def mrb_analysis(run: BenchmarkRunResult) -> BenchmarkAnalysisResult:
|
|
|
531
531
|
"fit_amplitude": {"value": popt["amplitude"].value, "uncertainty": popt["amplitude"].stderr},
|
|
532
532
|
"fit_offset": {"value": popt["offset"].value, "uncertainty": popt["offset"].stderr},
|
|
533
533
|
"polarizations": polarizations,
|
|
534
|
-
"
|
|
535
|
-
"
|
|
534
|
+
"average_polarization_nominal_values": average_polarizations,
|
|
535
|
+
"average_polatization_stderr": stddevs_from_mean,
|
|
536
536
|
"fitting_method": str(rb_fit_results.method),
|
|
537
537
|
"num_function_evals": int(rb_fit_results.nfev),
|
|
538
538
|
"data_points": int(rb_fit_results.ndata),
|
|
@@ -662,6 +662,7 @@ class MirrorRandomizedBenchmarking(Benchmark):
|
|
|
662
662
|
self.shots,
|
|
663
663
|
self.calset_id,
|
|
664
664
|
max_gates_per_batch=self.max_gates_per_batch,
|
|
665
|
+
max_circuits_per_batch=self.configuration.max_circuits_per_batch,
|
|
665
666
|
circuit_compilation_options=self.circuit_compilation_options,
|
|
666
667
|
)
|
|
667
668
|
mrb_submit_results = {
|
|
@@ -439,6 +439,7 @@ def submit_parallel_rb_job(
|
|
|
439
439
|
shots: int,
|
|
440
440
|
calset_id: Optional[str],
|
|
441
441
|
max_gates_per_batch: Optional[str],
|
|
442
|
+
max_circuits_per_batch: Optional[int],
|
|
442
443
|
) -> Dict[str, Any]:
|
|
443
444
|
"""Submit fixed-depth parallel MRB jobs for execution in the specified IQMBackend
|
|
444
445
|
Args:
|
|
@@ -449,6 +450,7 @@ def submit_parallel_rb_job(
|
|
|
449
450
|
shots (int): the number of shots to submit the job
|
|
450
451
|
calset_id (Optional[str]): the calibration identifier
|
|
451
452
|
max_gates_per_batch (Optional[str]): the maximum number of gates per batch to submit the job
|
|
453
|
+
max_circuits_per_batch (Optional[int]): the maximum number of circuits per batch to submit the job.
|
|
452
454
|
Returns:
|
|
453
455
|
Dict with qubit layout, submitted job objects, type (vanilla/DD) and submission time
|
|
454
456
|
"""
|
|
@@ -456,7 +458,12 @@ def submit_parallel_rb_job(
|
|
|
456
458
|
# Send to execute on backend
|
|
457
459
|
# pylint: disable=unbalanced-tuple-unpacking
|
|
458
460
|
execution_jobs, time_submit = submit_execute(
|
|
459
|
-
sorted_transpiled_circuit_dicts,
|
|
461
|
+
sorted_transpiled_circuit_dicts,
|
|
462
|
+
backend_arg,
|
|
463
|
+
shots,
|
|
464
|
+
calset_id,
|
|
465
|
+
max_gates_per_batch=max_gates_per_batch,
|
|
466
|
+
max_circuits_per_batch=max_circuits_per_batch,
|
|
460
467
|
)
|
|
461
468
|
rb_submit_results = {
|
|
462
469
|
"qubits": qubits_array,
|
|
@@ -474,6 +481,7 @@ def submit_sequential_rb_jobs(
|
|
|
474
481
|
backend_arg: str | IQMBackendBase,
|
|
475
482
|
calset_id: Optional[str] = None,
|
|
476
483
|
max_gates_per_batch: Optional[int] = None,
|
|
484
|
+
max_circuits_per_batch: Optional[int] = None,
|
|
477
485
|
circuit_compilation_options: Optional[CircuitCompilationOptions] = None,
|
|
478
486
|
) -> List[Dict[str, Any]]:
|
|
479
487
|
"""Submit sequential RB jobs for execution in the specified IQMBackend
|
|
@@ -484,6 +492,7 @@ def submit_sequential_rb_jobs(
|
|
|
484
492
|
backend_arg (IQMBackendBase): the IQM backend to submit the job
|
|
485
493
|
calset_id (Optional[str]): the calibration identifier
|
|
486
494
|
max_gates_per_batch (Optional[int]): the maximum number of gates per batch
|
|
495
|
+
max_circuits_per_batch (Optional[int]): the maximum number of circuits per batch
|
|
487
496
|
circuit_compilation_options (Optional[CircuitCompilationOptions]): Compilation options passed to submit_execute
|
|
488
497
|
Returns:
|
|
489
498
|
Dict with qubit layout, submitted job objects, type (vanilla/DD) and submission time
|
|
@@ -504,6 +513,7 @@ def submit_sequential_rb_jobs(
|
|
|
504
513
|
shots,
|
|
505
514
|
calset_id,
|
|
506
515
|
max_gates_per_batch,
|
|
516
|
+
max_circuits_per_batch=max_circuits_per_batch,
|
|
507
517
|
circuit_compilation_options=circuit_compilation_options,
|
|
508
518
|
)
|
|
509
519
|
rb_submit_results[depth] = {
|
|
@@ -627,11 +637,11 @@ def plot_rb_decay(
|
|
|
627
637
|
str(q): dataset.attrs[q_idx]["polarizations"] for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
628
638
|
}
|
|
629
639
|
average_polarizations[identifier] = {
|
|
630
|
-
str(q): dataset.attrs[q_idx]["
|
|
640
|
+
str(q): dataset.attrs[q_idx]["average_polarization_nominal_values"]
|
|
631
641
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
632
642
|
}
|
|
633
643
|
stddevs_from_mean[identifier] = {
|
|
634
|
-
str(q): dataset.attrs[q_idx]["
|
|
644
|
+
str(q): dataset.attrs[q_idx]["average_polatization_stderr"]
|
|
635
645
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
636
646
|
}
|
|
637
647
|
else: # identifier == "clifford"
|
|
@@ -643,28 +653,28 @@ def plot_rb_decay(
|
|
|
643
653
|
str(q): dataset.attrs[q_idx]["fidelities"] for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
644
654
|
}
|
|
645
655
|
average_polarizations[identifier] = {
|
|
646
|
-
str(q): dataset.attrs[q_idx]["
|
|
656
|
+
str(q): dataset.attrs[q_idx]["average_fidelities_nominal_values"]
|
|
647
657
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
648
658
|
}
|
|
649
659
|
stddevs_from_mean[identifier] = {
|
|
650
|
-
str(q): dataset.attrs[q_idx]["
|
|
660
|
+
str(q): dataset.attrs[q_idx]["average_fidelities_stderr"]
|
|
651
661
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
652
662
|
}
|
|
653
663
|
fidelity_native1q_value[identifier] = {
|
|
654
|
-
str(q): observations[q_idx]["
|
|
664
|
+
str(q): observations[q_idx]["average_native_gate_fidelity"]["value"] if len(q) == 1 else np.nan
|
|
655
665
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
656
666
|
}
|
|
657
667
|
fidelity_native1q_stderr[identifier] = {
|
|
658
|
-
str(q): observations[q_idx]["
|
|
668
|
+
str(q): observations[q_idx]["average_native_gate_fidelity"]["uncertainty"] if len(q) == 1 else np.nan
|
|
659
669
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
660
670
|
}
|
|
661
671
|
# These are common to both MRB and standard Clifford
|
|
662
672
|
fidelity_value[identifier] = {
|
|
663
|
-
str(q): observations[q_idx]["
|
|
673
|
+
str(q): observations[q_idx]["average_gate_fidelity"]["value"]
|
|
664
674
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
665
675
|
}
|
|
666
676
|
fidelity_stderr[identifier] = {
|
|
667
|
-
str(q): observations[q_idx]["
|
|
677
|
+
str(q): observations[q_idx]["average_gate_fidelity"]["uncertainty"]
|
|
668
678
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
669
679
|
}
|
|
670
680
|
decay_rate[identifier] = {
|
|
@@ -689,19 +699,19 @@ def plot_rb_decay(
|
|
|
689
699
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
690
700
|
}
|
|
691
701
|
average_polarizations[rb_type] = {
|
|
692
|
-
str(q): dataset.attrs[q_idx][rb_type]["
|
|
702
|
+
str(q): dataset.attrs[q_idx][rb_type]["average_fidelities_nominal_values"]
|
|
693
703
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
694
704
|
}
|
|
695
705
|
stddevs_from_mean[rb_type] = {
|
|
696
|
-
str(q): dataset.attrs[q_idx][rb_type]["
|
|
706
|
+
str(q): dataset.attrs[q_idx][rb_type]["average_fidelities_stderr"]
|
|
697
707
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
698
708
|
}
|
|
699
709
|
fidelity_value[rb_type] = {
|
|
700
|
-
str(q): observations[q_idx][rb_type]["
|
|
710
|
+
str(q): observations[q_idx][rb_type]["average_gate_fidelity"]["value"]
|
|
701
711
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
702
712
|
}
|
|
703
713
|
fidelity_stderr[rb_type] = {
|
|
704
|
-
str(q): observations[q_idx][rb_type]["
|
|
714
|
+
str(q): observations[q_idx][rb_type]["average_gate_fidelity"]["uncertainty"]
|
|
705
715
|
for q_idx, q in enumerate(qubits_array, qubits_index)
|
|
706
716
|
}
|
|
707
717
|
decay_rate[rb_type] = {
|
iqm/benchmarks/utils.py
CHANGED
|
@@ -503,6 +503,7 @@ def submit_execute(
|
|
|
503
503
|
shots: int,
|
|
504
504
|
calset_id: Optional[str] = None,
|
|
505
505
|
max_gates_per_batch: Optional[int] = None,
|
|
506
|
+
max_circuits_per_batch: Optional[int] = None,
|
|
506
507
|
circuit_compilation_options: Optional[CircuitCompilationOptions] = None,
|
|
507
508
|
) -> List[IQMJob]:
|
|
508
509
|
"""Submit for execute a list of quantum circuits on the specified Backend.
|
|
@@ -511,10 +512,15 @@ def submit_execute(
|
|
|
511
512
|
sorted_transpiled_qc_list (Dict[Tuple, List[QuantumCircuit]]): the list of quantum circuits to be executed.
|
|
512
513
|
backend (IQMBackendBase): the backend to execute the circuits on.
|
|
513
514
|
shots (int): the number of shots per circuit.
|
|
514
|
-
calset_id (Optional[str]): the calibration set ID
|
|
515
|
-
|
|
515
|
+
calset_id (Optional[str]): the calibration set ID.
|
|
516
|
+
* Default is None: uses the latest calibration ID.
|
|
517
|
+
max_gates_per_batch (Optional[int]): the maximum number of gates per batch sent to the backend, used to make manageable batches.
|
|
518
|
+
* Default is None.
|
|
519
|
+
max_circuits_per_batch (Optional[int]): the maximum number of circuits per batch sent to the backend, used to make manageable batches.
|
|
520
|
+
* Default is None.
|
|
516
521
|
circuit_compilation_options (CircuitCompilationOptions): Ability to pass a compilation options object,
|
|
517
522
|
enabling execution with dynamical decoupling, among other options - see qiskit-iqm documentation.
|
|
523
|
+
* Default is None.
|
|
518
524
|
Returns:
|
|
519
525
|
List[IQMJob]: the IQMJob objects of the executed circuits.
|
|
520
526
|
|
|
@@ -530,23 +536,41 @@ def submit_execute(
|
|
|
530
536
|
f"Submitting batch with {len(sorted_transpiled_qc_list[k])} circuits corresponding to qubits {list(k)}"
|
|
531
537
|
)
|
|
532
538
|
# Divide into batches according to maximum gate count per batch
|
|
533
|
-
if max_gates_per_batch is None:
|
|
539
|
+
if max_gates_per_batch is None and max_circuits_per_batch is None:
|
|
534
540
|
jobs = backend.run(sorted_transpiled_qc_list[k], shots=shots, calibration_set_id=calset_id)
|
|
535
541
|
final_jobs.append(jobs)
|
|
542
|
+
|
|
536
543
|
else:
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
if max_gates_per_batch is None and max_circuits_per_batch is not None:
|
|
545
|
+
restriction = "max_circuits_per_batch"
|
|
546
|
+
batching_size = max_circuits_per_batch
|
|
547
|
+
|
|
548
|
+
elif max_circuits_per_batch is None and max_gates_per_batch is not None:
|
|
549
|
+
restriction = "max_gates_per_batch"
|
|
550
|
+
# Calculate average gate count per quantum circuit
|
|
551
|
+
avg_gates_per_qc = sum(sum(qc.count_ops().values()) for qc in sorted_transpiled_qc_list[k]) / len(
|
|
552
|
+
sorted_transpiled_qc_list[k]
|
|
553
|
+
)
|
|
554
|
+
batching_size = max(1, floor(max_gates_per_batch / avg_gates_per_qc))
|
|
555
|
+
|
|
556
|
+
else: # Both are not None - select the one rendering the smallest batches.
|
|
557
|
+
# Calculate average gate count per quantum circuit
|
|
558
|
+
avg_gates_per_qc = sum(sum(qc.count_ops().values()) for qc in sorted_transpiled_qc_list[k]) / len(
|
|
559
|
+
sorted_transpiled_qc_list[k]
|
|
560
|
+
)
|
|
561
|
+
qcvv_logger.warning(
|
|
562
|
+
"Both max_gates_per_batch and max_circuits_per_batch are not None. Selecting the one giving the smallest batches."
|
|
546
563
|
)
|
|
547
|
-
|
|
564
|
+
batching_size = min(max_circuits_per_batch, max(1, floor(max_gates_per_batch / avg_gates_per_qc))) # type: ignore
|
|
565
|
+
if batching_size == max_circuits_per_batch:
|
|
566
|
+
restriction = "max_circuits_per_batch"
|
|
567
|
+
else:
|
|
568
|
+
restriction = "max_gates_per_batch"
|
|
569
|
+
|
|
570
|
+
final_batch_jobs = []
|
|
571
|
+
for index, qc_batch in enumerate(chunked(sorted_transpiled_qc_list[k], batching_size)):
|
|
548
572
|
qcvv_logger.info(
|
|
549
|
-
f"
|
|
573
|
+
f"{restriction} restriction: submitting subbatch #{index + 1} with {len(qc_batch)} circuits corresponding to qubits {list(k)}"
|
|
550
574
|
)
|
|
551
575
|
batch_jobs = backend.run(
|
|
552
576
|
qc_batch,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: iqm-benchmarks
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.26
|
|
4
4
|
Summary: A package for implementation of Quantum Characterization, Verification and Validation (QCVV) techniques on IQM's hardware at gate level abstraction
|
|
5
5
|
Author-email: IQM Finland Oy <developers@meetiqm.com>, Adrian Auer <adrian.auer@meetiqm.com>, Raphael Brieger <raphael.brieger@meetiqm.com>, Alessio Calzona <alessio.calzona@meetiqm.com>, Pedro Figueroa Romero <pedro.romero@meetiqm.com>, Amin Hosseinkhani <amin.hosseinkhani@meetiqm.com>, Miikka Koistinen <miikka@meetiqm.com>, Nadia Milazzo <nadia.milazzo@meetiqm.com>, Vicente Pina Canelles <vicente.pina@meetiqm.com>, Aniket Rath <aniket.rath@meetiqm.com>, Jami Rönkkö <jami@meetiqm.com>, Stefan Seegerer <stefan.seegerer@meetiqm.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
|
|
@@ -50,6 +50,7 @@ Provides-Extra: docs
|
|
|
50
50
|
Requires-Dist: sphinx==7.2.6; extra == "docs"
|
|
51
51
|
Requires-Dist: sphinx-book-theme==1.1.2; extra == "docs"
|
|
52
52
|
Requires-Dist: myst-parser<5,>=4.0.0; extra == "docs"
|
|
53
|
+
Dynamic: license-file
|
|
53
54
|
|
|
54
55
|
# IQM Benchmarks
|
|
55
56
|
|
|
@@ -194,7 +195,7 @@ EXAMPLE_MRB = MirrorRBConfiguration(
|
|
|
194
195
|
)
|
|
195
196
|
|
|
196
197
|
EXAMPLE_QV = QuantumVolumeConfiguration(
|
|
197
|
-
num_circuits=
|
|
198
|
+
num_circuits=800,
|
|
198
199
|
shots=2**8,
|
|
199
200
|
calset_id=None,
|
|
200
201
|
num_sigmas=2,
|
|
@@ -204,7 +205,8 @@ EXAMPLE_QV = QuantumVolumeConfiguration(
|
|
|
204
205
|
optimize_sqg=True,
|
|
205
206
|
routing_method="sabre",
|
|
206
207
|
physical_layout="fixed",
|
|
207
|
-
|
|
208
|
+
max_circuits_per_batch=500,
|
|
209
|
+
max_gates_per_batch=60_000, # Will be used if it renders a smaller max batch size than max_circuits_per_batch
|
|
208
210
|
rem=True,
|
|
209
211
|
mit_shots=1_000,
|
|
210
212
|
)
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
iqm/benchmarks/__init__.py,sha256=8SRHlADqZjlP8PtbKTMvu-ejpcEZkW8cPmgW8GVKJg8,2638
|
|
2
|
-
iqm/benchmarks/benchmark.py,sha256=
|
|
2
|
+
iqm/benchmarks/benchmark.py,sha256=3E7g7RQjCIGIpSI1gOSrI3V9SAVs-XEOMrPgToK_7vw,4972
|
|
3
3
|
iqm/benchmarks/benchmark_definition.py,sha256=e4xe0wlWKZqj48_6-zTglMaMeoiA9aGkHrrSgoCfPkM,11271
|
|
4
4
|
iqm/benchmarks/circuit_containers.py,sha256=anEtZEsodYqOX-34oZRmuKGeEpp_VfgG5045Mz4-4hI,7562
|
|
5
5
|
iqm/benchmarks/logging_config.py,sha256=U7olP5Kr75AcLJqNODf9VBhJLVqIvA4AYR6J39D5rww,1052
|
|
6
6
|
iqm/benchmarks/readout_mitigation.py,sha256=Q2SOGWTNgmklOYkNxepAaSaXlxSj0QQyymYY1bOkT8A,11756
|
|
7
|
-
iqm/benchmarks/utils.py,sha256=
|
|
7
|
+
iqm/benchmarks/utils.py,sha256=_1iLsc-azCE4ucHlD1LLRPdTryUKaMs8r75q3njRugE,33451
|
|
8
8
|
iqm/benchmarks/compressive_gst/__init__.py,sha256=LneifgYXtcwo2jcXo7GdUEHL6_peipukShhkrdaTRCA,929
|
|
9
|
-
iqm/benchmarks/compressive_gst/compressive_gst.py,sha256=
|
|
10
|
-
iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=
|
|
9
|
+
iqm/benchmarks/compressive_gst/compressive_gst.py,sha256=2kiRttog4jR-vtMHu847GTFe5qL_i_uYr_4WMGqt9Ww,25653
|
|
10
|
+
iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=SZ4IbRYDTDTc_5DK7wXOeP_QIY48vA63I7JkPdwVbgs,36374
|
|
11
11
|
iqm/benchmarks/entanglement/__init__.py,sha256=9T7prOwqMmFWdb4t6ETAHZXKK5o6FvU2DvVb6WhNi-U,682
|
|
12
|
-
iqm/benchmarks/entanglement/ghz.py,sha256=
|
|
12
|
+
iqm/benchmarks/entanglement/ghz.py,sha256=jSPcdFf1Xsq09EJXKCVHzNXjQIdAoDg859279wKGjaQ,41075
|
|
13
13
|
iqm/benchmarks/optimization/__init__.py,sha256=_ajW_OibYLCtzU5AUv5c2zuuVYn8ZNeZUcUUSIGt51M,747
|
|
14
|
-
iqm/benchmarks/optimization/qscore.py,sha256=
|
|
14
|
+
iqm/benchmarks/optimization/qscore.py,sha256=ufkIKuh0XtiSVn-3Deca-7Ky1cXZ1CxCXMN-j-Lhevw,38132
|
|
15
15
|
iqm/benchmarks/quantum_volume/__init__.py,sha256=i-Q4SpDWELBw7frXnxm1j4wJRcxbIyrS5uEK_v06YHo,951
|
|
16
|
-
iqm/benchmarks/quantum_volume/clops.py,sha256=
|
|
17
|
-
iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=
|
|
16
|
+
iqm/benchmarks/quantum_volume/clops.py,sha256=xlziaxjhJUNyHjBCMzMLeJ9PcFNBtDO7urKvCTBb4sI,31471
|
|
17
|
+
iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=4ll3R8AX-BA599TEaMBzE2rJtAzHLtCkq8CaSkJfA0Y,36626
|
|
18
18
|
iqm/benchmarks/randomized_benchmarking/__init__.py,sha256=IkKo-7zUChxZZd3my_csQCJfJfZNsV3-JTvdG8uqys4,734
|
|
19
19
|
iqm/benchmarks/randomized_benchmarking/clifford_1q.pkl,sha256=vvSd0pRWxtzyirohO9yf_58mjevkc2-pbuWIEb-4gaw,46928
|
|
20
20
|
iqm/benchmarks/randomized_benchmarking/clifford_2q.pkl,sha256=ZipqU3crPhz2T35qGFgB4GvMyoi_7pnu8NqW5ZP8NXg,90707258
|
|
21
21
|
iqm/benchmarks/randomized_benchmarking/multi_lmfit.py,sha256=Se1ygR4mXn_2_P82Ch31KBnCmY-g_A9NKzE9Ir8nEvw,3247
|
|
22
|
-
iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py,sha256=
|
|
22
|
+
iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py,sha256=pe9wSFvQ6Vh7rWZNZalIKOeaHoXc8iT4pkvrcLmY75g,42352
|
|
23
23
|
iqm/benchmarks/randomized_benchmarking/clifford_rb/__init__.py,sha256=bTDA156LAl7OLGcMec--1nzDrV1XpPRVq3CquTmucgE,677
|
|
24
|
-
iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py,sha256=
|
|
24
|
+
iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py,sha256=IGBrq_a9eaVPknkBLKHKS4BOcumHn6TZdasUNKTZjGI,18685
|
|
25
25
|
iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py,sha256=sq6MgN_hwlpkOj10vyCU4e6eKSX-oLcF2L9na6W2Gt4,681
|
|
26
|
-
iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=
|
|
26
|
+
iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=TaR1YFWBhOgm1hmEQzuwLYpp0yl0Xpuo3jAT6YhiXpc,28471
|
|
27
27
|
iqm/benchmarks/randomized_benchmarking/mirror_rb/__init__.py,sha256=ZekEqI_89nXzGO1vjM-b5Uwwicy59M4fYHXfA-f0MIg,674
|
|
28
|
-
iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py,sha256=
|
|
28
|
+
iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py,sha256=QAivrFMV98JELa28tTV4DkW7XKuSU2I5sL6lkg6syUs,34994
|
|
29
|
+
iqm_benchmarks-2.26.dist-info/licenses/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
|
|
29
30
|
mGST/LICENSE,sha256=TtHNq55cUcbglb7uhVudeBLUh_qPdUoAEvU0BBwFz-k,1098
|
|
30
31
|
mGST/README.md,sha256=v_5kw253csHF4-RfE-44KqFmBXIsSMRmOtN0AUPrRxE,5050
|
|
31
32
|
mGST/additional_fns.py,sha256=_SEJ10FRNM7_CroysT8hCLZTfpm6ZhEIDCY5zPTnhjo,31390
|
|
@@ -36,8 +37,7 @@ mGST/optimization.py,sha256=YHwkzIkYvsZOPjclR-BCQWh24jeqjuXp0BB0WX5Lwow,10559
|
|
|
36
37
|
mGST/qiskit_interface.py,sha256=ajx6Zn5FnrX_T7tMP8xnBLyG4c2ddFRm0Fu2_3r1t30,10118
|
|
37
38
|
mGST/reporting/figure_gen.py,sha256=6Xd8vwfy09hLY1YbJY6TRevuMsQSU4MsWqemly3ZO0I,12970
|
|
38
39
|
mGST/reporting/reporting.py,sha256=B8NWfpZrrSmyH7lwZxd0EbZMYLsAGK1YsHRB4D5qXH4,26002
|
|
39
|
-
iqm_benchmarks-2.
|
|
40
|
-
iqm_benchmarks-2.
|
|
41
|
-
iqm_benchmarks-2.
|
|
42
|
-
iqm_benchmarks-2.
|
|
43
|
-
iqm_benchmarks-2.24.dist-info/RECORD,,
|
|
40
|
+
iqm_benchmarks-2.26.dist-info/METADATA,sha256=yrczoXmgJh34bMhbo-XTomCKT9XowiP6hw61tpxacUQ,10555
|
|
41
|
+
iqm_benchmarks-2.26.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
|
|
42
|
+
iqm_benchmarks-2.26.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
|
|
43
|
+
iqm_benchmarks-2.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|