iqm-benchmarks 2.7__py3-none-any.whl → 2.9__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.

@@ -26,7 +26,6 @@ from .benchmark_definition import (
26
26
  BenchmarkRunResult,
27
27
  )
28
28
  from .circuit_containers import BenchmarkCircuit, CircuitGroup, Circuits
29
- from .compressive_gst.compressive_gst import CompressiveGST, GSTConfiguration
30
29
  from .entanglement.ghz import GHZBenchmark, GHZConfiguration
31
30
  from .quantum_volume.clops import CLOPSBenchmark, CLOPSConfiguration
32
31
  from .quantum_volume.quantum_volume import QuantumVolumeBenchmark, QuantumVolumeConfiguration
@@ -47,6 +46,15 @@ AVAILABLE_BENCHMARKS = {
47
46
  MirrorRandomizedBenchmarking.name: MirrorRandomizedBenchmarking,
48
47
  }
49
48
 
49
+ try:
50
+ # Requires dependencies from "project.optional-dependencies.mgst" section to be installed. See "pyproject.toml"
51
+ # file
52
+ from .compressive_gst.compressive_gst import CompressiveGST, GSTConfiguration
53
+
54
+ AVAILABLE_BENCHMARKS.update({CompressiveGST.name: CompressiveGST})
55
+ except ModuleNotFoundError:
56
+ pass
57
+
50
58
  try:
51
59
  # Change here if project is renamed and does not equal the package name
52
60
  dist_name = "iqm-benchmarks"
@@ -58,6 +58,8 @@ class CompressiveGST(Benchmark):
58
58
 
59
59
  analysis_function = staticmethod(mgst_analysis)
60
60
 
61
+ name: str = "compressive_gst"
62
+
61
63
  def __init__(self, backend: IQMBackendBase, configuration: "GSTConfiguration"):
62
64
  """Construct the compressive_gst class.
63
65
 
@@ -102,10 +104,6 @@ class CompressiveGST(Benchmark):
102
104
  self.J = np.empty((self.configuration.num_circuits, self.num_povm))
103
105
  self.bootstrap_results = List[Tuple[np.ndarray]] # List of GST outcomes from bootstrapping
104
106
 
105
- @staticmethod
106
- def name() -> str:
107
- return "compressive_GST"
108
-
109
107
  @timeit
110
108
  def generate_meas_circuits(self) -> None:
111
109
  """Generate random circuits from the gate set
@@ -172,7 +170,7 @@ class CompressiveGST(Benchmark):
172
170
  # Adding configuration entries and class variables, prioritizing the latter in case of conflicts
173
171
  for key, value in (self.configuration.__dict__ | self.__dict__).items():
174
172
  if key == "benchmark": # Avoid saving the class objects
175
- dataset.attrs[key] = value.name()
173
+ dataset.attrs[key] = value.name
176
174
  elif key == "backend":
177
175
  dataset.attrs[key] = value.name
178
176
  else:
@@ -557,20 +557,20 @@ def pandas_results_to_observations(
557
557
  """Converts high level GST results from a pandas Dataframe to a simple observation dictionary
558
558
 
559
559
  Args:
560
- dataset: xarray.Dataset
561
- A dataset containing counts from the experiment and configurations
562
- qubit_layout: List[int]
563
- The list of qubits for the current GST experiment
564
- df_g: Pandas DataFrame
565
- The dataframe with properly formated gate results
566
- df_o: Pandas DataFrame
567
- The dataframe with properly formated non-gate results like SPAM error measures or fit quality.
568
- identifier: BenchmarkObservationIdentifier
569
- An identifier object for the current GST run
560
+ dataset: xarray.Dataset
561
+ A dataset containing counts from the experiment and configurations
562
+ qubit_layout: List[int]
563
+ The list of qubits for the current GST experiment
564
+ df_g: Pandas DataFrame
565
+ The dataframe with properly formated gate results
566
+ df_o: Pandas DataFrame
567
+ The dataframe with properly formated non-gate results like SPAM error measures or fit quality.
568
+ identifier: BenchmarkObservationIdentifier
569
+ An identifier object for the current GST run
570
570
 
571
571
  Returns:
572
- observation_list: List[BenchmarkObservation]
573
- List of observations converted from the pandas dataframes
572
+ observation_list: List[BenchmarkObservation]
573
+ List of observations converted from the pandas dataframes
574
574
  """
575
575
  observation_list: list[BenchmarkObservation] = []
576
576
  err = dataset.attrs["bootstrap_samples"] > 0
@@ -677,7 +677,8 @@ class QuantumVolumeBenchmark(Benchmark):
677
677
  sorted_transpiled_qc_list: Dict[Tuple[int, ...], List[QuantumCircuit]],
678
678
  ) -> Dict[str, Any]:
