iqm-benchmarks 2.13__tar.gz → 2.14__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.

Potentially problematic release.


This version of iqm-benchmarks might be problematic. Click here for more details.

Files changed (96) hide show
  1. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/CHANGELOG.rst +4 -0
  2. {iqm_benchmarks-2.13/src/iqm_benchmarks.egg-info → iqm_benchmarks-2.14}/PKG-INFO +1 -1
  3. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/conf.py +1 -0
  4. iqm_benchmarks-2.14/docs/devices/devices.rst +8 -0
  5. iqm_benchmarks-2.14/docs/devices/spark.ipynb +792 -0
  6. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/index.rst +1 -0
  7. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14/src/iqm_benchmarks.egg-info}/PKG-INFO +1 -1
  8. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm_benchmarks.egg-info/SOURCES.txt +2 -0
  9. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/.github/workflows/main.yml +0 -0
  10. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/.github/workflows/publish.yml +0 -0
  11. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/.github/workflows/tag_and_release.yml +0 -0
  12. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/.gitignore +0 -0
  13. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/LICENSE +0 -0
  14. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/MANIFEST.in +0 -0
  15. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/README.md +0 -0
  16. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/benchmark_runner.py +0 -0
  17. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docbuild +0 -0
  18. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/API.rst +0 -0
  19. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/Makefile +0 -0
  20. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/_static/images/favicon.ico +0 -0
  21. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/_static/images/logo.png +0 -0
  22. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/_templates/autosummary-class-template.rst +0 -0
  23. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/_templates/autosummary-module-template.rst +0 -0
  24. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/changelog.rst +0 -0
  25. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/development/development.rst +0 -0
  26. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/development/generate_2qubit_cliffords.ipynb +0 -0
  27. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/development/how_to_make_your_own_benchmark.ipynb +0 -0
  28. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_clifford_rb.ipynb +0 -0
  29. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_clops.ipynb +0 -0
  30. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_experiment_all.ipynb +0 -0
  31. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_ghz.ipynb +0 -0
  32. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_gst.ipynb +0 -0
  33. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_interleaved_rb.ipynb +0 -0
  34. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_mirror_rb.ipynb +0 -0
  35. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_qscore.ipynb +0 -0
  36. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_quantum_volume.ipynb +0 -0
  37. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/example_quantum_volume_deneb.ipynb +0 -0
  38. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/examples/examples.rst +0 -0
  39. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/license.rst +0 -0
  40. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/docs/readme.md +0 -0
  41. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/format +0 -0
  42. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/pyproject.toml +0 -0
  43. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/requirements.txt +0 -0
  44. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/scheduled_experiments/adonis/__init__.py +0 -0
  45. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/scheduled_experiments/adonis/weekly.py +0 -0
  46. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/setup.cfg +0 -0
  47. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/__init__.py +0 -0
  48. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/benchmark.py +0 -0
  49. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/benchmark_definition.py +0 -0
  50. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/circuit_containers.py +0 -0
  51. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/compressive_gst/__init__.py +0 -0
  52. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/compressive_gst/compressive_gst.py +0 -0
  53. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/compressive_gst/gst_analysis.py +0 -0
  54. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/entanglement/__init__.py +0 -0
  55. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/entanglement/ghz.py +0 -0
  56. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/logging_config.py +0 -0
  57. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/optimization/__init__.py +0 -0
  58. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/optimization/qscore.py +0 -0
  59. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/quantum_volume/__init__.py +0 -0
  60. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/quantum_volume/clops.py +0 -0
  61. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/quantum_volume/quantum_volume.py +0 -0
  62. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/__init__.py +0 -0
  63. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/clifford_1q.pkl +0 -0
  64. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/clifford_2q.pkl +0 -0
  65. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/clifford_rb/__init__.py +0 -0
  66. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/clifford_rb/clifford_rb.py +0 -0
  67. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/interleaved_rb/__init__.py +0 -0
  68. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/interleaved_rb/interleaved_rb.py +0 -0
  69. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/mirror_rb/__init__.py +0 -0
  70. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/mirror_rb/mirror_rb.py +0 -0
  71. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/multi_lmfit.py +0 -0
  72. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/randomized_benchmarking/randomized_benchmarking_common.py +0 -0
  73. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/readout_mitigation.py +0 -0
  74. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm/benchmarks/utils.py +0 -0
  75. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm_benchmarks.egg-info/dependency_links.txt +0 -0
  76. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm_benchmarks.egg-info/requires.txt +0 -0
  77. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/iqm_benchmarks.egg-info/top_level.txt +0 -0
  78. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/LICENSE +0 -0
  79. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/README.md +0 -0
  80. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/additional_fns.py +0 -0
  81. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/algorithm.py +0 -0
  82. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/compatibility.py +0 -0
  83. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/low_level_jit.py +0 -0
  84. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/optimization.py +0 -0
  85. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/qiskit_interface.py +0 -0
  86. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/reporting/figure_gen.py +0 -0
  87. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/src/mGST/reporting/reporting.py +0 -0
  88. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tag-from-pipeline.sh +0 -0
  89. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/test +0 -0
  90. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tests/test_ghz.py +0 -0
  91. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tests/test_gst.py +0 -0
  92. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tests/test_qscore.py +0 -0
  93. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tests/test_qv.py +0 -0
  94. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tests/test_rb.py +0 -0
  95. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/tests/unit/test_benchmark_circuit.py +0 -0
  96. {iqm_benchmarks-2.13 → iqm_benchmarks-2.14}/update-requirements.py +0 -0
