iqm-benchmarks 1.3__tar.gz

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.
Files changed (72) hide show
  1. iqm_benchmarks-1.3/.github/workflows/main.yml +60 -0
  2. iqm_benchmarks-1.3/.github/workflows/publish.yml +49 -0
  3. iqm_benchmarks-1.3/.github/workflows/tag_and_release.yml +45 -0
  4. iqm_benchmarks-1.3/.gitignore +31 -0
  5. iqm_benchmarks-1.3/CHANGELOG.rst +26 -0
  6. iqm_benchmarks-1.3/LICENSE +205 -0
  7. iqm_benchmarks-1.3/PKG-INFO +190 -0
  8. iqm_benchmarks-1.3/README.md +141 -0
  9. iqm_benchmarks-1.3/benchmark_runner.py +44 -0
  10. iqm_benchmarks-1.3/examples/example_clifford_rb.ipynb +203 -0
  11. iqm_benchmarks-1.3/examples/example_clops.ipynb +231 -0
  12. iqm_benchmarks-1.3/examples/example_experiment_all.ipynb +714 -0
  13. iqm_benchmarks-1.3/examples/example_gst.ipynb +420 -0
  14. iqm_benchmarks-1.3/examples/example_interleaved_rb.ipynb +329 -0
  15. iqm_benchmarks-1.3/examples/example_mirror_rb.ipynb +252 -0
  16. iqm_benchmarks-1.3/examples/example_qscore.ipynb +142 -0
  17. iqm_benchmarks-1.3/examples/example_quantum_volume.ipynb +300 -0
  18. iqm_benchmarks-1.3/examples/generate_2qubit_cliffords.ipynb +573 -0
  19. iqm_benchmarks-1.3/examples/how_to_make_your_own_benchmark.ipynb +180 -0
  20. iqm_benchmarks-1.3/pyproject.toml +137 -0
  21. iqm_benchmarks-1.3/scheduled_experiments/adonis/__init__.py +13 -0
  22. iqm_benchmarks-1.3/scheduled_experiments/adonis/weekly.py +102 -0
  23. iqm_benchmarks-1.3/setup.cfg +4 -0
  24. iqm_benchmarks-1.3/src/iqm/benchmarks/__init__.py +31 -0
  25. iqm_benchmarks-1.3/src/iqm/benchmarks/benchmark.py +109 -0
  26. iqm_benchmarks-1.3/src/iqm/benchmarks/benchmark_definition.py +264 -0
  27. iqm_benchmarks-1.3/src/iqm/benchmarks/benchmark_experiment.py +163 -0
  28. iqm_benchmarks-1.3/src/iqm/benchmarks/compressive_gst/__init__.py +20 -0
  29. iqm_benchmarks-1.3/src/iqm/benchmarks/compressive_gst/compressive_gst.py +1029 -0
  30. iqm_benchmarks-1.3/src/iqm/benchmarks/entanglement/__init__.py +18 -0
  31. iqm_benchmarks-1.3/src/iqm/benchmarks/entanglement/ghz.py +802 -0
  32. iqm_benchmarks-1.3/src/iqm/benchmarks/logging_config.py +29 -0
  33. iqm_benchmarks-1.3/src/iqm/benchmarks/optimization/__init__.py +18 -0
  34. iqm_benchmarks-1.3/src/iqm/benchmarks/optimization/qscore.py +719 -0
  35. iqm_benchmarks-1.3/src/iqm/benchmarks/quantum_volume/__init__.py +21 -0
  36. iqm_benchmarks-1.3/src/iqm/benchmarks/quantum_volume/clops.py +726 -0
  37. iqm_benchmarks-1.3/src/iqm/benchmarks/quantum_volume/quantum_volume.py +854 -0
  38. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/__init__.py +18 -0
  39. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/clifford_1q.pkl +0 -0
  40. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/clifford_2q.pkl +0 -0
  41. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/clifford_rb/__init__.py +19 -0
  42. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py +386 -0
  43. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py +19 -0
  44. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py +555 -0
  45. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/mirror_rb/__init__.py +19 -0
  46. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py +810 -0
  47. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/multi_lmfit.py +86 -0
  48. iqm_benchmarks-1.3/src/iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py +892 -0
  49. iqm_benchmarks-1.3/src/iqm/benchmarks/readout_mitigation.py +290 -0
  50. iqm_benchmarks-1.3/src/iqm/benchmarks/utils.py +521 -0
  51. iqm_benchmarks-1.3/src/iqm_benchmarks.egg-info/PKG-INFO +190 -0
  52. iqm_benchmarks-1.3/src/iqm_benchmarks.egg-info/SOURCES.txt +70 -0
  53. iqm_benchmarks-1.3/src/iqm_benchmarks.egg-info/dependency_links.txt +1 -0
  54. iqm_benchmarks-1.3/src/iqm_benchmarks.egg-info/requires.txt +39 -0
  55. iqm_benchmarks-1.3/src/iqm_benchmarks.egg-info/top_level.txt +2 -0
  56. iqm_benchmarks-1.3/src/mGST/LICENSE +21 -0
  57. iqm_benchmarks-1.3/src/mGST/README.md +54 -0
  58. iqm_benchmarks-1.3/src/mGST/additional_fns.py +962 -0
  59. iqm_benchmarks-1.3/src/mGST/algorithm.py +733 -0
  60. iqm_benchmarks-1.3/src/mGST/compatibility.py +238 -0
  61. iqm_benchmarks-1.3/src/mGST/low_level_jit.py +694 -0
  62. iqm_benchmarks-1.3/src/mGST/optimization.py +349 -0
  63. iqm_benchmarks-1.3/src/mGST/qiskit_interface.py +282 -0
  64. iqm_benchmarks-1.3/src/mGST/reporting/figure_gen.py +334 -0
  65. iqm_benchmarks-1.3/src/mGST/reporting/reporting.py +710 -0
  66. iqm_benchmarks-1.3/tag-from-pipeline.sh +53 -0
  67. iqm_benchmarks-1.3/tests/ghz_test.py +61 -0
  68. iqm_benchmarks-1.3/tests/gst_test.py +36 -0
  69. iqm_benchmarks-1.3/tests/qscore_test.py +30 -0
  70. iqm_benchmarks-1.3/tests/qv_test.py +46 -0
  71. iqm_benchmarks-1.3/tests/rb_test.py +65 -0
  72. iqm_benchmarks-1.3/tox.ini +79 -0