679
679
  """
680
- Submit jobs for execution in the specified IQMBackend.
680
+ Submit jobs for execution in the specified IQMBackend.
681
+
681
682
  Args:
682
683
  backend (IQMBackendBase): the IQM backend to submit the job.
683
684
  qubits (List[int]): the qubits to identify the submitted job.
@@ -862,8 +863,7 @@ class QuantumVolumeConfiguration(BenchmarkConfigurationBase):
862
863
  - "fixed": Restricts the coupling map to only the specified qubits.
863
864
  - "batching": Considers the full coupling map of the backend and circuit execution is batched per final layout.
864
865
  * Default is "fixed"
865
- rem (bool): Whether Readout Error Mitigation is applied in post-processing.
866
- When set to True, both results (readout-unmitigated and -mitigated) are produced.
866
+ rem (bool): Whether Readout Error Mitigation is applied in post-processing. When set to True, both results (readout-unmitigated and -mitigated) are produced.
867
867
  - Default is True.
868
868
  mit_shots (int): The measurement shots to use for readout calibration.
869
869
  * Default is 1_000.
@@ -620,7 +620,8 @@ class MirrorRandomizedBenchmarking(Benchmark):
620
620
  sorted_transpiled_circuit_dicts: Dict[Tuple[int, ...], List[QuantumCircuit]],
621
621
  ) -> Dict[str, Any]:
622
622
  """
623
- Submit fixed-depth MRB jobs for execution in the specified IQMBackend
623
+ Submit fixed-depth MRB jobs for execution in the specified IQMBackend
624
+
624
625
  Args:
625
626
  backend_arg (IQMBackendBase): the IQM backend to submit the job
626
627
  qubits (Sequence[int]): the qubits to identify the submitted job
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: iqm-benchmarks
3
- Version: 2.7
3
+ Version: 2.9
4
4
  Summary: A package for implementation of Quantum Characterization, Verification and Validation (QCVV) techniques on IQM's hardware at gate level abstraction
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>
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>, Miikka Koistinen <miikka@meetiqm.com>
6
6
  Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
7
7
  Classifier: Development Status :: 4 - Beta
8
8
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -26,16 +26,15 @@ Requires-Dist: pycurl<8.0,>=7.45.3
26
26
  Requires-Dist: xarray<2025.0.0,>=2024.6.0
27
27
  Requires-Dist: types-pycurl
28
28
  Requires-Dist: myst-nb==1.1.0
29
- Provides-Extra: develop
30
- Requires-Dist: tox==4.16.0; extra == "develop"
29
+ Provides-Extra: cicd
30
+ Requires-Dist: build==1.0.3; extra == "cicd"
31
+ Requires-Dist: pip-licenses==5.0.0; extra == "cicd"
31
32
  Provides-Extra: examples
32
33
  Requires-Dist: notebook==7.2.1; extra == "examples"
33
34
  Provides-Extra: mgst
34
- Requires-Dist: numpy<2.0; extra == "mgst"
35
- Requires-Dist: cvxpy==1.5.3; extra == "mgst"
36
- Requires-Dist: pygsti==0.9.12.3; extra == "mgst"
37
- Requires-Dist: tqdm==4.66.5; extra == "mgst"
38
35
  Requires-Dist: numba==0.60.0; extra == "mgst"
36
+ Requires-Dist: pygsti[diamond_norm]==0.9.12.3; extra == "mgst"
37
+ Requires-Dist: tqdm==4.66.5; extra == "mgst"
39
38
  Provides-Extra: test
40
39
  Requires-Dist: black==24.4.2; extra == "test"
41
40
  Requires-Dist: isort==5.13.2; extra == "test"
@@ -75,57 +74,71 @@ The project is split into different benchmarks, all sharing the `Benchmark` clas
75
74
 
76
75
  ## Installation _(latest release)_
77
76
 
78
- Usually it makes sense to use a new Conda environment (e.g. ``iqm-benchmarks``) to isolate your setup from the global Python installation. That way, you can play around without messing the rest of your system.
79
-
80
- Start a terminal in your machine, and type
77
+ [uv](https://docs.astral.sh/uv/) is highly recommended for practical Python environment and package management.
78
+ With uv installed in your system, start a terminal in your machine and create a new Python environment
81
79
 
80
+ ```sh
81
+ uv venv --python=3.11
82
82
  ```
83
- conda create -n iqm-benchmarks python=3.11.2
84
- conda activate iqm-benchmarks
85
- ```
86
83
 
84
+ > Note: refer to uv's documentation if there are problems setting up a Python environment.
85
+
86
+ After the command has run, read the output and make sure to use the prompt to activate the environment.
87
87
  Then, you can install the latest release of the IQM Benchmarks by running:
88
- ```bash
89
- $ pip install iqm-benchmarks
88
+
89
+ ```sh
90
+ uv pip install iqm-benchmarks
90
91
  ```
91
92
 
92
- If you have already installed `iqm-benchmarks` and want to get the latest release you can add the --upgrade flag:
93
+ Supplied within the Python package there is an additional `requirements.txt` file containing locked, security scanned
94
+ dependencies. The file can be used to constrain installed dependencies either directly from the repo or by
95
+ extracting it from the PyPI package.
93
96
 
94
- ```bash
95
- pip install iqm-benchmarks --upgrade
97
+ ```sh
98
+ uv pip install --constraint requirements.txt iqm-benchmarks
96
99
  ```
97
100
 
98
101
  ## Optional dependencies
99
102
 
100
103
  Optional dependencies like compressive gate set tomography and jupyter notebooks can be installed as follows:
101
- ```bash
102
- pip install "iqm-benchmarks[mgst, examples]"
104
+ ```sh
105
+ uv pip install "iqm-benchmarks[mgst,examples]"
103
106
  ```
104
107
  Current optional dependencies are:
105
108
  * `examples`: Jupyter notebooks
106
109
  * `mgst`: Compressive gate set tomography
107
- * `develop`: Development tools
108
110
  * `test`: Code testing and Linting
109
- * `docs`: Documentation building
111
+ * `docs`: Documentation building
112
+ * `cicd`: CICD tools
110
113
 
111
- ## Development mode _(latest changes: recommended)_
114
+ ## Development installation _(latest changes)_
112
115
 
113
- To install in development mode with all required dependencies, you can instead clone the [repository](https://www.github.com/iqm-finland/iqm-benchmarks) and from the project directory run
116
+ To install in development mode with all required dependencies, you can instead clone the
117
+ [repository](https://www.github.com/iqm-finland/iqm-benchmarks) and from the project directory run
114
118
 
115
- ```bash
116
- python -m pip install -e ".[develop,test]" --upgrade --upgrade-strategy=eager
119
+ ```sh
120
+ uv pip install --constraint requirements.txt iqm-benchmarks
117
121
  ```
118
122
 
119
123
  To run the tests, you can use the following command:
120
124
 
121
- ```bash
122
- tox -e test
125
+ ```sh
126
+ ./test
123
127
  ```
124
128
 
125
129
  To build the API documentation as HTML:
126
130
 
127
- ```bash
128
- tox -e docs
131
+ ```sh
132
+ ./docbuild
133
+ ```
134
+
135
+ Update the requirements. This is necessary when you add a new dependency or update an existing one in `pyproject.toml`.
136
+ After this, any changes in the lockfile `requirements.txt` have to be committed.
137
+ The script upgrades locked dependencies defined in `pyproject.toml` within the given version ranges. However, transitive
138
+ dependencies are deliberately not upgraded automatically.
139
+
140
+ ```sh
141
+ python update-requirements.py
129
142
  ```
130
143
 
131
144
  ## Characterize Physical Hardware
@@ -1,4 +1,4 @@
1
- iqm/benchmarks/__init__.py,sha256=sFDsukGeEKJfTO3kaBli0bz8gSewemon35yHAx7bOQY,2279
1
+ iqm/benchmarks/__init__.py,sha256=Hc0oxTTjCA2QlLJeD7lBBt84l1tFbAF5WkAhP92JmgA,2525
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
4
  iqm/benchmarks/circuit_containers.py,sha256=anEtZEsodYqOX-34oZRmuKGeEpp_VfgG5045Mz4-4hI,7562
@@ -6,15 +6,15 @@ iqm/benchmarks/logging_config.py,sha256=U7olP5Kr75AcLJqNODf9VBhJLVqIvA4AYR6J39D5
6
6
  iqm/benchmarks/readout_mitigation.py,sha256=7FlbSH-RJTtQuRYLChwkQV_vBv0ZfMQTH519cAbyxQ4,12252
7
7
  iqm/benchmarks/utils.py,sha256=MrGWVB4X037u0XZY68PtIEG8Xud3T0ZKldv2JpeLYD0,20500
8
8
  iqm/benchmarks/compressive_gst/__init__.py,sha256=LneifgYXtcwo2jcXo7GdUEHL6_peipukShhkrdaTRCA,929
9
- iqm/benchmarks/compressive_gst/compressive_gst.py,sha256=LyhuKCq7UvmkcDhgzRm1QuK95eepJlerxqNXuj7llxc,22146
10
- iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=wMsomKcD5bUhfzAsi9NGw5YMkkcZ-pOFYsZvuCyGHRM,35282
9
+ iqm/benchmarks/compressive_gst/compressive_gst.py,sha256=bG-NdSbiYTqfTGpBZtHqsjepNwUU04VB0wrqg9KH8OA,22104
10
+ iqm/benchmarks/compressive_gst/gst_analysis.py,sha256=PxCThBfh2zdQpipI-6gAvLKdmkbYv_KSEpejltVkk7o,35330
11
11
  iqm/benchmarks/entanglement/__init__.py,sha256=9T7prOwqMmFWdb4t6ETAHZXKK5o6FvU2DvVb6WhNi-U,682
12
12
  iqm/benchmarks/entanglement/ghz.py,sha256=e97DMjH-uAuoO7cqoDS_6k7yDr-DjU9soWL2GyTgp8U,40257
13
13
  iqm/benchmarks/optimization/__init__.py,sha256=_ajW_OibYLCtzU5AUv5c2zuuVYn8ZNeZUcUUSIGt51M,747
14
14
  iqm/benchmarks/optimization/qscore.py,sha256=nkvt6zJTQclknBmUaliKP0f6Vtgvx4BvNtgVwT7W-1k,34606
15
15
  iqm/benchmarks/quantum_volume/__init__.py,sha256=i-Q4SpDWELBw7frXnxm1j4wJRcxbIyrS5uEK_v06YHo,951
16
16
  iqm/benchmarks/quantum_volume/clops.py,sha256=j6BPEj1rKBAHigox7nrvaTLyb4iCrHadBl2d1yiETDA,30956
17
- iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=PPg1kZA5Lx9b24iFVgP_VcgymI6CsD5LfB5Ppfk8TBM,36814
17
+ iqm/benchmarks/quantum_volume/quantum_volume.py,sha256=njX5lBty9jcWMuJnl7uNqRfwE9akMe5gcX-f1_uYDXk,36791
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
@@ -25,7 +25,7 @@ iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py,sha256=q8bHcrV
25
25
  iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py,sha256=sq6MgN_hwlpkOj10vyCU4e6eKSX-oLcF2L9na6W2Gt4,681
26
26
  iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py,sha256=PlHn1J8VPaJF5csNH8jxcifz_MdisOEPU54kU-FYoLY,26920
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=AmPAp80wWc_6ao4OMZBUNGX0_WlSnz9utN4436ZcjJ0,33990
28
+ iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py,sha256=pOEnEtuJ0rMnTq5nZ1obsQ6LOIVlgFcgNGc8CULWz6E,33987
29
29
  mGST/LICENSE,sha256=TtHNq55cUcbglb7uhVudeBLUh_qPdUoAEvU0BBwFz-k,1098
30
30
  mGST/README.md,sha256=v_5kw253csHF4-RfE-44KqFmBXIsSMRmOtN0AUPrRxE,5050
31
31
  mGST/additional_fns.py,sha256=_SEJ10FRNM7_CroysT8hCLZTfpm6ZhEIDCY5zPTnhjo,31390
@@ -36,8 +36,8 @@ mGST/optimization.py,sha256=YHwkzIkYvsZOPjclR-BCQWh24jeqjuXp0BB0WX5Lwow,10559
36
36
  mGST/qiskit_interface.py,sha256=L4H-4SdhP_bjSFFvpQoF1E7EyGbIJ_CI_y4a7_YEwmU,10102
37
37
  mGST/reporting/figure_gen.py,sha256=6Xd8vwfy09hLY1YbJY6TRevuMsQSU4MsWqemly3ZO0I,12970
38
38
  mGST/reporting/reporting.py,sha256=We1cccz9BKbITYcSlZHdmBGdjMWAa1xNZe5tKP-yh_E,26004
39
- iqm_benchmarks-2.7.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
40
- iqm_benchmarks-2.7.dist-info/METADATA,sha256=b0JnI4Kl0J17rprKYuyfUcLCYsE-W9IycdJhsgMcpgQ,9506
41
- iqm_benchmarks-2.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
- iqm_benchmarks-2.7.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
43
- iqm_benchmarks-2.7.dist-info/RECORD,,
39
+ iqm_benchmarks-2.9.dist-info/LICENSE,sha256=2Ncb40-hqkTil78RPv3-YiJfKaJ8te9USJgliKqIdSY,11558
40
+ iqm_benchmarks-2.9.dist-info/METADATA,sha256=9ByGfYfFNY1OMBRjDm-8GQMWUGQSaBJe3a3AmSAFjUU,10170
41
+ iqm_benchmarks-2.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
+ iqm_benchmarks-2.9.dist-info/top_level.txt,sha256=3G23Z-1LGf-IOzTCUl6QwWqiQ3USz25Zt90Ihq192to,9
43
+ iqm_benchmarks-2.9.dist-info/RECORD,,