q1lens 0.1.1__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 (95) hide show
  1. q1lens-0.1.1/LICENSE +201 -0
  2. q1lens-0.1.1/NOTICE +9 -0
  3. q1lens-0.1.1/PKG-INFO +261 -0
  4. q1lens-0.1.1/README.md +235 -0
  5. q1lens-0.1.1/pyproject.toml +49 -0
  6. q1lens-0.1.1/setup.cfg +4 -0
  7. q1lens-0.1.1/src/q1lens/__init__.py +8 -0
  8. q1lens-0.1.1/src/q1lens/__main__.py +9 -0
  9. q1lens-0.1.1/src/q1lens/cli.py +9 -0
  10. q1lens-0.1.1/src/q1lens.egg-info/PKG-INFO +261 -0
  11. q1lens-0.1.1/src/q1lens.egg-info/SOURCES.txt +93 -0
  12. q1lens-0.1.1/src/q1lens.egg-info/dependency_links.txt +1 -0
  13. q1lens-0.1.1/src/q1lens.egg-info/entry_points.txt +4 -0
  14. q1lens-0.1.1/src/q1lens.egg-info/requires.txt +8 -0
  15. q1lens-0.1.1/src/q1lens.egg-info/top_level.txt +3 -0
  16. q1lens-0.1.1/src/q1timeline/__init__.py +1 -0
  17. q1lens-0.1.1/src/q1timeline/__main__.py +5 -0
  18. q1lens-0.1.1/src/q1timeline/analysis/__init__.py +20 -0
  19. q1lens-0.1.1/src/q1timeline/analysis/alignment.py +233 -0
  20. q1lens-0.1.1/src/q1timeline/analysis/api.py +219 -0
  21. q1lens-0.1.1/src/q1timeline/analysis/interpreter.py +4317 -0
  22. q1lens-0.1.1/src/q1timeline/analysis/underflow.py +320 -0
  23. q1lens-0.1.1/src/q1timeline/analysis/values.py +300 -0
  24. q1lens-0.1.1/src/q1timeline/cli.py +768 -0
  25. q1lens-0.1.1/src/q1timeline/diagnostic_catalog.py +333 -0
  26. q1lens-0.1.1/src/q1timeline/diagnostics.py +112 -0
  27. q1lens-0.1.1/src/q1timeline/ir/__init__.py +3 -0
  28. q1lens-0.1.1/src/q1timeline/ir/control_flow_graph.py +274 -0
  29. q1lens-0.1.1/src/q1timeline/ir/serialize.py +783 -0
  30. q1lens-0.1.1/src/q1timeline/plugins/__init__.py +23 -0
  31. q1lens-0.1.1/src/q1timeline/plugins/base.py +58 -0
  32. q1lens-0.1.1/src/q1timeline/plugins/builtins.py +201 -0
  33. q1lens-0.1.1/src/q1timeline/project.py +935 -0
  34. q1lens-0.1.1/src/q1timeline/q1asm/__init__.py +3 -0
  35. q1lens-0.1.1/src/q1timeline/q1asm/ast.py +42 -0
  36. q1lens-0.1.1/src/q1timeline/q1asm/instruction_table.py +634 -0
  37. q1lens-0.1.1/src/q1timeline/q1asm/parser.py +526 -0
  38. q1lens-0.1.1/src/q1timeline/render/__init__.py +3 -0
  39. q1lens-0.1.1/src/q1timeline/render/html.py +3153 -0
  40. q1lens-0.1.1/src/q1timeline/sequence.py +353 -0
  41. q1lens-0.1.1/src/q1timeline/watch/__init__.py +15 -0
  42. q1lens-0.1.1/src/q1timeline/watch/watcher.py +373 -0
  43. q1lens-0.1.1/src/qbstimeline/__init__.py +9 -0
  44. q1lens-0.1.1/src/qbstimeline/__main__.py +6 -0
  45. q1lens-0.1.1/src/qbstimeline/_access.py +35 -0
  46. q1lens-0.1.1/src/qbstimeline/adapters/__init__.py +1 -0
  47. q1lens-0.1.1/src/qbstimeline/adapters/q1timeline.py +41 -0
  48. q1lens-0.1.1/src/qbstimeline/artifacts.py +79 -0
  49. q1lens-0.1.1/src/qbstimeline/cli.py +169 -0
  50. q1lens-0.1.1/src/qbstimeline/compile_worker.py +1803 -0
  51. q1lens-0.1.1/src/qbstimeline/consistency.py +416 -0
  52. q1lens-0.1.1/src/qbstimeline/extract/__init__.py +1 -0
  53. q1lens-0.1.1/src/qbstimeline/extract/symbolic_pulses.py +804 -0
  54. q1lens-0.1.1/src/qbstimeline/ir/__init__.py +1 -0
  55. q1lens-0.1.1/src/qbstimeline/ir/serialize.py +81 -0
  56. q1lens-0.1.1/src/qbstimeline/ir/validation.py +648 -0
  57. q1lens-0.1.1/src/qbstimeline/notebook.py +139 -0
  58. q1lens-0.1.1/src/qbstimeline/project.py +136 -0
  59. q1lens-0.1.1/src/qbstimeline/provenance.py +99 -0
  60. q1lens-0.1.1/src/qbstimeline/provenance_inference.py +718 -0
  61. q1lens-0.1.1/src/qbstimeline/q1timeline_bridge.py +93 -0
  62. q1lens-0.1.1/src/qbstimeline/render/__init__.py +1 -0
  63. q1lens-0.1.1/src/qbstimeline/render/gallery.py +113 -0
  64. q1lens-0.1.1/src/qbstimeline/render/html.py +440 -0
  65. q1lens-0.1.1/src/qbstimeline/source_tracing.py +228 -0
  66. q1lens-0.1.1/src/qbstimeline/symbols.py +82 -0
  67. q1lens-0.1.1/tests/test_access.py +30 -0
  68. q1lens-0.1.1/tests/test_adaptive_array_demo.py +140 -0
  69. q1lens-0.1.1/tests/test_artifacts.py +97 -0
  70. q1lens-0.1.1/tests/test_cli.py +216 -0
  71. q1lens-0.1.1/tests/test_compile_worker.py +2972 -0
  72. q1lens-0.1.1/tests/test_consistency.py +220 -0
  73. q1lens-0.1.1/tests/test_cursor_frequency_demo.py +679 -0
  74. q1lens-0.1.1/tests/test_examples.py +100 -0
  75. q1lens-0.1.1/tests/test_gallery.py +55 -0
  76. q1lens-0.1.1/tests/test_ir_validation.py +164 -0
  77. q1lens-0.1.1/tests/test_notebook.py +159 -0
  78. q1lens-0.1.1/tests/test_pixi_standalone_demo.py +240 -0
  79. q1lens-0.1.1/tests/test_project.py +169 -0
  80. q1lens-0.1.1/tests/test_provenance.py +178 -0
  81. q1lens-0.1.1/tests/test_provenance_inference.py +645 -0
  82. q1lens-0.1.1/tests/test_q1asm_assembler_parity.py +823 -0
  83. q1lens-0.1.1/tests/test_q1asm_tutorial_examples.py +291 -0
  84. q1lens-0.1.1/tests/test_q1asm_vscode_grammar.py +68 -0
  85. q1lens-0.1.1/tests/test_q1lens_alias.py +41 -0
  86. q1lens-0.1.1/tests/test_q1timeline_adapter.py +35 -0
  87. q1lens-0.1.1/tests/test_q1timeline_alignment.py +37 -0
  88. q1lens-0.1.1/tests/test_q1timeline_bridge.py +98 -0
  89. q1lens-0.1.1/tests/test_q1timeline_control_flow_graph.py +77 -0
  90. q1lens-0.1.1/tests/test_q1timeline_renderer.py +811 -0
  91. q1lens-0.1.1/tests/test_qblox_application_probes.py +742 -0
  92. q1lens-0.1.1/tests/test_renderer.py +238 -0
  93. q1lens-0.1.1/tests/test_source_tracing.py +87 -0
  94. q1lens-0.1.1/tests/test_symbolic_pulses.py +530 -0
  95. q1lens-0.1.1/tests/test_symbols.py +93 -0