@@ -0,0 +1,60 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+ schedule:
9
+ - cron: '0 0 * * *'
10
+
11
+ jobs:
12
+ run_tests:
13
+ runs-on: ubuntu-latest
14
+ if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v2
19
+ with:
20
+ python-version: 3.11.3
21
+ - name: Cache pip
22
+ uses: actions/cache@v2
23
+ with:
24
+ path: ~/.cache/pip
25
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
26
+ restore-keys: |
27
+ ${{ runner.os }}-pip-
28
+ - name: Install dependencies
29
+ run: pip install tox==4.16.0
30
+ - name: Check Python packages
31
+ run: python -m pip check
32
+ - name: Run tests
33
+ run: tox -e test
34
+
35
+ run_benchmark:
36
+ runs-on: ubuntu-latest
37
+ if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v2
42
+ with:
43
+ python-version: 3.11.3
44
+ - name: Cache pip
45
+ uses: actions/cache@v2
46
+ with:
47
+ path: ~/.cache/pip
48
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
49
+ restore-keys: |
50
+ ${{ runner.os }}-pip-
51
+ - name: Install dependencies
52
+ run: pip install tox==4.16.0
53
+ - name: Run benchmark
54
+ run: tox -e benchmark -- --backend=${{ github.event.inputs.backend || 'iqmfakeadonis' }}
55
+ - name: Upload benchmark results
56
+ uses: actions/upload-artifact@v2
57
+ with:
58
+ name: benchmark-results
59
+ path: Outputs
60
+
@@ -0,0 +1,49 @@
1
+ name: Upload package to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ workflow_call:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Fetch all history for all tags and branches
16
+ run: git fetch --prune --unshallow
17
+ - name: Setup Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: '3.11'
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ python -m pip install build==1.0.3
25
+ - name: Build distribution
26
+ run: python -m build
27
+ - name: Store distribution packages
28
+ uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist
31
+ path: ./dist
32
+
33
+ push_to_pypi:
34
+ runs-on: ubuntu-latest
35
+ needs:
36
+ - build
37
+ environment:
38
+ name: pypi
39
+ url: https://pypi.org/p/iqm-benchmarks
40
+ permissions:
41
+ id-token: write
42
+
43
+ steps:
44
+ - name: Download distribution packages
45
+ uses: actions/download-artifact@v4
46
+ - name: Publish distribution packages to PyPI
47
+ uses: pypa/gh-action-pypi-publish@release/v1
48
+ with:
49
+ attestations: false
@@ -0,0 +1,45 @@
1
+ name: Create tag and release
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - 'CHANGELOG.rst'
7
+ push:
8
+ branches:
9
+ - main
10
+ paths:
11
+ - 'CHANGELOG.rst'
12
+
13
+ jobs:
14
+
15
+ check_version:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ - name: Verify changelog version
22
+ run: bash ./tag-from-pipeline.sh verify_changelog_version
23
+
24
+ create_tag_and_release:
25
+ needs: check_version
26
+ runs-on: ubuntu-latest
27
+ if: |
28
+ github.ref == 'refs/heads/main' &&
29
+ github.event.head_commit.message != 'skip ci'
30
+
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ with:
34
+ fetch-depth: 0
35
+ - name: Create new tag and release
36
+ run: bash ./tag-from-pipeline.sh create_new_tag
37
+ env:
38
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
+
40
+ # GitHub works so that events ('release' event in this case) triggered while using the GITHUB_TOKEN will not create a
41
+ # new workflow run. This means the publishing workflow will not be triggered even though a new release is successfully
42
+ # created by the above job create_tag_and_release. Here we trigger the said workflow manually.
43
+ trigger_publishing:
44
+ needs: create_tag_and_release
45
+ uses: ./.github/workflows/publish.yml
@@ -0,0 +1,31 @@
1
+ # Temporary and binary files
2
+ *~
3
+ *.swp
4
+ __pycache__/
5
+ *.pyc
6
+ .ipynb_checkpoints/
7
+ *.png
8
+ *.jpg
9
+ *.jpeg
10
+
11
+ # Package files
12
+ *.eggs/
13
+ *.egg-info/
14
+ *.egg-info/*
15
+
16
+ # Environments
17
+ /.tox/
18
+ /.venv/
19
+
20
+ # Build and docs folder/files
21
+ /build/
22
+ /dist/
23
+ version.txt
24
+
25
+ # OS generated files
26
+ **/.DS_Store
27
+
28
+ .idea/*
29
+
30
+ /Outputs/
31
+ /tests/Outputs/
@@ -0,0 +1,26 @@
1
+ =========
2
+ Changelog
3
+ =========
4
+
5
+ Version 1.3
6
+ ===========
7
+
8
+ * Further improvements to type hints, docstrings, and error messages.
9
+
10
+ Version 1.2
11
+ ===========
12
+
13
+ * Minor improvements to type hints, docstrings, and error messages.
14
+
15
+ Version 1.1
16
+ ===========
17
+
18
+ * Fixed bug preventing execution on a generic IQM Backend.
19
+ * Randomized Benchmarking (Clifford, Interleaved and Mirror), Quantum Volume, CLOPS and GHZ state fidelity all functioning exclusively under new Benchmark base class.
20
+ * Updated separate example Jupyter notebooks.
21
+
22
+ Version 1.0
23
+ ===========
24
+
25
+ * Published Randomized Benchmarking (Clifford, Interleaved and Mirror), Quantum Volume, CLOPS and GHZ state fidelity all functioning exclusively under new Benchmark base class.
26
+ * Updated separate example Jupyter notebooks.
@@ -0,0 +1,205 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 IQM
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
203
+
204
+ This repository contains also code from other authors, which is licensed under the following licences:
205
+ * mGST under MIT License (in `src/mGST`) by Raphael Brieger, Ingo Roth, Martin Kliesch (see LICENSE file in mGST folder)
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.1
2
+ Name: iqm-benchmarks
3
+ Version: 1.3
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>
6
+ Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Topic :: Scientific/Engineering :: Physics
10
+ Classifier: Intended Audience :: Science/Research
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: lmfit==1.3.1
15
+ Requires-Dist: matplotlib==3.9.0
16
+ Requires-Dist: more-itertools==10.1.0
17
+ Requires-Dist: mthree==2.6.3
18
+ Requires-Dist: networkx==2.8.8
19
+ Requires-Dist: numpy>=1.24.2
20
+ Requires-Dist: qiskit==0.45.3
21
+ Requires-Dist: qiskit-aer==0.13.3
22
+ Requires-Dist: qiskit-iqm==15.1
23
+ Requires-Dist: scikit-optimize==0.10.2
24
+ Requires-Dist: tabulate==0.9.0
25
+ Requires-Dist: uncertainties==3.2.1
26
+ Requires-Dist: pycurl==7.45.3
27
+ Requires-Dist: xarray==2024.6.0
28
+ Requires-Dist: types-pycurl
29
+ Provides-Extra: develop
30
+ Requires-Dist: tox==4.16.0; extra == "develop"
31
+ Provides-Extra: examples
32
+ Requires-Dist: notebook==7.2.1; extra == "examples"
33
+ 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
+ Requires-Dist: numba==0.60.0; extra == "mgst"
39
+ Provides-Extra: test
40
+ Requires-Dist: black==24.4.2; extra == "test"
41
+ Requires-Dist: isort==5.13.2; extra == "test"
42
+ Requires-Dist: mypy==1.10.1; extra == "test"
43
+ Requires-Dist: pylint==3.2.5; extra == "test"
44
+ Requires-Dist: pytest==7.4.4; extra == "test"
45
+ Requires-Dist: pytest-cov==4.1.0; extra == "test"
46
+ Requires-Dist: pytest-isort==3.1.0; extra == "test"
47
+ Requires-Dist: pytest-mypy==0.10.3; extra == "test"
48
+ Requires-Dist: pytest-pylint==0.21.0; extra == "test"
49
+
50
+ # IQM Benchmarks
51
+
52
+ The IQM Benchmarks is a suite of quantum characterization, verification, and validation (QCVV) tools for quantum computing. It is designed to be a comprehensive tool for benchmarking quantum hardware. The suite is designed to be modular, allowing users to easily add new benchmarks and customize existing ones. The suite is designed to be easy to use, with a simple API that allows users to run benchmarks with a single command.
53
+
54
+
55
+ Below is a list of the benchmarks currently available in the suite:
56
+ * Randomized Benchmarking: A suite of randomized benchmarking protocols for characterizing the performance of quantum gates (Clifford Randomized Benchmarking, Mirror Randomized Benchmarking, Interleaved Randomized Benchmarking).
57
+ * Quantum Volume: A benchmark for characterizing the performance of quantum computers.
58
+ * Q-Score: A benchmark that estimates the size of combinatorial optimization problems a given number of qubits can execute with meaningful results.
59
+ * GHZ State Benchmarking: A benchmark for characterizing the performance of multi-qubit entangled states.
60
+
61
+
62
+ The project is split into different benchmarks, all sharing the `Benchmark` class or the legacy `BenchmarkBase` class. Each individual benchmark takes as an argument their own `BenchmarkConfigurationBase` class. All the (legacy) benchmarks executed at once are wrapped by the `BenchmarkExperiment` class, which handles dependencies among the benchmarks, storing the results, producing the plots...
63
+
64
+
65
+ ## Installation _(latest release)_
66
+
67
+ 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.
68
+
69
+ Start a terminal in your machine, and type
70
+
71
+ ```
72
+ conda create -n iqm-benchmarks python=3.11.2
73
+ conda activate iqm-benchmarks
74
+ ```
75
+
76
+ Then, you can install the latest release of the IQM Benchmarks by running:
77
+ ```bash
78
+ $ pip install iqm-benchmarks
79
+ ```
80
+
81
+ If you have already installed `iqm-benchmarks` and want to get the latest release you can add the --upgrade flag:
82
+
83
+ ```bash
84
+ pip install iqm-benchmarks --upgrade
85
+ ```
86
+
87
+ ## Development mode _(latest changes: recommended)_
88
+
89
+ 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
90
+
91
+ ```bash
92
+ python -m pip install -e ".[develop,test]" --upgrade --upgrade-strategy=eager
93
+ ```
94
+
95
+ To run the tests, you can use the following command:
96
+
97
+ ```bash
98
+ tox -e test
99
+ ```
100
+
101
+ ## Characterize Physical Hardware
102
+
103
+ The IQM Benchmarks suite is designed to be used with real quantum hardware. To use the suite, you will need to have access to a quantum computer. The suite is designed to work with both IQM Resonance (IQM's quantum cloud service) and on-prem devices, but can be easily adapted to work with other quantum computing platforms.
104
+
105
+ To use the suite with IQM Resonance, you will need to set up an account and obtain an API token. You can then set the `IQM_TOKEN` environment variable to your API token. The suite will automatically use this token to authenticate with IQM Resonance.
106
+
107
+ ```python
108
+ import os
109
+ os.environ["IQM_TOKEN"] = "your_token"
110
+ ```
111
+
112
+ ### Using a Jupyter notebook or Python script
113
+
114
+ You can easily set up one or more benchmarks by defining a configuration for them. For example, for Randomized, Interleaved and Mirror Benchmarking, or Quantum Volume:
115
+
116
+ ```python
117
+ from iqm.benchmarks.randomized_benchmarking.interleaved_rb.interleaved_rb import InterleavedRBConfiguration
118
+ from iqm.benchmarks.randomized_benchmarking.mirror_rb.mirror_rb import MirrorRBConfiguration
119
+ from iqm.benchmarks.quantum_volume.quantum_volume import QuantumVolumeConfiguration
120
+
121
+ EXAMPLE_IRB = InterleavedRBConfiguration(
122
+ qubits_array=[[3,4],[8,9]],
123
+ sequence_lengths=[2**(m+1)-1 for m in range(7)],
124
+ num_circuit_samples=30,
125
+ shots=2**10,
126
+ calset_id=None,
127
+ parallel_execution=True,
128
+ interleaved_gate = "iSwapGate",
129
+ interleaved_gate_params = None,
130
+ simultaneous_fit = ["amplitude", "offset"],
131
+ )
132
+
133
+ EXAMPLE_MRB = MirrorRBConfiguration(
134
+ qubits_array=[[0,1],
135
+ [0,1,3,4],
136
+ [0,1,3,4,8,9],
137
+ [0,1,3,4,8,9,13,14],
138
+ [0,1,3,4,8,9,13,14,17,18]],
139
+ depths_array=[[2**m for m in range(9)],
140
+ [2**m for m in range(8)],
141
+ [2**m for m in range(7)],
142
+ [2**m for m in range(6)],
143
+ [2**m for m in range(5)]],
144
+ num_circuit_samples=10,
145
+ num_pauli_samples=5,
146
+ shots=2**8,
147
+ two_qubit_gate_ensemble={"CZGate": 0.7, "iSwapGate": 0.3}, # {GATE: PROBABILITY}
148
+ density_2q_gates=0.25,
149
+ calset_id=None,
150
+ )
151
+
152
+ EXAMPLE_QV = QuantumVolumeConfiguration(
153
+ num_circuits=500,
154
+ shots=2**8,
155
+ calset_id=None,
156
+ num_sigmas=2,
157
+ choose_qubits_routine="custom",
158
+ custom_qubits_array=[[0,1,2,3], [0,1,3,4]],
159
+ qiskit_optim_level=3,
160
+ optimize_sqg=True,
161
+ routing_method="sabre",
162
+ physical_layout="fixed",
163
+ max_gates_per_batch=60_000,
164
+ rem=True,
165
+ mit_shots=1_000,
166
+ )
167
+ ```
168
+
169
+ In order to execute them, you must specify a backend.
170
+ * for IQM Resonance this can be given as a simple string, such as "garnet" (together with your IQM Token environment variable)
171
+ * and for an on-prem device and IQM Resonance this can be defined using the URL of the quantum computer.
172
+
173
+ Also, you need to reference the benchmark configuration you want to run:
174
+
175
+ ```python
176
+ from iqm.benchmarks.randomized_benchmarking.mirror_rb.mirror_rb import *
177
+ # import os
178
+ # os.environ["IQM_TOKEN"] = "your_token"
179
+
180
+ backend = IQMProvider("https://example-station.qc.iqm.fi/cocos/").get_backend()
181
+
182
+ EXAMPLE_EXPERIMENT = MirrorRandomizedBenchmarking(backend, EXAMPLE_MRB)
183
+ EXAMPLE_EXPERIMENT.run()
184
+ ```
185
+
186
+ Full examples on how to run benchmarks and analyze the results can be found in the `examples` folder.
187
+
188
+ ### Scheduled benchmarks using a CI/CD Pipeline
189
+
190
+ This repository can be setup to perform a scheduled (weekly, daily...) benchmark from a Gitlab/Github pipeline, executed on a real device. An example configuration is given in the `scheduled_experiments` folder.