i-qmapper 0.0.5__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 (75) hide show
  1. i_qmapper-0.0.5/LICENSE +202 -0
  2. i_qmapper-0.0.5/NOTICE +28 -0
  3. i_qmapper-0.0.5/PKG-INFO +297 -0
  4. i_qmapper-0.0.5/README.md +254 -0
  5. i_qmapper-0.0.5/i_qmapper.egg-info/PKG-INFO +297 -0
  6. i_qmapper-0.0.5/i_qmapper.egg-info/SOURCES.txt +73 -0
  7. i_qmapper-0.0.5/i_qmapper.egg-info/dependency_links.txt +1 -0
  8. i_qmapper-0.0.5/i_qmapper.egg-info/requires.txt +20 -0
  9. i_qmapper-0.0.5/i_qmapper.egg-info/top_level.txt +1 -0
  10. i_qmapper-0.0.5/iqmapper/__init__.py +37 -0
  11. i_qmapper-0.0.5/iqmapper/_sidebar_css.py +229 -0
  12. i_qmapper-0.0.5/iqmapper/_upload.py +65 -0
  13. i_qmapper-0.0.5/iqmapper/async_util.py +93 -0
  14. i_qmapper-0.0.5/iqmapper/auto_lucj.py +921 -0
  15. i_qmapper-0.0.5/iqmapper/connection.py +496 -0
  16. i_qmapper-0.0.5/iqmapper/constants.py +542 -0
  17. i_qmapper-0.0.5/iqmapper/data.py +1071 -0
  18. i_qmapper-0.0.5/iqmapper/export/__init__.py +128 -0
  19. i_qmapper-0.0.5/iqmapper/export/analysis.py +651 -0
  20. i_qmapper-0.0.5/iqmapper/export/autodetect.py +238 -0
  21. i_qmapper-0.0.5/iqmapper/export/codegen.py +60 -0
  22. i_qmapper-0.0.5/iqmapper/export/data.py +242 -0
  23. i_qmapper-0.0.5/iqmapper/export/layout_io.py +585 -0
  24. i_qmapper-0.0.5/iqmapper/export/scoring.py +178 -0
  25. i_qmapper-0.0.5/iqmapper/export/session.py +254 -0
  26. i_qmapper-0.0.5/iqmapper/html_safe.py +38 -0
  27. i_qmapper-0.0.5/iqmapper/mapper.py +62 -0
  28. i_qmapper-0.0.5/iqmapper/paths.py +164 -0
  29. i_qmapper-0.0.5/iqmapper/plot.py +1145 -0
  30. i_qmapper-0.0.5/iqmapper/stability.py +297 -0
  31. i_qmapper-0.0.5/iqmapper/state.py +460 -0
  32. i_qmapper-0.0.5/iqmapper/ui/__init__.py +15 -0
  33. i_qmapper-0.0.5/iqmapper/ui/analysis_panel.py +929 -0
  34. i_qmapper-0.0.5/iqmapper/ui/backend_switch.py +377 -0
  35. i_qmapper-0.0.5/iqmapper/ui/builder.py +3329 -0
  36. i_qmapper-0.0.5/iqmapper/ui/color_picker.py +244 -0
  37. i_qmapper-0.0.5/iqmapper/ui/history.py +410 -0
  38. i_qmapper-0.0.5/iqmapper/ui/inter_qpu.py +386 -0
  39. i_qmapper-0.0.5/iqmapper/ui/lucj_panel.py +583 -0
  40. i_qmapper-0.0.5/iqmapper/ui/png_export.py +277 -0
  41. i_qmapper-0.0.5/iqmapper/ui/pretty_json.py +247 -0
  42. i_qmapper-0.0.5/iqmapper/ui/session_io.py +338 -0
  43. i_qmapper-0.0.5/iqmapper/ui/status.py +23 -0
  44. i_qmapper-0.0.5/iqmapper/ui/time_panel.py +1393 -0
  45. i_qmapper-0.0.5/iqmapper/ui/widgets_ref.py +39 -0
  46. i_qmapper-0.0.5/pyproject.toml +54 -0
  47. i_qmapper-0.0.5/setup.cfg +4 -0
  48. i_qmapper-0.0.5/tests/test_async_util.py +124 -0
  49. i_qmapper-0.0.5/tests/test_audit_section3_fixes.py +36 -0
  50. i_qmapper-0.0.5/tests/test_calibration_epoch.py +125 -0
  51. i_qmapper-0.0.5/tests/test_constants.py +118 -0
  52. i_qmapper-0.0.5/tests/test_dedup_helpers.py +21 -0
  53. i_qmapper-0.0.5/tests/test_error_tab_backend_switch.py +258 -0
  54. i_qmapper-0.0.5/tests/test_export_analysis.py +51 -0
  55. i_qmapper-0.0.5/tests/test_export_autodetect.py +40 -0
  56. i_qmapper-0.0.5/tests/test_export_codegen.py +27 -0
  57. i_qmapper-0.0.5/tests/test_export_data.py +55 -0
  58. i_qmapper-0.0.5/tests/test_export_layout_io.py +113 -0
  59. i_qmapper-0.0.5/tests/test_export_scoring.py +55 -0
  60. i_qmapper-0.0.5/tests/test_focus_isolate_boundary.py +142 -0
  61. i_qmapper-0.0.5/tests/test_html_safe.py +129 -0
  62. i_qmapper-0.0.5/tests/test_inter_qpu_label.py +102 -0
  63. i_qmapper-0.0.5/tests/test_layout_io.py +95 -0
  64. i_qmapper-0.0.5/tests/test_legend_config.py +42 -0
  65. i_qmapper-0.0.5/tests/test_mapper.py +424 -0
  66. i_qmapper-0.0.5/tests/test_outline_visibility.py +16 -0
  67. i_qmapper-0.0.5/tests/test_paths.py +243 -0
  68. i_qmapper-0.0.5/tests/test_png_colorbars.py +153 -0
  69. i_qmapper-0.0.5/tests/test_scoring_fidelity.py +55 -0
  70. i_qmapper-0.0.5/tests/test_stability.py +142 -0
  71. i_qmapper-0.0.5/tests/test_state.py +174 -0
  72. i_qmapper-0.0.5/tests/test_time_status.py +140 -0
  73. i_qmapper-0.0.5/tests/test_ui_handlers.py +116 -0
  74. i_qmapper-0.0.5/tests/test_upload.py +37 -0
  75. i_qmapper-0.0.5/tests/test_user_save_path.py +22 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
i_qmapper-0.0.5/NOTICE ADDED
@@ -0,0 +1,28 @@
1
+ I-QMapper
2
+ Copyright 2026 Milana Bazayeva and Kenneth M. Merz Jr
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ This product includes software developed at IBM and in the Qiskit
9
+ community ecosystem:
10
+
11
+ 1. Portions of iqmapper/auto_lucj.py (the layout error-scoring routine
12
+ `lightweight_layout_error_scoring`) were adapted from IBM code now
13
+ incorporated in ffsim (`ffsim.qiskit.generate_lucj_pass_manager`),
14
+ https://github.com/qiskit-community/ffsim
15
+ (C) Copyright IBM.
16
+ Licensed under the Apache License, Version 2.0.
17
+ The adapted portions have been modified from the originals.
18
+ The ffsim library is described in: K. J. Sung et al., "ffsim: Faster
19
+ simulation of fermionic quantum circuits", arXiv:2605.03123 (2026).
20
+
21
+ 2. The circuit-fidelity estimator in iqmapper/export/scoring.py
22
+ (`estimate_circuit_fidelity`) implements a cost function in the style
23
+ of mapomatic, https://github.com/qiskit-community/mapomatic
24
+ (C) Copyright IBM.
25
+ Licensed under the Apache License, Version 2.0.
26
+ This is an independent reimplementation of the approach described in:
27
+ P. D. Nation and M. Treinish, "Suppressing quantum circuit errors due
28
+ to system variability", PRX Quantum 4, 010327 (2023).
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: i-qmapper
3
+ Version: 0.0.5
4
+ Summary: Interactive, noise-aware QPU layout mapper for Jupyter Lab
5
+ Author-email: "Kenneth M. Merz Jr" <kmerz1@gmail.com>, Milana Bazayeva <m.bazayeva@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/mbazayeva/i-qmapper
8
+ Project-URL: Issues, https://github.com/mbazayeva/i-qmapper/issues
9
+ Project-URL: Changelog, https://github.com/mbazayeva/i-qmapper/blob/main/CHANGELOG.md
10
+ Project-URL: Paper, https://arxiv.org/abs/2606.27508
11
+ Keywords: quantum,qiskit,qpu,layout,visualization
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Framework :: Jupyter
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Topic :: Scientific/Engineering :: Physics
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Development Status :: 4 - Beta
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ License-File: NOTICE
25
+ Requires-Dist: numpy>=1.23
26
+ Requires-Dist: plotly>=5.13
27
+ Requires-Dist: ipywidgets>=8.0
28
+ Requires-Dist: ipython>=8.0
29
+ Requires-Dist: anywidget>=0.9
30
+ Requires-Dist: qiskit-ibm-runtime>=0.20
31
+ Requires-Dist: qiskit>=1.0
32
+ Requires-Dist: rustworkx>=0.13
33
+ Requires-Dist: platformdirs>=3.0
34
+ Provides-Extra: png
35
+ Requires-Dist: kaleido; extra == "png"
36
+ Provides-Extra: timelapse
37
+ Requires-Dist: imageio; extra == "timelapse"
38
+ Requires-Dist: imageio-ffmpeg; extra == "timelapse"
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest>=7; extra == "dev"
41
+ Requires-Dist: pytest-cov; extra == "dev"
42
+ Dynamic: license-file
43
+
44
+ # I-QMapper
45
+
46
+ **Interactive, noise-aware qubit layout selection for IBM Quantum hardware — see your device, understand its errors, and place your circuit where it will actually run well.**
47
+
48
+ [![tests](https://github.com/mbazayeva/i-qmapper/actions/workflows/tests.yml/badge.svg)](https://github.com/mbazayeva/i-qmapper/actions/workflows/tests.yml)
49
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
50
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-green.svg)](LICENSE)
51
+ [![arXiv](https://img.shields.io/badge/arXiv-2606.27508-b31b1b.svg)](https://arxiv.org/abs/2606.27508)
52
+
53
+ I-QMapper is presented in the paper *I-QMapper: Error-Aware Layout Optimization and
54
+ Device Diagnostics for NISQ Hardware* (Bazayeva & Merz,
55
+ [arXiv:2606.27508](https://arxiv.org/abs/2606.27508)). The repository tracks
56
+ development beyond the arXiv version.
57
+
58
+ ![I-QMapper — auto-placed LUCJ layout with role legend on an IBM Heron device](docs/img/hero.png)
59
+
60
+ **Contents:**
61
+ [Why](#why) ·
62
+ [Features](#features) ·
63
+ [Requirements](#requirements) ·
64
+ [Installation](#installation) ·
65
+ [Set up your IBM Quantum account](#set-up-your-ibm-quantum-account) ·
66
+ [Quickstart](#quickstart) ·
67
+ [Tutorial](TUTORIAL.md) ·
68
+ [How it works](#how-it-works) ·
69
+ [Extending to other vendors](#extending-to-other-vendors) ·
70
+ [Project layout](#project-layout) ·
71
+ [Limitations](#limitations--caveats) ·
72
+ [License & Citing](#license-credits--citing)
73
+
74
+ ---
75
+
76
+ ## Why
77
+
78
+ On NISQ hardware, *where* you place a circuit matters as much as *what* you run:
79
+ gate errors, readout errors, and coherence times vary across the chip and **drift
80
+ over time**. Today you either eyeball calibration tables by hand or trust an
81
+ automated layout pipeline you can't see into. I-QMapper closes that gap: an
82
+ interactive Jupyter tool where the device, its calibration data, its history, and
83
+ your layout live in one view — so every placement decision is **visible,
84
+ inspectable, and reproducible**.
85
+
86
+ ## Features
87
+
88
+ - 🗺️ **Live error heatmaps** on the real device topology — readout, CZ error,
89
+ coherence, and more, straight from current calibration data.
90
+ - 🕰️ **Time travel** — intraday snapshots, multi-day history, and **delta views**
91
+ that show what drifted since yesterday (or since any reference you pick).
92
+ - 📈 **Stability Check** — don't just pick the best qubits *today*; see which
93
+ qubits *stay* good across a 7/14/30-day window.
94
+ - 🎯 **Two operating modes** — a general-purpose mode for arbitrary circuits, and
95
+ a dedicated mode for the **LUCJ ansatz** (quantum chemistry), with one-click
96
+ auto-placement on heavy-hex topologies.
97
+ - 🏆 **Layout scoring & ranking (LQS)** — an error-aware quality score to compare
98
+ candidate layouts before spending QPU time.
99
+ - 📦 **Import & export** — import layouts from JSON / `.npy` / QPY; export
100
+ publication-ready PNGs, time-lapse GIF/MP4 of calibration
101
+ history, full session save/restore, and generated Qiskit code for your chosen
102
+ layout.
103
+ - 🔒 **Local-first** — your IBM Quantum credentials never leave your machine; the
104
+ tool talks to IBM through your own locally saved `QiskitRuntimeService` account.
105
+
106
+ ## Requirements
107
+
108
+ - Python **3.10+**
109
+ - An [IBM Quantum](https://quantum.ibm.com) account with a saved
110
+ `QiskitRuntimeService` credential (see
111
+ [Set up your IBM Quantum account](#set-up-your-ibm-quantum-account))
112
+ - JupyterLab or Jupyter Notebook
113
+
114
+ ## Installation
115
+
116
+ ```bash
117
+ # core
118
+ pip install -e .
119
+
120
+ # core + PNG export (adds kaleido)
121
+ pip install -e ".[png]"
122
+
123
+ # core + PNG + time-lapse GIF/MP4 (adds imageio, imageio-ffmpeg)
124
+ pip install -e ".[png,timelapse]"
125
+
126
+ # development (test suite)
127
+ pip install -e ".[dev]"
128
+ ```
129
+
130
+ ## Set up your IBM Quantum account
131
+
132
+ I-QMapper uses the credentials you save locally with `qiskit-ibm-runtime` —
133
+ it never asks for, stores, or transmits your token itself. One-time setup:
134
+
135
+ ```python
136
+ from qiskit_ibm_runtime import QiskitRuntimeService
137
+
138
+ QiskitRuntimeService.save_account(
139
+ channel='ibm_quantum_platform',
140
+ token='YOUR_TOKEN',
141
+ instance='YOUR_CRN',
142
+ set_as_default=True, # make this your default credential
143
+ overwrite=True,
144
+ )
145
+ ```
146
+
147
+ Find your token and instance CRN on the
148
+ [IBM Quantum Platform](https://quantum.ibm.com) dashboard.
149
+
150
+ **Multiple accounts / instances.** You can save one credential as your
151
+ **default** and give the others a `name=` — for example a premium instance as
152
+ the default, and another instance (e.g. a local QPU) you switch to on demand:
153
+
154
+ ```python
155
+ # premium instance — saved as the default (used when no name is selected)
156
+ QiskitRuntimeService.save_account(
157
+ channel='ibm_quantum_platform',
158
+ token='YOUR_TOKEN',
159
+ instance='PREMIUM_CRN',
160
+ set_as_default=True,
161
+ overwrite=True,
162
+ )
163
+
164
+ # another instance (e.g. a local QPU) — saved under a name, picked explicitly
165
+ QiskitRuntimeService.save_account(
166
+ channel='ibm_quantum_platform',
167
+ token='YOUR_TOKEN',
168
+ instance='OTHER_CRN',
169
+ name='my_backend',
170
+ overwrite=True,
171
+ )
172
+ ```
173
+
174
+ In I-QMapper's **account selector**, the default credential is used unless
175
+ you pick a named one — switch between them anytime without re-entering
176
+ anything.
177
+
178
+ ## Quickstart
179
+
180
+ In a notebook cell:
181
+
182
+ ```python
183
+ from iqmapper import run
184
+ run()
185
+ ```
186
+
187
+ This opens the sidebar UI. Pick **IBM Quantum**, choose your saved account, pick
188
+ a backend, select the ansatz mode, and click **Connect & Launch**. From there
189
+ you can place qubits by hand, auto-place a LUCJ layout, compare candidates by
190
+ score, inspect calibration history, and export everything you see.
191
+
192
+ **New here? Follow the step-by-step [Tutorial](TUTORIAL.md).**
193
+
194
+ | ![Live error heatmap](docs/img/heatmap.png) | ![Delta view — calibration drift](docs/img/delta-view.png) |
195
+ |:--:|:--:|
196
+ | *Live error heatmap* | *Delta view: what drifted since the reference* |
197
+ | ![Stability check](docs/img/stability-report.png) | ![The app](docs/img/app-view.png) |
198
+ | *Stability check over a 14-day window* | *The full editor: layout, scoring, controls* |
199
+
200
+ ## How it works
201
+
202
+ <details>
203
+ <summary><b>Architecture in one paragraph</b> — click to expand</summary>
204
+ <br>
205
+
206
+ The Python kernel is the auth and data layer: calibration data is fetched through
207
+ your locally saved IBM account, cached per-user on disk, and rendered with Plotly
208
+ inside ipywidgets panels. Every analysis (scoring, stability, delta) runs on the
209
+ cached snapshots — so browsing history and comparing layouts costs no QPU time
210
+ and no extra API calls. For a module-by-module tour, see
211
+ [CODE_OVERVIEW.md](CODE_OVERVIEW.md).
212
+
213
+ **Where your data lives:**
214
+
215
+ | What | Where |
216
+ |---|---|
217
+ | Calibration cache | macOS `~/Library/Caches/iqmapper` · Linux `~/.cache/iqmapper` (or `$XDG_CACHE_HOME/iqmapper`) · Windows `%LOCALAPPDATA%\iqmapper\Cache` |
218
+ | Cache override | Set the `IQMAPPER_CACHE_DIR` environment variable to relocate it |
219
+ | Sessions & style presets | `.iqmapper_sessions/` inside the directory your notebook runs from |
220
+
221
+ The cache is safe to delete at any time — the tool recreates it and refetches
222
+ on demand. Your IBM credentials are **not** stored by I-QMapper at all; they
223
+ live in your own `qiskit-ibm-runtime` account store.
224
+
225
+ </details>
226
+
227
+ ## Extending to other vendors
228
+
229
+ <details>
230
+ <summary><b>How the vendor dispatch works</b> — click to expand</summary>
231
+ <br>
232
+
233
+ Backend loading goes through an explicit dispatch table
234
+ (`_VENDOR_LOADERS` in `iqmapper/connection.py`). Adding a provider means
235
+ implementing one loader with the same signature and registering it — the UI,
236
+ scoring, and visualization layers are vendor-agnostic. IBM Quantum is the
237
+ provider shipped today.
238
+
239
+ </details>
240
+
241
+ ## Project layout
242
+
243
+ <details>
244
+ <summary><b>Repository structure</b> — click to expand</summary>
245
+ <br>
246
+
247
+ ```
248
+ iqmapper/
249
+ ├── connection.py # account loading, vendor dispatch, backend selection
250
+ ├── data.py # calibration fetch + per-user cache
251
+ ├── plot.py # device graph & heatmap rendering
252
+ ├── auto_lucj.py # LUCJ auto-placement + layout error scoring
253
+ ├── stability.py # multi-day stability analysis
254
+ ├── state.py # session state, undo/redo, (de)serialization
255
+ ├── export/ # scoring (LQS), layout I/O, codegen, PNG/analysis export
256
+ └── ui/ # ipywidgets panels (builder, time, history, analysis, …)
257
+ tests/ # 183 tests, offline, no QPU required
258
+ ```
259
+
260
+ For a guided tour of the modules and data flow, see
261
+ [CODE_OVERVIEW.md](CODE_OVERVIEW.md).
262
+
263
+ </details>
264
+
265
+ ## Limitations & caveats
266
+
267
+ <details>
268
+ <summary><b>What this tool is not</b> — click to expand</summary>
269
+ <br>
270
+
271
+ - Calibration data is as fresh as IBM's calibration cycle; the tool shows you
272
+ *reported* device quality, which is a strong prior — not a guarantee — of run
273
+ quality.
274
+ - The LQS score is a first-order heuristic for *relative* layout comparison, not
275
+ an absolute fidelity prediction.
276
+ - Heavy-hex auto-placement currently targets IBM Heron/Nighthawk-class devices.
277
+
278
+ </details>
279
+
280
+ ## License, Credits & Citing
281
+
282
+ I-QMapper is released under the [Apache License 2.0](LICENSE) (see also
283
+ [NOTICE](NOTICE)).
284
+
285
+ Parts of this project build on IBM open-source work: the auto-LUCJ layout scorer
286
+ was adapted from IBM code now incorporated in
287
+ [ffsim](https://github.com/qiskit-community/ffsim) (Sung *et al.*,
288
+ [arXiv:2605.03123](https://arxiv.org/abs/2605.03123)), and the layout-quality
289
+ estimator implements a cost function in the style of
290
+ [mapomatic](https://github.com/qiskit-community/mapomatic)
291
+ (Nation & Treinish, *PRX Quantum* **4**, 010327, 2023). The LUCJ ansatz is due to
292
+ Motta *et al.*, *Chem. Sci.* **14**, 11213–11227 (2023),
293
+ [doi:10.1039/D3SC02516K](https://doi.org/10.1039/D3SC02516K).
294
+
295
+ If you use I-QMapper in your research, please cite the I-QMapper paper
296
+ ([arXiv:2606.27508](https://arxiv.org/abs/2606.27508)) — see
297
+ [CITATION.cff](CITATION.cff).