q1lens-0.1.1/LICENSE ADDED
@@ -0,0 +1,201 @@
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 [yyyy] [name of copyright owner]
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.
q1lens-0.1.1/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ Q1Lens
2
+ Copyright 2026 Ik Kyeong Jin
3
+
4
+ Q1Lens was conceived and originally developed by Ik Kyeong Jin as an
5
+ independent side project while employed by Qblox B.V.
6
+
7
+ Q1Lens is independently owned and maintained by Ik Kyeong Jin. It is not an
8
+ official Qblox product and is not sponsored, endorsed, or maintained by
9
+ Qblox B.V.
q1lens-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: q1lens
3
+ Version: 0.1.1
4
+ Summary: Cross-layer scheduler and Q1ASM debugger for Qblox workflows
5
+ Author: Ik Kyeong Jin
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/ikjin2/q1lens
8
+ Project-URL: Repository, https://github.com/ikjin2/q1lens.git
9
+ Project-URL: Issues, https://github.com/ikjin2/q1lens/issues
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Topic :: Software Development :: Debuggers
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: NOTICE
20
+ Requires-Dist: PyYAML>=6.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: build>=1.2; extra == "dev"
23
+ Requires-Dist: pytest>=8.0; extra == "dev"
24
+ Requires-Dist: tomli>=2.0; python_version < "3.11" and extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ # Q1Lens
28
+
29
+ See how a Qblox schedule becomes pulses and Q1ASM without leaving VS Code.
30
+
31
+ Q1Lens is a cross-layer debugger for `qblox-scheduler` workflows. It connects
32
+ three views of the same program:
33
+
34
+ 1. scheduled operations such as `Reset`, `X`, and `Measure`;
35
+ 2. pulses and acquisitions grouped by port and clock;
36
+ 3. the Q1ASM program executed by each sequencer.
37
+
38
+ This makes it easier to answer questions such as:
39
+
40
+ - When does this operation run?
41
+ - Which pulse or acquisition did it produce?
42
+ - Which sequencer received it?
43
+ - Which Q1ASM instructions implement it?
44
+
45
+ Q1Lens can also inspect standalone `.q1asm` files when no schedule project is
46
+ available.
47
+
48
+ Created by [Ik Kyeong Jin](https://github.com/ikjin2).
49
+
50
+ ## Requirements
51
+
52
+ - Python 3.10 or newer
53
+ - VS Code 1.90 or newer
54
+ - A Python environment containing the dependencies used by your schedule
55
+
56
+ Q1Lens imports and runs your schedule code during analysis. Install the Python
57
+ package in the same environment as the schedule project.
58
+
59
+ ## Install
60
+
61
+ ### With uv
62
+
63
+ Add Q1Lens as a development dependency:
64
+
65
+ ```console
66
+ uv add --dev q1lens
67
+ uv run q1lens --help
68
+ ```
69
+
70
+ Install
71
+ [Q1Lens from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=q1lens.q1lens),
72
+ then add this to your VS Code settings:
73
+
74
+ ```json
75
+ {
76
+ "q1lens.pythonPath": "uv",
77
+ "q1lens.pythonArgs": ["run", "python"]
78
+ }
79
+ ```
80
+
81
+ The extension will then run Q1Lens through the current uv project environment.
82
+
83
+ ### With pip
84
+
85
+ Activate the environment used by your schedule project, then install Q1Lens:
86
+
87
+ ```console
88
+ python -m pip install q1lens
89
+ python -m q1lens --help
90
+ ```
91
+
92
+ Install the VS Code extension from the Marketplace. If `python` does not refer
93
+ to the correct environment, set `q1lens.pythonPath` to its interpreter:
94
+
95
+ ```json
96
+ {
97
+ "q1lens.pythonPath": ".venv/bin/python"
98
+ }
99
+ ```
100
+
101
+ On Windows, use `.venv\\Scripts\\python.exe`.
102
+
103
+ ## Quick start
104
+
105
+ Create `qbstimeline.yml` in your schedule project:
106
+
107
+ ```yaml
108
+ schedule:
109
+ file: schedule.py
110
+ entrypoint: build_schedule
111
+ compiler: build_compiler
112
+
113
+ outputs:
114
+ dir: .qbs_timeline
115
+
116
+ low_level:
117
+ q1timeline: true
118
+ ```
119
+
120
+ Expose two functions from `schedule.py`:
121
+
122
+ ```python
123
+ def build_schedule():
124
+ ...
125
+
126
+
127
+ def build_compiler():
128
+ ...
129
+ ```
130
+
131
+ The compiler returned by `build_compiler()` must provide
132
+ `compile(schedule)`. Its result must expose `compiled_instructions` when Q1ASM
133
+ inspection is required.
134
+
135
+ Then:
136
+
137
+ 1. Open the project folder in VS Code.
138
+ 2. Open `qbstimeline.yml`.
139
+ 3. Run **Q1Lens: Analyze and Open** from the Command Palette.
140
+ 4. Select an operation to inspect its pulse and Q1ASM context.
141
+
142
+ Q1Lens writes generated files under `.qbs_timeline/`:
143
+
144
+ ```text
145
+ .qbs_timeline/
146
+ |-- qbs_ir.json
147
+ |-- index.html
148
+ |-- q1asm/
149
+ | `-- <sequencer>.q1asm
150
+ `-- q1timeline.yml
151
+ ```
152
+
153
+ The same flow is available from the command line:
154
+
155
+ ```console
156
+ uv run q1lens analyze --project examples/basic-transmon/qbstimeline.yml --out examples/basic-transmon/.qbs_timeline/qbs_ir.json
157
+
158
+ uv run q1lens render --ir examples/basic-transmon/.qbs_timeline/qbs_ir.json --out examples/basic-transmon/.qbs_timeline/index.html
159
+ ```
160
+
161
+ When using pip, replace `uv run q1lens` with `python -m q1lens`.
162
+
163
+ ## Standalone Q1ASM
164
+
165
+ You can inspect Q1ASM without a schedule project:
166
+
167
+ 1. Open a `.q1asm` file.
168
+ 2. Run **Q1Lens: Open Timeline Preview**.
169
+ 3. Use **Q1Lens: Select Q1ASM Files in Folder...** if only some sibling files
170
+ should be included.
171
+
172
+ If Q1Lens finds a nearby `q1timeline.yml`, it uses that project. Otherwise, it
173
+ creates `.q1timeline/auto-generated.q1timeline.yml` next to the selected file
174
+ and includes the sibling `.q1asm` files in that folder.
175
+
176
+ Try the included example at
177
+ `examples/q1asm-standalone-demo/drive.q1asm`.
178
+
179
+ ## Symbolic values and Q1ASM mapping
180
+
181
+ Use annotations when a scheduler value should retain its human-readable name:
182
+
183
+ ```python
184
+ from q1lens import annotate, sym
185
+
186
+ T_TOTAL = sym.time("T_TOTAL", 40e-9)
187
+ AMP_X = sym.amp("AMP_X", 0.32)
188
+
189
+ sched.add(
190
+ annotate(
191
+ SquarePulse(
192
+ duration=40e-9,
193
+ amp=0.32,
194
+ port="q0:mw",
195
+ clock="q0.01",
196
+ ),
197
+ duration=T_TOTAL,
198
+ amp=AMP_X,
199
+ ),
200
+ label="x180",
201
+ )
202
+ ```
203
+
204
+ Exact schedule-to-Q1ASM line mapping uses compiler-provided
205
+ `qbstimeline_provenance`. When that data is absent, Q1Lens can infer mappings
206
+ for simple, unique `play` and `acquire` instructions. Ambiguous or optimized
207
+ lowerings remain visible without claiming an exact source mapping.
208
+
209
+ Optional native diagrams are disabled by default. Enable them in
210
+ `qbstimeline.yml` when the schedule supports the corresponding plotting
211
+ methods:
212
+
213
+ ```yaml
214
+ artifacts:
215
+ circuit_diagram: true
216
+ analog_pulse_diagram: true
217
+ ```
218
+
219
+ ## Development
220
+
221
+ Python:
222
+
223
+ ```console
224
+ git clone https://github.com/ikjin2/q1lens.git
225
+ cd q1lens
226
+ uv sync --extra dev
227
+ uv run pytest -q
228
+ uv build
229
+ ```
230
+
231
+ VS Code extension:
232
+
233
+ ```console
234
+ cd vscode-extension
235
+ npm ci
236
+ npm test
237
+ npm run test:extension
238
+ npm run package
239
+ ```
240
+
241
+ See [Migrating to Q1Lens](docs/migration-from-qbs-and-q1timeline.md) when
242
+ replacing the older separate QBS Timeline and q1timeline extensions.
243
+
244
+ ## Project status and authorship
245
+
246
+ Q1Lens is an early-stage project. It was conceived and originally developed by
247
+ [Ik Kyeong Jin](https://github.com/ikjin2) as an independent side project while
248
+ employed by [Qblox B.V.](https://qblox.com/).
249
+
250
+ Q1Lens is independently owned and maintained by Ik Kyeong Jin. It is not an
251
+ official Qblox product and is not sponsored, endorsed, or maintained by
252
+ Qblox B.V.
253
+
254
+ OpenAI Codex was used as an AI-assisted development tool for implementation,
255
+ testing, review, and documentation. All technical decisions and released
256
+ changes are reviewed and accepted by the project maintainer.
257
+
258
+ ## License
259
+
260
+ Q1Lens is licensed under the [Apache License 2.0](LICENSE). See
261
+ [NOTICE](NOTICE) for project attribution and history.
q1lens-0.1.1/README.md ADDED
@@ -0,0 +1,235 @@
1
+ # Q1Lens
2
+
3
+ See how a Qblox schedule becomes pulses and Q1ASM without leaving VS Code.
4
+
5
+ Q1Lens is a cross-layer debugger for `qblox-scheduler` workflows. It connects
6
+ three views of the same program:
7
+
8
+ 1. scheduled operations such as `Reset`, `X`, and `Measure`;
9
+ 2. pulses and acquisitions grouped by port and clock;
10
+ 3. the Q1ASM program executed by each sequencer.
11
+
12
+ This makes it easier to answer questions such as:
13
+
14
+ - When does this operation run?
15
+ - Which pulse or acquisition did it produce?
16
+ - Which sequencer received it?
17
+ - Which Q1ASM instructions implement it?
18
+
19
+ Q1Lens can also inspect standalone `.q1asm` files when no schedule project is
20
+ available.
21
+
22
+ Created by [Ik Kyeong Jin](https://github.com/ikjin2).
23
+
24
+ ## Requirements
25
+
26
+ - Python 3.10 or newer
27
+ - VS Code 1.90 or newer
28
+ - A Python environment containing the dependencies used by your schedule
29
+
30
+ Q1Lens imports and runs your schedule code during analysis. Install the Python
31
+ package in the same environment as the schedule project.
32
+
33
+ ## Install
34
+
35
+ ### With uv
36
+
37
+ Add Q1Lens as a development dependency:
38
+
39
+ ```console
40
+ uv add --dev q1lens
41
+ uv run q1lens --help
42
+ ```
43
+
44
+ Install
45
+ [Q1Lens from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=q1lens.q1lens),
46
+ then add this to your VS Code settings:
47
+
48
+ ```json
49
+ {
50
+ "q1lens.pythonPath": "uv",
51
+ "q1lens.pythonArgs": ["run", "python"]
52
+ }
53
+ ```
54
+
55
+ The extension will then run Q1Lens through the current uv project environment.
56
+
57
+ ### With pip
58
+
59
+ Activate the environment used by your schedule project, then install Q1Lens:
60
+
61
+ ```console
62
+ python -m pip install q1lens
63
+ python -m q1lens --help
64
+ ```
65
+
66
+ Install the VS Code extension from the Marketplace. If `python` does not refer
67
+ to the correct environment, set `q1lens.pythonPath` to its interpreter:
68
+
69
+ ```json
70
+ {
71
+ "q1lens.pythonPath": ".venv/bin/python"
72
+ }
73
+ ```
74
+
75
+ On Windows, use `.venv\\Scripts\\python.exe`.
76
+
77
+ ## Quick start
78
+
79
+ Create `qbstimeline.yml` in your schedule project:
80
+
81
+ ```yaml
82
+ schedule:
83
+ file: schedule.py
84
+ entrypoint: build_schedule
85
+ compiler: build_compiler
86
+
87
+ outputs:
88
+ dir: .qbs_timeline
89
+
90
+ low_level:
91
+ q1timeline: true
92
+ ```
93
+
94
+ Expose two functions from `schedule.py`:
95
+
96
+ ```python
97
+ def build_schedule():
98
+ ...
99
+
100
+
101
+ def build_compiler():
102
+ ...
103
+ ```
104
+
105
+ The compiler returned by `build_compiler()` must provide
106
+ `compile(schedule)`. Its result must expose `compiled_instructions` when Q1ASM
107
+ inspection is required.
108
+
109
+ Then:
110
+
111
+ 1. Open the project folder in VS Code.
112
+ 2. Open `qbstimeline.yml`.
113
+ 3. Run **Q1Lens: Analyze and Open** from the Command Palette.
114
+ 4. Select an operation to inspect its pulse and Q1ASM context.
115
+
116
+ Q1Lens writes generated files under `.qbs_timeline/`:
117
+
118
+ ```text
119
+ .qbs_timeline/
120
+ |-- qbs_ir.json
121
+ |-- index.html
122
+ |-- q1asm/
123
+ | `-- <sequencer>.q1asm
124
+ `-- q1timeline.yml
125
+ ```
126
+
127
+ The same flow is available from the command line:
128
+
129
+ ```console
130
+ uv run q1lens analyze --project examples/basic-transmon/qbstimeline.yml --out examples/basic-transmon/.qbs_timeline/qbs_ir.json
131
+
132
+ uv run q1lens render --ir examples/basic-transmon/.qbs_timeline/qbs_ir.json --out examples/basic-transmon/.qbs_timeline/index.html
133
+ ```
134
+
135
+ When using pip, replace `uv run q1lens` with `python -m q1lens`.
136
+
137
+ ## Standalone Q1ASM
138
+
139
+ You can inspect Q1ASM without a schedule project:
140
+
141
+ 1. Open a `.q1asm` file.
142
+ 2. Run **Q1Lens: Open Timeline Preview**.
143
+ 3. Use **Q1Lens: Select Q1ASM Files in Folder...** if only some sibling files
144
+ should be included.
145
+
146
+ If Q1Lens finds a nearby `q1timeline.yml`, it uses that project. Otherwise, it
147
+ creates `.q1timeline/auto-generated.q1timeline.yml` next to the selected file
148
+ and includes the sibling `.q1asm` files in that folder.
149
+
150
+ Try the included example at
151
+ `examples/q1asm-standalone-demo/drive.q1asm`.
152
+
153
+ ## Symbolic values and Q1ASM mapping
154
+
155
+ Use annotations when a scheduler value should retain its human-readable name:
156
+
157
+ ```python
158
+ from q1lens import annotate, sym
159
+
160
+ T_TOTAL = sym.time("T_TOTAL", 40e-9)
161
+ AMP_X = sym.amp("AMP_X", 0.32)
162
+
163
+ sched.add(
164
+ annotate(
165
+ SquarePulse(
166
+ duration=40e-9,
167
+ amp=0.32,
168
+ port="q0:mw",
169
+ clock="q0.01",
170
+ ),
171
+ duration=T_TOTAL,
172
+ amp=AMP_X,
173
+ ),
174
+ label="x180",
175
+ )
176
+ ```
177
+
178
+ Exact schedule-to-Q1ASM line mapping uses compiler-provided
179
+ `qbstimeline_provenance`. When that data is absent, Q1Lens can infer mappings
180
+ for simple, unique `play` and `acquire` instructions. Ambiguous or optimized
181
+ lowerings remain visible without claiming an exact source mapping.
182
+
183
+ Optional native diagrams are disabled by default. Enable them in
184
+ `qbstimeline.yml` when the schedule supports the corresponding plotting
185
+ methods:
186
+
187
+ ```yaml
188
+ artifacts:
189
+ circuit_diagram: true
190
+ analog_pulse_diagram: true
191
+ ```
192
+
193
+ ## Development
194
+
195
+ Python:
196
+
197
+ ```console
198
+ git clone https://github.com/ikjin2/q1lens.git
199
+ cd q1lens
200
+ uv sync --extra dev
201
+ uv run pytest -q
202
+ uv build
203
+ ```
204
+
205
+ VS Code extension:
206
+
207
+ ```console
208
+ cd vscode-extension
209
+ npm ci
210
+ npm test
211
+ npm run test:extension
212
+ npm run package
213
+ ```
214
+
215
+ See [Migrating to Q1Lens](docs/migration-from-qbs-and-q1timeline.md) when
216
+ replacing the older separate QBS Timeline and q1timeline extensions.
217
+
218
+ ## Project status and authorship
219
+
220
+ Q1Lens is an early-stage project. It was conceived and originally developed by
221
+ [Ik Kyeong Jin](https://github.com/ikjin2) as an independent side project while
222
+ employed by [Qblox B.V.](https://qblox.com/).
223
+
224
+ Q1Lens is independently owned and maintained by Ik Kyeong Jin. It is not an
225
+ official Qblox product and is not sponsored, endorsed, or maintained by
226
+ Qblox B.V.
227
+
228
+ OpenAI Codex was used as an AI-assisted development tool for implementation,
229
+ testing, review, and documentation. All technical decisions and released
230
+ changes are reviewed and accepted by the project maintainer.
231
+
232
+ ## License
233
+
234
+ Q1Lens is licensed under the [Apache License 2.0](LICENSE). See
235
+ [NOTICE](NOTICE) for project attribution and history.