@@ -2,6 +2,10 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ Version 2.14
6
+ ============
7
+ * Added devices folder in docs with notebook to benchmark IQM Spark.
8
+
5
9
  Version 2.13
6
10
  ============
7
11
  * Move all example notebooks to docs. `#30 <https://github.com/iqm-finland/iqm-benchmarks/pull/30>`_
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: iqm-benchmarks
3
- Version: 2.13
3
+ Version: 2.14
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>, Miikka Koistinen <miikka@meetiqm.com>, Adrian Auer <adrian.auer@meetiqm.com>
6
6
  Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
@@ -164,6 +164,7 @@ extlinks = {
164
164
 
165
165
  # -- Options for MyST-NB ---------------------------------------------------------
166
166
  nb_execution_mode = 'off'
167
+ myst_enable_extensions = ["dollarmath"]
167
168
 
168
169
 
169
170
  # -- Options for sphinxcontrib.bibtex -------------------------------------------------
@@ -0,0 +1,8 @@
1
+ Devices
2
+ #######
3
+ This section provides examples and guidance on how to benchmark specific IQM devices.
4
+
5
+ .. toctree::
6
+ :maxdepth: 1
7
+
8
+ spark
@@ -0,0 +1,792 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "8665b62277d47a17",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Benchmarking IQM Spark"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "markdown",
13
+ "id": "afde8699",
14
+ "metadata": {},
15
+ "source": [
16
+ "This notebook allows you to run some useful benchmarks for the Spark system. Before starting, make sure you have installed all the necessary packages:"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "code",
21
+ "execution_count": null,
22
+ "id": "17792e11",
23
+ "metadata": {},
24
+ "outputs": [],
25
+ "source": [
26
+ "!pip install iqm-benchmarks\n",
27
+ "!pip install ipykernel"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "markdown",
32
+ "id": "66ed5587739635b5",
33
+ "metadata": {},
34
+ "source": [
35
+ "## Connect to the backend"
36
+ ]
37
+ },
38
+ {
39
+ "cell_type": "code",
40
+ "execution_count": null,
41
+ "id": "691a27964b11b9ed",
42
+ "metadata": {
43
+ "ExecuteTime": {
44
+ "end_time": "2024-11-26T11:04:54.444032Z",
45
+ "start_time": "2024-11-26T11:04:52.642210Z"
46
+ }
47
+ },
48
+ "outputs": [],
49
+ "source": [
50
+ "import os\n",
51
+ "from iqm.qiskit_iqm import IQMProvider\n",
52
+ "\n",
53
+ "os.environ[\"IQM_TOKENS_FILE\"]=\"YOUR TOKEN HERE\"\n",
54
+ "iqm_url = 'YOUR URL HERE'\n",
55
+ "provider = IQMProvider(iqm_url)\n",
56
+ "backend = provider.get_backend()"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "markdown",
61
+ "id": "06f43ca2",
62
+ "metadata": {},
63
+ "source": [
64
+ "We can access the Spark backend and plot its connectivity graph to check that everything is working properly."
65
+ ]
66
+ },
67
+ {
68
+ "cell_type": "code",
69
+ "execution_count": null,
70
+ "id": "e183e7c5",
71
+ "metadata": {},
72
+ "outputs": [],
73
+ "source": [
74
+ "from rustworkx.visualization import mpl_draw\n",
75
+ "from rustworkx import spring_layout\n",
76
+ "\n",
77
+ "mpl_draw(backend.coupling_map.graph.to_undirected(multigraph=False), arrows=True, with_labels=True, node_color='#32a8a4', pos=spring_layout(backend.coupling_map.graph, num_iter=200))"
78
+ ]
79
+ },
80
+ {
81
+ "cell_type": "markdown",
82
+ "id": "34c084c2",
83
+ "metadata": {},
84
+ "source": [
85
+ "We run the cell below to ignore those warnings that are not critical for the correct run of the benchmarks."
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "code",
90
+ "execution_count": 4,
91
+ "id": "28154b11",
92
+ "metadata": {},
93
+ "outputs": [],
94
+ "source": [
95
+ "import warnings\n",
96
+ "warnings.filterwarnings(action=\"ignore\") "
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "markdown",
101
+ "id": "3a5460c0",
102
+ "metadata": {},
103
+ "source": [
104
+ "## GHZ state fidelity"
105
+ ]
106
+ },
107
+ {
108
+ "cell_type": "markdown",
109
+ "id": "42d71982",
110
+ "metadata": {},
111
+ "source": [
112
+ "The GHZ (Greenberger-Horne-Zeilinger) state is a maximally entangled quantum state that involves three or more qubits, $n$. It is an equal superposition of all qubits being in state 0 and all qubits being in state 1, i.e., $| GHZ \\rangle = \\frac{1}{\\sqrt{2}}(|0\\rangle^{\\otimes n}+|1\\rangle^{\\otimes n})$.\n",
113
+ "\n",
114
+ "The GHZ state fidelity acts as a **witness** for genuine multi-qubit entanglement if found to be above $0.5$. This means that the measurement results cannot be explained without entanglement involving **all** qubits, so it is a great way to evaluate the \"quantumness\" of the computer. \n",
115
+ "\n",
116
+ "The state $\\rho_{\\text{ideal}}= |GHZ\\rangle\\langle GHZ|$ is a pure state, so in this case the fidelity can be computed as:\n",
117
+ "\n",
118
+ "$$\n",
119
+ "F(\\text{ideal}, \\text{measured})= \\langle GHZ | \\rho_{\\text{measured}} | GHZ \\rangle,$$\n",
120
+ "\n",
121
+ "where $\\rho_{\\text{measured}}$ is the density matrix given by the actual results of the quantum computer. The ideal GHZ state density matrix entries can be written as $\\rho_{i,j}=\\langle i| \\rho_{\\text{ideal}} | j \\rangle$ where $i,j$ are the $n$ basis states $\\{|00..0\\rangle, ..., |11..1\\rangle\\}$; only the corner entries $\\rho_{0,0},\\rho_{0,n},\\rho_{n,0}$ and $\\rho_{n,n} $ are non-zero. This simplifies the process since we only need to measure these four components. In the fidelity formula, all other entries are effectively nullified by the zero entries in the ideal state matrix. To measure the coherences (off-diagonal entries) we use the method of multiple quantum coherences [Mooney, 2021](https://iopscience.iop.org/article/10.1088/2399-6528/ac1df7/meta). "
122
+ ]
123
+ },
124
+ {
125
+ "cell_type": "code",
126
+ "execution_count": 5,
127
+ "id": "55bf7633",
128
+ "metadata": {},
129
+ "outputs": [],
130
+ "source": [
131
+ "from iqm.benchmarks.entanglement.ghz import GHZConfiguration, GHZBenchmark"
132
+ ]
133
+ },
134
+ {
135
+ "cell_type": "code",
136
+ "execution_count": 6,
137
+ "id": "29c9dda9",
138
+ "metadata": {},
139
+ "outputs": [],
140
+ "source": [
141
+ "GHZ = GHZConfiguration(\n",
142
+ " state_generation_routine=\"tree\",\n",
143
+ " custom_qubits_array=[[0,1,2,3,4]],\n",
144
+ " shots=1000,\n",
145
+ " qiskit_optim_level=3,\n",
146
+ " optimize_sqg=True,\n",
147
+ " fidelity_routine=\"coherences\", \n",
148
+ " rem=True,\n",
149
+ " mit_shots=1000,\n",
150
+ ")"
151
+ ]
152
+ },
153
+ {
154
+ "cell_type": "markdown",
155
+ "id": "afd7e8b8",
156
+ "metadata": {},
157
+ "source": [
158
+ "> If you want to modify the settings above, please refer to the documentation [here](https://iqm-finland.github.io/iqm-benchmarks/api/iqm.benchmarks.entanglement.ghz.GHZConfiguration.html#iqm.benchmarks.entanglement.ghz.GHZConfiguration)."
159
+ ]
160
+ },
161
+ {
162
+ "cell_type": "markdown",
163
+ "id": "cd0bd717",
164
+ "metadata": {},
165
+ "source": [
166
+ "Before running the benchmark analysis, we can visualize the histogram of counts obtained from measuring a GHZ state on 5 qubits:"
167
+ ]
168
+ },
169
+ {
170
+ "cell_type": "code",
171
+ "execution_count": null,
172
+ "id": "5c2f2077",
173
+ "metadata": {},
174
+ "outputs": [],
175
+ "source": [
176
+ "from iqm.benchmarks.entanglement.ghz import generate_ghz_spanning_tree, get_edges\n",
177
+ "from qiskit import transpile\n",
178
+ "from qiskit.visualization import plot_histogram\n",
179
+ "\n",
180
+ "qubit_layout = [0,1,2,3,4]\n",
181
+ "graph = get_edges(coupling_map=backend.coupling_map, qubit_layout=qubit_layout)\n",
182
+ "ghz_circuit = generate_ghz_spanning_tree(graph, qubit_layout, n_state=5)[0]\n",
183
+ "qc_transp = transpile(ghz_circuit, backend=backend, optimization_level=3)\n",
184
+ "res = backend.run(qc_transp, shots=10000).result() \n",
185
+ "counts=res.get_counts()\n",
186
+ "\n",
187
+ "plot_histogram(counts)"
188
+ ]
189
+ },
190
+ {
191
+ "cell_type": "code",
192
+ "execution_count": null,
193
+ "id": "f2d380a8",
194
+ "metadata": {},
195
+ "outputs": [],
196
+ "source": [
197
+ "benchmark_ghz = GHZBenchmark(backend, GHZ)\n",
198
+ "run_ghz = benchmark_ghz.run()"
199
+ ]
200
+ },
201
+ {
202
+ "cell_type": "code",
203
+ "execution_count": null,
204
+ "id": "7ee53190",
205
+ "metadata": {},
206
+ "outputs": [],
207
+ "source": [
208
+ "result_ghz = benchmark_ghz.analyze()\n",
209
+ "for observation in result_ghz.observations:\n",
210
+ " if observation.identifier.string_identifier == str(qubit_layout):\n",
211
+ " print(f\"{observation.name}: {observation.value}\") "
212
+ ]
213
+ },
214
+ {
215
+ "cell_type": "markdown",
216
+ "id": "beb8d573",
217
+ "metadata": {},
218
+ "source": [
219
+ "## Quantum Volume"
220
+ ]
221
+ },
222
+ {
223
+ "cell_type": "markdown",
224
+ "id": "a8451afb",
225
+ "metadata": {},
226
+ "source": [
227
+ "Quantum volume is a single-number metric that was introduced in [Cross, 2019](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.100.032328). It evaluates the quality of a quantum processor via the largest random *square* circuit, i.e., with the same number of layers of parallel random 2-qubit unitaries as number of qubits, that it can run successfully.\n",
228
+ "\n",
229
+ "The success of a run is based on the heavy output probability, which corresponds to the probability of observing *heavy outputs*, i.e. the measurement outputs that occcur with a probability greater than the median of the distribution. The heavy output generation problem asks if the generated distribution of the random circuit we run contains heavy outputs at least 2/3 of the time (on average) with a high confidence level, typically higher than 97.5%. It can be shown that the heavy output probability for an ideal device is at around 0.85 asymptotically. \n",
230
+ "The quantum volume is then defined as\n",
231
+ "\n",
232
+ "$$\\log_2 V_q = \\underset{n}{\\text{argmax}} \\min (n, d(n))$$\n",
233
+ "\n",
234
+ "where $n \\leq N$ is a number of qubits and $d(n)$ is the *achievable depth*, i.e. the largest depth such that we are confident the probability of observing a heavy output is greater than 2/3.\n"
235
+ ]
236
+ },
237
+ {
238
+ "cell_type": "code",
239
+ "execution_count": 10,
240
+ "id": "2953c181",
241
+ "metadata": {},
242
+ "outputs": [],
243
+ "source": [
244
+ "from iqm.benchmarks.quantum_volume.quantum_volume import QuantumVolumeConfiguration, QuantumVolumeBenchmark"
245
+ ]
246
+ },
247
+ {
248
+ "cell_type": "markdown",
249
+ "id": "aa510035",
250
+ "metadata": {},
251
+ "source": [
252
+ "We define a combination of qubits to test quantum volume on. Due to the star topology, the combinations must contain at least qubit #2 (see topmost graph)."
253
+ ]
254
+ },
255
+ {
256
+ "cell_type": "code",
257
+ "execution_count": 11,
258
+ "id": "0a828dca",
259
+ "metadata": {},
260
+ "outputs": [],
261
+ "source": [
262
+ "QV = QuantumVolumeConfiguration(\n",
263
+ " num_circuits=500, \n",
264
+ " shots=2**8,\n",
265
+ " calset_id=None,\n",
266
+ " num_sigmas=2,\n",
267
+ " choose_qubits_routine=\"custom\",\n",
268
+ " custom_qubits_array=[[0,1,2], [0,2,3], [0,2,4], [1,2,3], [1,2,4]], \n",
269
+ " qiskit_optim_level=3,\n",
270
+ " optimize_sqg=True,\n",
271
+ " max_gates_per_batch=60_000,\n",
272
+ " rem=True,\n",
273
+ " mit_shots=1_000,\n",
274
+ ")"
275
+ ]
276
+ },
277
+ {
278
+ "cell_type": "markdown",
279
+ "id": "f4961b2b",
280
+ "metadata": {},
281
+ "source": [
282
+ "> If you want to modify the settings above, please refer to the documentation [here](https://iqm-finland.github.io/iqm-benchmarks/api/iqm.benchmarks.quantum_volume.quantum_volume.QuantumVolumeConfiguration.html#iqm.benchmarks.quantum_volume.quantum_volume.QuantumVolumeConfiguration)."
283
+ ]
284
+ },
285
+ {
286
+ "cell_type": "markdown",
287
+ "id": "121ddd03",
288
+ "metadata": {},
289
+ "source": [
290
+ "Warning: The following code cell may take few minutes to run since it will compute the benchmark on all the qubit layouts specified above."
291
+ ]
292
+ },
293
+ {
294
+ "cell_type": "code",
295
+ "execution_count": null,
296
+ "id": "4a5abb3d",
297
+ "metadata": {},
298
+ "outputs": [],
299
+ "source": [
300
+ "benchmark_qv = QuantumVolumeBenchmark(backend, QV)\n",
301
+ "run_qv = benchmark_qv.run()"
302
+ ]
303
+ },
304
+ {
305
+ "cell_type": "code",
306
+ "execution_count": null,
307
+ "id": "7d649b35",
308
+ "metadata": {},
309
+ "outputs": [],
310
+ "source": [
311
+ "result_qv = benchmark_qv.analyze()\n",
312
+ "for v in result_qv.plots.values():\n",
313
+ " display(v)"
314
+ ]
315
+ },
316
+ {
317
+ "cell_type": "markdown",
318
+ "id": "bbd2d8a9",
319
+ "metadata": {},
320
+ "source": [
321
+ "## Circuit Layer Operations Per Second (CLOPS)"
322
+ ]
323
+ },
324
+ {
325
+ "cell_type": "markdown",
326
+ "id": "4e659f10",
327
+ "metadata": {},
328
+ "source": [
329
+ "CLOPS is a metric that estimates the speed at which a quantum computer can execute Quantum Volume (QV) layers of a quantum circuit. That is, the circuits to calculate this benchmark have the same structure as the ones used for QV. Here we follow the definition introduced in ([Wack, 2021](https://arxiv.org/abs/2110.14108)), but other versions of this benchmark exist. \n",
330
+ "\n",
331
+ "CLOPS is measured by means of a quantum variational-like protocol, where templates of parametrized QV circuits are assigned random parameters, executed, and outcomes are used as a seed to assign new parameters and repeat the process. The ratio of number of templates ($M$), parameter updates ($K$), measurement shots ($S$) and QV layers ($\\log_2\\mathrm{QV}$) with the time taken to run all, constitutes the CLOPS value: \n",
332
+ "\n",
333
+ "$$\n",
334
+ "\\mathrm{CLOPS}=M\\times{K}\\times{S}\\times\\log_2\\mathrm{QV}/\\mathrm{total\\_time}.\n",
335
+ "$$\n",
336
+ "\n",
337
+ "Notice that the total CLOPS time includes that of assignment of parameters, submission of circuits and retrieval of results."
338
+ ]
339
+ },
340
+ {
341
+ "cell_type": "code",
342
+ "execution_count": 14,
343
+ "id": "1e1687c8",
344
+ "metadata": {},
345
+ "outputs": [],
346
+ "source": [
347
+ "from iqm.benchmarks.quantum_volume.clops import CLOPSConfiguration, CLOPSBenchmark, plot_times"
348
+ ]
349
+ },
350
+ {
351
+ "cell_type": "code",
352
+ "execution_count": 15,
353
+ "id": "e2c3a156",
354
+ "metadata": {},
355
+ "outputs": [],
356
+ "source": [
357
+ "CLOPS = CLOPSConfiguration(\n",
358
+ " qubits=[0,1,2],\n",
359
+ " num_circuits=100,\n",
360
+ " num_updates=10, \n",
361
+ " num_shots=100, \n",
362
+ " calset_id=None,\n",
363
+ " qiskit_optim_level=3,\n",
364
+ " optimize_sqg=True,\n",
365
+ " routing_method=\"sabre\",\n",
366
+ " physical_layout=\"fixed\",\n",
367
+ ")"
368
+ ]
369
+ },
370
+ {
371
+ "cell_type": "markdown",
372
+ "id": "e9f0a8d4",
373
+ "metadata": {},
374
+ "source": [
375
+ "> If you want to modify the settings above, please refer to the documentation [here](https://iqm-finland.github.io/iqm-benchmarks/api/iqm.benchmarks.quantum_volume.clops.CLOPSConfiguration.html#iqm.benchmarks.quantum_volume.clops.CLOPSConfiguration)."
376
+ ]
377
+ },
378
+ {
379
+ "cell_type": "code",
380
+ "execution_count": null,
381
+ "id": "dcd33d91",
382
+ "metadata": {},
383
+ "outputs": [],
384
+ "source": [
385
+ "benchmark_clops = CLOPSBenchmark(backend, CLOPS)\n",
386
+ "run_clops = benchmark_clops.run()"
387
+ ]
388
+ },
389
+ {
390
+ "cell_type": "code",
391
+ "execution_count": null,
392
+ "id": "28d75dac",
393
+ "metadata": {},
394
+ "outputs": [],
395
+ "source": [
396
+ "result_clops = benchmark_clops.analyze()\n",
397
+ "fig_clops = plot_times(result_clops.dataset, result_clops.observations)\n",
398
+ "display(fig_clops[1])"
399
+ ]
400
+ },
401
+ {
402
+ "cell_type": "markdown",
403
+ "id": "61abb7bed3688593",
404
+ "metadata": {},
405
+ "source": [
406
+ "## Clifford Randomized Benchmarking"
407
+ ]
408
+ },
409
+ {
410
+ "cell_type": "markdown",
411
+ "id": "c3bb8c10",
412
+ "metadata": {},
413
+ "source": [
414
+ "The idea behind Clifford Randomized Benchmarking (CRB) is that under certain (simplified) types of noise, the average survival probability of an initial state $|0\\rangle$ under random sequences of Clifford gates and a final sequence inverse will decay exponentially in the length of the sequences. This can be written as\n",
415
+ "\n",
416
+ "$$\n",
417
+ "\\langle0|C_\\text{inv}C_m\\cdots{C}_2C_1|0\\rangle\\sim{A}p^m + B,\n",
418
+ "$$\n",
419
+ "\n",
420
+ "where $C_1, C_2, \\ldots, C_m$ is the random sequences of Clifford gates, $C_\\text{inv}=(C_1C_2\\cdots{C}_m)^{-1}$, $0\\leq{p}\\leq{1}$ and $0\\leq{A,B}\\leq1$ are constants isolating the effects of state-preparation and measurement (SPAM) errors ([Magesan,2012](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.85.042311)). From such decay, one can in turn infer the average fidelity of the corresponding Clifford group. \n",
421
+ "\n",
422
+ "The main assumption we will make here is that the noise can be modeled as Markovian, time-stationary and gate-independent. \n",
423
+ "\n",
424
+ "The theory of CRB under these approximations, and the fact that the multi-qubit Clifford group is a **unitary 2-design** (i.e., uniformly averaging with two pairs of $C$, $C^{\\dagger}$ Clifford operators gives the same result as using fully random unitaries), ensures that the average fidelity of our gate set is given by\n",
425
+ "\n",
426
+ "$$\n",
427
+ "\\overline{F}_\\text{CRB}=p+2^{-n}(1-p).\n",
428
+ "$$\n",
429
+ "\n",
430
+ "CRB is not generally intended to work for $n>2$, both because of the scaling of the size of the $n$-qubit Clifford group in $n$, and because such gates have to eventually be transpiled to a native basis of 1Q and 2Q gates!\n",
431
+ "\n",
432
+ "It is important to mention that the average Clifford fidelity is related to the average fidelity of IQM's native gate set for single-qubit gates as ([Barends, 2014](https://arxiv.org/abs/1402.4848))\n",
433
+ "\n",
434
+ "$$\n",
435
+ "\\overline{F}_\\text{GATE} \\approx 1 - \\frac{1-\\overline{F}_\\text{CRB}}{1.875}.\n",
436
+ "$$\n",
437
+ "\n",
438
+ "This is because all the single-qubit Clifford gates can be decomposed using on average 1.875 gates from IQM's native set. This formula shows that the value of $\\overline{F}_\\text{GATE}$ will always be slightly higher than $\\overline{F}_\\text{CRB}$, so one must be careful when comparing with average fidelities reported in the specs of a QPU. "
439
+ ]
440
+ },
441
+ {
442
+ "cell_type": "code",
443
+ "execution_count": 18,
444
+ "id": "55abfb988cfefe67",
445
+ "metadata": {},
446
+ "outputs": [],
447
+ "source": [
448
+ "from iqm.benchmarks.randomized_benchmarking.clifford_rb.clifford_rb import CliffordRBConfiguration,CliffordRandomizedBenchmarking"
449
+ ]
450
+ },
451
+ {
452
+ "cell_type": "code",
453
+ "execution_count": 19,
454
+ "id": "c34f4b647d6c41b9",
455
+ "metadata": {},
456
+ "outputs": [],
457
+ "source": [
458
+ "CRB = CliffordRBConfiguration(\n",
459
+ " qubits_array=[[0],[1],[2],[3],[4]],\n",
460
+ " sequence_lengths=[2**(m+1)-1 for m in range(9)],\n",
461
+ " num_circuit_samples=25,\n",
462
+ " shots=2**8,\n",
463
+ " calset_id=None,\n",
464
+ " parallel_execution=False,\n",
465
+ ")"
466
+ ]
467
+ },
468
+ {
469
+ "cell_type": "markdown",
470
+ "id": "87a37049",
471
+ "metadata": {},
472
+ "source": [
473
+ "> If you want to modify the settings above, please refer to the documentation [here](https://iqm-finland.github.io/iqm-benchmarks/api/iqm.benchmarks.randomized_benchmarking.clifford_rb.clifford_rb.CliffordRBConfiguration.html#iqm.benchmarks.randomized_benchmarking.clifford_rb.clifford_rb.CliffordRBConfiguration)."
474
+ ]
475
+ },
476
+ {
477
+ "cell_type": "markdown",
478
+ "id": "d9594fe8",
479
+ "metadata": {},
480
+ "source": [
481
+ "Warning: The following code cell may take few minutes to run since it will compute the average fidelities for all the qubits in the QPU (and we set `parallel_execution=False`)."
482
+ ]
483
+ },
484
+ {
485
+ "cell_type": "code",
486
+ "execution_count": null,
487
+ "id": "5bb7f891ebb5acfb",
488
+ "metadata": {},
489
+ "outputs": [],
490
+ "source": [
491
+ "benchmark_clifford_rb = CliffordRandomizedBenchmarking(backend, CRB)\n",
492
+ "run_clifford_rb = benchmark_clifford_rb.run()"
493
+ ]
494
+ },
495
+ {
496
+ "cell_type": "code",
497
+ "execution_count": null,
498
+ "id": "14735341479e13cd",
499
+ "metadata": {},
500
+ "outputs": [],
501
+ "source": [
502
+ "result_clifford_rb = benchmark_clifford_rb.analyze()\n",
503
+ "for plot in result_clifford_rb.plots.values():\n",
504
+ " display(plot)"
505
+ ]
506
+ },
507
+ {
508
+ "cell_type": "markdown",
509
+ "id": "3628adb59f63bfca",
510
+ "metadata": {},
511
+ "source": [
512
+ "## Interleaved Randomized Benchmarking (IRB)"
513
+ ]
514
+ },
515
+ {
516
+ "cell_type": "markdown",
517
+ "id": "5154992b",
518
+ "metadata": {},
519
+ "source": [
520
+ "Differently from the previous protocol, this benchmark aims at estimating the average fidelity of an **individual** quantum gate. This can be achieved interleaving random Clifford gates between the gate of interest. This method was introduced in [Magesan, 2012](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.109.080505), and just as CRB, it is robust with respect to SPAM errors. \n",
521
+ "\n",
522
+ "The protocol runs two sets of sequences, one solely made up of random Clifford gates, as in CRB, and one made up of random Clifford sequences but interleaving the gate of interest among these (and compiling the corresponding sequence inverse). IRB then extracts the corresponding decay parameters (where we expect the decay rate for IRB to be smaller than the CRB one, because the sequence is longer), and the average fidelity of the gate we wish to characterize is then calculated with a simple formula using the two decay parameters. \n"
523
+ ]
524
+ },
525
+ {
526
+ "cell_type": "code",
527
+ "execution_count": 22,
528
+ "id": "efa911273850ece0",
529
+ "metadata": {},
530
+ "outputs": [],
531
+ "source": [
532
+ "from iqm.benchmarks.randomized_benchmarking.interleaved_rb.interleaved_rb import InterleavedRBConfiguration, InterleavedRandomizedBenchmarking"
533
+ ]
534
+ },
535
+ {
536
+ "cell_type": "code",
537
+ "execution_count": 23,
538
+ "id": "41dbb8fa3ed3190",
539
+ "metadata": {},
540
+ "outputs": [],
541
+ "source": [
542
+ "IRB_CZ = InterleavedRBConfiguration(\n",
543
+ " qubits_array=[[0,2],[1,2],[2,3],[2,4]],\n",
544
+ " sequence_lengths=[2**(m+1)-1 for m in range(7)],\n",
545
+ " num_circuit_samples=25,\n",
546
+ " shots=2**8,\n",
547
+ " calset_id=None,\n",
548
+ " parallel_execution=False,\n",
549
+ " interleaved_gate = \"CZGate\",\n",
550
+ " interleaved_gate_params = None,\n",
551
+ " simultaneous_fit = [\"amplitude\", \"offset\"],\n",
552
+ ")"
553
+ ]
554
+ },
555
+ {
556
+ "cell_type": "markdown",
557
+ "id": "9995ba2a",
558
+ "metadata": {},
559
+ "source": [
560
+ "> If you want to modify the settings above, please refer to the documentation [here](https://iqm-finland.github.io/iqm-benchmarks/api/iqm.benchmarks.randomized_benchmarking.interleaved_rb.interleaved_rb.InterleavedRBConfiguration.html#iqm.benchmarks.randomized_benchmarking.interleaved_rb.interleaved_rb.InterleavedRBConfiguration)."
561
+ ]
562
+ },
563
+ {
564
+ "cell_type": "markdown",
565
+ "id": "a905bbf2",
566
+ "metadata": {},
567
+ "source": [
568
+ "NB: Clifford RB is executed by default when running Interleaved RB!"
569
+ ]
570
+ },
571
+ {
572
+ "cell_type": "markdown",
573
+ "id": "4e8b9bd5",
574
+ "metadata": {},
575
+ "source": [
576
+ "Warning: The following code cells may take **several** minutes to run."
577
+ ]
578
+ },
579
+ {
580
+ "cell_type": "code",
581
+ "execution_count": null,
582
+ "id": "c9da15580b9948c8",
583
+ "metadata": {},
584
+ "outputs": [],
585
+ "source": [
586
+ "benchmark_irb_CZ = InterleavedRandomizedBenchmarking(backend, IRB_CZ)\n",
587
+ "run_irb_CZ = benchmark_irb_CZ.run()"
588
+ ]
589
+ },
590
+ {
591
+ "cell_type": "code",
592
+ "execution_count": null,
593
+ "id": "c53f2f4ec7629351",
594
+ "metadata": {},
595
+ "outputs": [],
596
+ "source": [
597
+ "result_irb_CZ = benchmark_irb_CZ.analyze()\n",
598
+ "for plot in result_irb_CZ.plots.values():\n",
599
+ " display(plot)"
600
+ ]
601
+ },
602
+ {
603
+ "cell_type": "markdown",
604
+ "id": "4ee1e163",
605
+ "metadata": {},
606
+ "source": [
607
+ "## Q-Score"
608
+ ]
609
+ },
610
+ {
611
+ "cell_type": "markdown",
612
+ "id": "e62cba69",
613
+ "metadata": {},
614
+ "source": [
615
+ "*The Q-score measures the maximum number of qubits that can be used\n",
616
+ "effectively to solve the MaxCut combinatorial optimization problem with the Quantum Approximate\n",
617
+ "Optimization Algorithm* - [Martiel,2021](https://ieeexplore.ieee.org/document/9459509)\n",
618
+ "\n",
619
+ "The graphs chosen for the benchmark are random Erdős-Rényi graphs with 50% edge-probability between nodes.\n",
620
+ "The obtained cost of the solution, i.e. the average number of cut edges, must be above a certain threshold. Specifically, one has to find the cost of a graph to be above $\\beta\\geq 0.2$ on a scale where $\\beta = 0$ corresponds to a random solution and $\\beta = 1$ to an ideal solution. "
621
+ ]
622
+ },
623
+ {
624
+ "cell_type": "code",
625
+ "execution_count": null,
626
+ "id": "036d7839",
627
+ "metadata": {},
628
+ "outputs": [],
629
+ "source": [
630
+ "from iqm.benchmarks.optimization.qscore import QScoreConfiguration, QScoreBenchmark"
631
+ ]
632
+ },
633
+ {
634
+ "cell_type": "code",
635
+ "execution_count": null,
636
+ "id": "22b8116c",
637
+ "metadata": {},
638
+ "outputs": [],
639
+ "source": [
640
+ "QSCORE = QScoreConfiguration(\n",
641
+ " num_instances = 100,\n",
642
+ " num_qaoa_layers= 1,\n",
643
+ " shots = 2**8,\n",
644
+ " calset_id=None, \n",
645
+ " min_num_nodes = 2,\n",
646
+ " max_num_nodes = 5,\n",
647
+ " use_virtual_node = True,\n",
648
+ " use_classically_optimized_angles = True,\n",
649
+ " choose_qubits_routine = \"custom\",\n",
650
+ " custom_qubits_array=[[2],\n",
651
+ " [2, 0],\n",
652
+ " [2, 0, 1],\n",
653
+ " [2, 0, 1, 3],\n",
654
+ " [2, 0, 1, 3, 4]],\n",
655
+ " seed = 1\n",
656
+ " )"
657
+ ]
658
+ },
659
+ {
660
+ "cell_type": "markdown",
661
+ "id": "58813ef0",
662
+ "metadata": {},
663
+ "source": [
664
+ "> If you want to modify the settings above, please refer to the documentation [here](https://iqm-finland.github.io/iqm-benchmarks/api/iqm.benchmarks.optimization.qscore.QScoreConfiguration.html#iqm.benchmarks.optimization.qscore.QScoreConfiguration)."
665
+ ]
666
+ },
667
+ {
668
+ "cell_type": "markdown",
669
+ "id": "c5f14175",
670
+ "metadata": {},
671
+ "source": [
672
+ "Warning: The following code cell may take **several** minutes to run."
673
+ ]
674
+ },
675
+ {
676
+ "cell_type": "code",
677
+ "execution_count": null,
678
+ "id": "aed5ee90",
679
+ "metadata": {},
680
+ "outputs": [],
681
+ "source": [
682
+ "benchmark_qscore = QScoreBenchmark(backend, QSCORE)\n",
683
+ "run_qscore = benchmark_qscore.run()"
684
+ ]
685
+ },
686
+ {
687
+ "cell_type": "code",
688
+ "execution_count": null,
689
+ "id": "0bec0284",
690
+ "metadata": {},
691
+ "outputs": [],
692
+ "source": [
693
+ "result_qscore = benchmark_qscore.analyze()"
694
+ ]
695
+ },
696
+ {
697
+ "cell_type": "code",
698
+ "execution_count": null,
699
+ "id": "619342db",
700
+ "metadata": {},
701
+ "outputs": [],
702
+ "source": [
703
+ "result_qscore.plot_all()"
704
+ ]
705
+ },
706
+ {
707
+ "cell_type": "markdown",
708
+ "id": "70bdb002",
709
+ "metadata": {},
710
+ "source": [
711
+ "## Summary"
712
+ ]
713
+ },
714
+ {
715
+ "cell_type": "markdown",
716
+ "id": "c144b300",
717
+ "metadata": {},
718
+ "source": [
719
+ "Typical performance for IQM Spark is summarized in the table below and compared to the values obtained with your device. The typical single- and two-qubit gate fidelities reported below refer to the median over the 5 qubits and 4 couplings of the system, respectively."
720
+ ]
721
+ },
722
+ {
723
+ "cell_type": "code",
724
+ "execution_count": null,
725
+ "id": "d805a3d9",
726
+ "metadata": {},
727
+ "outputs": [],
728
+ "source": [
729
+ "import numpy as np\n",
730
+ "\n",
731
+ "### GHZ\n",
732
+ "obs_ghz = result_ghz.observations\n",
733
+ "fidelity = round(min([obs_ghz[i].value for i in range(len(obs_ghz)) if obs_ghz[i].name=='fidelity']),2)\n",
734
+ "\n",
735
+ "### QV\n",
736
+ "obs_qv = result_qv.observations\n",
737
+ "qv = max([obs_qv[i].value for i in range(len(obs_qv)) if obs_qv[i].name=='QV_result'])\n",
738
+ "\n",
739
+ "### CLOPS\n",
740
+ "obs_clops = result_clops.observations\n",
741
+ "clops = max([obs_clops[item]['clops_v']['value'] for item in obs_clops])\n",
742
+ "\n",
743
+ "### CRB\n",
744
+ "obs_crb = result_clifford_rb.observations\n",
745
+ "f_crb = round(np.median([obs_crb[i].value for i in range(len(obs_crb))]),3)\n",
746
+ "\n",
747
+ "### IRB\n",
748
+ "obs_irb = result_irb_CZ.observations\n",
749
+ "f_irb = round(np.median([obs_irb[i].value for i in range(len(obs_irb)) if obs_irb[i].name=='avg_gate_fidelity_interleaved']),3)\n",
750
+ "\n",
751
+ "### QS \n",
752
+ "obs_qs = result_qscore.observations\n",
753
+ "qs = np.argmin([obs_qs[i].value-0.2 for i in range(len(obs_qs)) if obs_qs[i].name == 'approximation_ratio' and obs_qs[i].value-0.2>0])+2\n",
754
+ "\n",
755
+ "\n",
756
+ "summary = {'5-qubit GHZ state fidelity': ['≥ 0.5', fidelity],\n",
757
+ " 'Quantum Volume': ['≥ 8', qv], \n",
758
+ " 'CLOPS': ['3000', clops], \n",
759
+ " 'Single-qubit gate fidelity': ['≥ 0.999', f_crb],\n",
760
+ " 'Two-qubit gate (CZ) fidelity': ['≥ 0.98', f_irb], \n",
761
+ " 'Q-Score': ['≥ 5', qs] \n",
762
+ "}\n",
763
+ "\n",
764
+ "print(\"{:<30} {:<15} {:<15}\".format('Benchmark', 'Typical', 'Your device'))\n",
765
+ "for k, v in summary.items():\n",
766
+ " label, num = v\n",
767
+ " print(\"{:<30} {:<15} {:<15}\".format(k, label, num))"
768
+ ]
769
+ }
770
+ ],
771
+ "metadata": {
772
+ "kernelspec": {
773
+ "display_name": "iqm-benchmarks",
774
+ "language": "python",
775
+ "name": "python3"
776
+ },
777
+ "language_info": {
778
+ "codemirror_mode": {
779
+ "name": "ipython",
780
+ "version": 3
781
+ },
782
+ "file_extension": ".py",
783
+ "mimetype": "text/x-python",
784
+ "name": "python",
785
+ "nbconvert_exporter": "python",
786
+ "pygments_lexer": "ipython3",
787
+ "version": "3.11.2"
788
+ }
789
+ },
790
+ "nbformat": 4,
791
+ "nbformat_minor": 5
792
+ }
@@ -16,6 +16,7 @@ Contents
16
16
 
17
17
  readme
18
18
  examples/examples
19
+ devices/devices
19
20
  development/development
20
21
  API
21
22
  license
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: iqm-benchmarks
3
- Version: 2.13
3
+ Version: 2.14
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>, Miikka Koistinen <miikka@meetiqm.com>, Adrian Auer <adrian.auer@meetiqm.com>
6
6
  Project-URL: Homepage, https://github.com/iqm-finland/iqm-benchmarks
@@ -28,6 +28,8 @@ docs/_templates/autosummary-module-template.rst
28
28
  docs/development/development.rst
29
29
  docs/development/generate_2qubit_cliffords.ipynb
30
30
  docs/development/how_to_make_your_own_benchmark.ipynb
31
+ docs/devices/devices.rst
32
+ docs/devices/spark.ipynb
31
33
  docs/examples/example_clifford_rb.ipynb
32
34
  docs/examples/example_clops.ipynb
33
35
  docs/examples/example_experiment_all.ipynb
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes