iqm-benchmarks 2.3__py3-none-any.whl → 2.4__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.
- iqm/benchmarks/optimization/qscore.py +716 -540
- {iqm_benchmarks-2.3.dist-info → iqm_benchmarks-2.4.dist-info}/METADATA +1 -1
- {iqm_benchmarks-2.3.dist-info → iqm_benchmarks-2.4.dist-info}/RECORD +6 -7
- iqm/benchmarks/benchmark_experiment.py +0 -163
- {iqm_benchmarks-2.3.dist-info → iqm_benchmarks-2.4.dist-info}/LICENSE +0 -0
- {iqm_benchmarks-2.3.dist-info → iqm_benchmarks-2.4.dist-info}/WHEEL +0 -0
- {iqm_benchmarks-2.3.dist-info → iqm_benchmarks-2.4.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: iqm-benchmarks
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
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>, Aniket Rath <aniket.rath@meetiqm.com>, Jami Rönkkö <jami@meetiqm.com>, Pedro Figueroa Romero <pedro.romero@meetiqm.com>, Vicente Pina Canelles <vicente.pina@meetiqm.com>, Raphael Brieger <raphael.brieger@meetiqm.com>, Stefan Seegerer <stefan.seegerer@meetiqm.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
iqm/benchmarks/__init__.py,sha256=sAS6OKctANSzgVUEUWugQs9mcKwG9KOTBEsbSYGxtPc,2201
|
|
2
2
|
iqm/benchmarks/benchmark.py,sha256=SGhBcSxLPUu-cVXAjG4Db2TRobFCRBYoE1NtTDK1lJg,4432
|
|
3
3
|
iqm/benchmarks/benchmark_definition.py,sha256=AZkvANrf0_0glbq_P_uo_YqbBU9IZa2gJlMVz6qT6VU,10500
|
|
4
|
-
iqm/benchmarks/benchmark_experiment.py,sha256=ynbsQS92v6soIgkDEdm3ygNO7f82-dhg7qB1l8jvSFM,6614
|
|
5
4
|
iqm/benchmarks/circuit_containers.py,sha256=anEtZEsodYqOX-34oZRmuKGeEpp_VfgG5045Mz4-4hI,7562
|
|
6
5
|
iqm/benchmarks/logging_config.py,sha256=U7olP5Kr75AcLJqNODf9VBhJLVqIvA4AYR6J39D5rww,1052
|
|
7
6
|
iqm/benchmarks/readout_mitigation.py,sha256=7FlbSH-RJTtQuRYLChwkQV_vBv0ZfMQTH519cAbyxQ4,12252
|
|
@@ -12,7 +11,7 @@ iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=qaF9zDIadPGe9I0l_SC3EfnODZ
|
|
|
12
11
|
iqm/benchmarks/entanglement/__init__.py,sha256=9T7prOwqMmFWdb4t6ETAHZXKK5o6FvU2DvVb6WhNi-U,682
|
|
13
12
|
iqm/benchmarks/entanglement/ghz.py,sha256=qg6mw1RydosKdc2KoPi6M3q0Ek7eMBPIkWOJC2ZDx8M,39446
|
|
14
13
|
iqm/benchmarks/optimization/__init__.py,sha256=_ajW_OibYLCtzU5AUv5c2zuuVYn8ZNeZUcUUSIGt51M,747
|
|
15
|
-
iqm/benchmarks/optimization/qscore.py,sha256=
|
|
14
|
+
iqm/benchmarks/optimization/qscore.py,sha256=6I13YbFvFq1RcX4mYTw6S4ALb4Ix9t7gjlRzZbaTARM,34038
|
|
16
15
|
iqm/benchmarks/quantum_volume/__init__.py,sha256=i-Q4SpDWELBw7frXnxm1j4wJRcxbIyrS5uEK_v06YHo,951
|
|
17
16
|
iqm/benchmarks/quantum_volume/clops.py,sha256=j6BPEj1rKBAHigox7nrvaTLyb4iCrHadBl2d1yiETDA,30956
|
|
18
17
|
iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=PPg1kZA5Lx9b24iFVgP_VcgymI6CsD5LfB5Ppfk8TBM,36814
|
|
@@ -37,8 +36,8 @@ mGST/optimization.py,sha256=YHwkzIkYvsZOPjclR-BCQWh24jeqjuXp0BB0WX5Lwow,10559
|
|
|
37
36
|
mGST/qiskit_interface.py,sha256=L4H-4SdhP_bjSFFvpQoF1E7EyGbIJ_CI_y4a7_YEwmU,10102
|
|
38
37
|
mGST/reporting/figure_gen.py,sha256=6Xd8vwfy09hLY1YbJY6TRevuMsQSU4MsWqemly3ZO0I,12970
|
|
39
38
|
mGST/reporting/reporting.py,sha256=-XBy3OCJIMOsA8cApwKjhVKBwnjSAoxm-voHNbRWytM,25803
|
|
40
|
-
iqm_benchmarks-2.
|
|
41
|
-
iqm_benchmarks-2.
|
|
42
|
-
iqm_benchmarks-2.
|
|
43
|
-
iqm_benchmarks-2.
|
|
44
|
-
iqm_benchmarks-2.
|
|
39
|
+
iqm_benchmarks-2.4.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
|
|
40
|
+
iqm_benchmarks-2.4.dist-info/METADATA,sha256=Z-c61lqfGdVvhQmYjB7olZYAJyd9pbA7thPWahqFy4E,9103
|
|
41
|
+
iqm_benchmarks-2.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
42
|
+
iqm_benchmarks-2.4.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
|
|
43
|
+
iqm_benchmarks-2.4.dist-info/RECORD,,
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
# Copyright 2024 IQM Benchmarks developers
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
"""
|
|
16
|
-
Generic Benchmark Experiment class
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
from copy import deepcopy
|
|
20
|
-
from json import dump
|
|
21
|
-
from pathlib import Path
|
|
22
|
-
import pickle
|
|
23
|
-
from time import strftime
|
|
24
|
-
from typing import List, Optional, OrderedDict, Union
|
|
25
|
-
|
|
26
|
-
from iqm.benchmarks.benchmark import BenchmarkBase, BenchmarkConfigurationBase
|
|
27
|
-
from iqm.benchmarks.logging_config import qcvv_logger
|
|
28
|
-
from iqm.benchmarks.utils import get_iqm_backend
|
|
29
|
-
from iqm.qiskit_iqm.iqm_backend import IQMBackendBase
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class BenchmarkExperiment:
|
|
33
|
-
"""
|
|
34
|
-
A Benchmark Experiment wraps the execution of one or more benchmarks, checks their requirements are met, stores the
|
|
35
|
-
execution results and plots relevant figures.
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
def __init__(
|
|
39
|
-
self,
|
|
40
|
-
backend: Union[str, IQMBackendBase],
|
|
41
|
-
benchmark_configurations: List[BenchmarkConfigurationBase],
|
|
42
|
-
device_id: Optional[str] = None,
|
|
43
|
-
):
|
|
44
|
-
"""Construct the BenchmarkExperiment class.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
backend (str | IQMBackendBase): the backend to execute the benchmarks on
|
|
48
|
-
benchmark_configurations (List[BenchmarkConfigurationBase]): the configuration(s) of the benchmark(s)
|
|
49
|
-
device_id (Optional[str], optional): the identifier of the device. Defaults to None.
|
|
50
|
-
|
|
51
|
-
Raises:
|
|
52
|
-
ValueError: backend not supported. Try 'garnet' or 'iqmfakeadonis'
|
|
53
|
-
"""
|
|
54
|
-
self.timestamp = strftime("%Y%m%d-%H%M%S")
|
|
55
|
-
|
|
56
|
-
if isinstance(backend, str):
|
|
57
|
-
self.backend = get_iqm_backend(backend)
|
|
58
|
-
else:
|
|
59
|
-
assert isinstance(backend, IQMBackendBase)
|
|
60
|
-
self.backend = backend
|
|
61
|
-
|
|
62
|
-
self.device_id = device_id if device_id is not None else self.backend.name
|
|
63
|
-
|
|
64
|
-
benchmarks: OrderedDict[str, BenchmarkBase] = OrderedDict(
|
|
65
|
-
(config.benchmark.name(), config.benchmark(self.backend, config)) for config in benchmark_configurations
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
for benchmark in benchmarks.values():
|
|
69
|
-
benchmarks_copy = deepcopy(benchmarks)
|
|
70
|
-
benchmarks_copy = benchmark.check_requirements(benchmarks_copy)
|
|
71
|
-
self.benchmarks = benchmarks_copy
|
|
72
|
-
|
|
73
|
-
def run_experiment(self) -> None:
|
|
74
|
-
"""Run the Benchmark experiment, and store the configuration, raw data, results and figures."""
|
|
75
|
-
|
|
76
|
-
for name, benchmark in self.benchmarks.items():
|
|
77
|
-
qcvv_logger.info("\nNow executing " + name)
|
|
78
|
-
# Create the directory for results
|
|
79
|
-
results_dir = f"Outputs/{self.device_id}/{self.timestamp}/{name}/"
|
|
80
|
-
Path(results_dir).mkdir(parents=True, exist_ok=True)
|
|
81
|
-
|
|
82
|
-
# Execute the current benchmark
|
|
83
|
-
benchmark.generate_requirements(self.benchmarks)
|
|
84
|
-
benchmark.execute_full_benchmark()
|
|
85
|
-
|
|
86
|
-
# Create configuration JSON file
|
|
87
|
-
with open(
|
|
88
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_configuration.json",
|
|
89
|
-
"w",
|
|
90
|
-
encoding="utf-8",
|
|
91
|
-
) as f_configuration:
|
|
92
|
-
dump(benchmark.serializable_configuration.model_dump(), f_configuration)
|
|
93
|
-
|
|
94
|
-
# Create untranspiled circuit files
|
|
95
|
-
if benchmark.untranspiled_circuits:
|
|
96
|
-
for key_qubits in benchmark.untranspiled_circuits.keys():
|
|
97
|
-
for key_depth in benchmark.untranspiled_circuits[key_qubits].keys():
|
|
98
|
-
with open(
|
|
99
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_qubits_{key_qubits}_depth_{key_depth}_untranspiled.pkl",
|
|
100
|
-
"wb",
|
|
101
|
-
) as f_circuits:
|
|
102
|
-
pickle.dump(
|
|
103
|
-
benchmark.untranspiled_circuits[key_qubits][key_depth],
|
|
104
|
-
f_circuits,
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
# Create transpiled circuit files
|
|
108
|
-
for key_qubits in benchmark.transpiled_circuits.keys():
|
|
109
|
-
for key_depth in benchmark.transpiled_circuits[key_qubits].keys():
|
|
110
|
-
with open(
|
|
111
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_qubits_{key_qubits}_depth_{key_depth}_transpiled.pkl",
|
|
112
|
-
"wb",
|
|
113
|
-
) as f_circuits:
|
|
114
|
-
pickle.dump(
|
|
115
|
-
benchmark.transpiled_circuits[key_qubits][key_depth],
|
|
116
|
-
f_circuits,
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
# Create raw result pickle files
|
|
120
|
-
with open(
|
|
121
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_raw_results.pkl",
|
|
122
|
-
"wb",
|
|
123
|
-
) as f_raw_results:
|
|
124
|
-
pickle.dump(
|
|
125
|
-
benchmark.raw_results,
|
|
126
|
-
f_raw_results,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
# Create raw data JSON file
|
|
130
|
-
with open(
|
|
131
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_raw_data.json",
|
|
132
|
-
"w",
|
|
133
|
-
encoding="utf-8",
|
|
134
|
-
) as f_raw_data:
|
|
135
|
-
dump(benchmark.raw_data, f_raw_data)
|
|
136
|
-
|
|
137
|
-
# Create job metadata JSON file
|
|
138
|
-
with open(
|
|
139
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_job_metadata.json",
|
|
140
|
-
"w",
|
|
141
|
-
encoding="utf-8",
|
|
142
|
-
) as f_job_metadata:
|
|
143
|
-
dump(benchmark.job_meta, f_job_metadata)
|
|
144
|
-
|
|
145
|
-
# Create results JSON file
|
|
146
|
-
with open(
|
|
147
|
-
f"{results_dir}{self.device_id}_{self.timestamp}_{name}_results.json",
|
|
148
|
-
"w",
|
|
149
|
-
encoding="utf-8",
|
|
150
|
-
) as f_results:
|
|
151
|
-
dump(benchmark.results, f_results)
|
|
152
|
-
|
|
153
|
-
# Create figures
|
|
154
|
-
Path(f"{results_dir}figures/").mkdir(parents=True, exist_ok=True)
|
|
155
|
-
for fig_name, fig in benchmark.figures.items():
|
|
156
|
-
fig.savefig(
|
|
157
|
-
f"{results_dir}figures/{self.device_id}_{self.timestamp}_{name}_{fig_name}",
|
|
158
|
-
dpi=250,
|
|
159
|
-
bbox_inches="tight",
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
# Save benchmark
|
|
163
|
-
self.benchmarks[benchmark.name()] = benchmark
|
|
File without changes
|
|
File without changes
|
|
File without changes
|