qcoder 0.1.0a0__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.
- qcoder-0.1.0a0/LICENSE +201 -0
- qcoder-0.1.0a0/MANIFEST.in +10 -0
- qcoder-0.1.0a0/NOTICE +11 -0
- qcoder-0.1.0a0/PKG-INFO +86 -0
- qcoder-0.1.0a0/README.md +60 -0
- qcoder-0.1.0a0/docs/architecture.md +10 -0
- qcoder-0.1.0a0/pyproject.toml +48 -0
- qcoder-0.1.0a0/setup.cfg +4 -0
- qcoder-0.1.0a0/src/qcoder/__init__.py +3 -0
- qcoder-0.1.0a0/src/qcoder/__main__.py +6 -0
- qcoder-0.1.0a0/src/qcoder/cli.py +116 -0
- qcoder-0.1.0a0/src/qcoder/core/__init__.py +1 -0
- qcoder-0.1.0a0/src/qcoder/core/context.py +16 -0
- qcoder-0.1.0a0/src/qcoder/core/qasm2/__init__.py +1 -0
- qcoder-0.1.0a0/src/qcoder/core/qasm2/adjoint_eligibility.py +128 -0
- qcoder-0.1.0a0/src/qcoder/core/qasm2/mirror_build.py +234 -0
- qcoder-0.1.0a0/src/qcoder/core/run_config.py +84 -0
- qcoder-0.1.0a0/src/qcoder/core/schema.py +26 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/adapters/__init__.py +1 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/adapters/qiskit_intake.py +46 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/extractor.py +43 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/features/compute_v0.py +157 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/features/schema_v0.py +84 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/ir.py +41 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/labeling.py +68 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/parsers/__init__.py +21 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/qasm2_regex_parser.py +184 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/cut_profile.py +106 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/depth.py +47 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/entangling_layers.py +57 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/gate_set_stats.py +82 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/interaction_graph.py +30 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/interaction_graph_metrics.py +113 -0
- qcoder-0.1.0a0/src/qcoder/engines/feature_extraction/reps/spans.py +89 -0
- qcoder-0.1.0a0/src/qcoder/engines/prediction_model/__init__.py +16 -0
- qcoder-0.1.0a0/src/qcoder/engines/prediction_model/artifact.py +85 -0
- qcoder-0.1.0a0/src/qcoder/engines/prediction_model/engine.py +209 -0
- qcoder-0.1.0a0/src/qcoder/engines/prediction_model/models.py +62 -0
- qcoder-0.1.0a0/src/qcoder/engines/prediction_model/policy.py +45 -0
- qcoder-0.1.0a0/src/qcoder/engines/prediction_model/schema_alignment.py +41 -0
- qcoder-0.1.0a0/src/qcoder/engines/quantumness/__init__.py +8 -0
- qcoder-0.1.0a0/src/qcoder/engines/quantumness/scorer.py +254 -0
- qcoder-0.1.0a0/src/qcoder/pipelines/analyze.py +131 -0
- qcoder-0.1.0a0/src/qcoder/pipelines/batch.py +56 -0
- qcoder-0.1.0a0/src/qcoder/tools/analyze.py +88 -0
- qcoder-0.1.0a0/src/qcoder/tools/analyze_shot_scaling.py +239 -0
- qcoder-0.1.0a0/src/qcoder/tools/batch.py +39 -0
- qcoder-0.1.0a0/src/qcoder/tools/generate_corpus.py +491 -0
- qcoder-0.1.0a0/src/qcoder/tools/harness.py +15 -0
- qcoder-0.1.0a0/src/qcoder/tools/inspect_corpus_features.py +273 -0
- qcoder-0.1.0a0/src/qcoder/tools/join_runs_features.py +252 -0
- qcoder-0.1.0a0/src/qcoder/tools/mirror.py +15 -0
- qcoder-0.1.0a0/src/qcoder/tools/predict_baseline.py +347 -0
- qcoder-0.1.0a0/src/qcoder/tools/qr_dll_bootstrap.py +31 -0
- qcoder-0.1.0a0/src/qcoder/tools/runner.py +15 -0
- qcoder-0.1.0a0/src/qcoder/tools/runners/__init__.py +1 -0
- qcoder-0.1.0a0/src/qcoder/tools/runners/quantum_rings/__init__.py +1 -0
- qcoder-0.1.0a0/src/qcoder/tools/runners/quantum_rings/v12/__init__.py +1 -0
- qcoder-0.1.0a0/src/qcoder/tools/runners/quantum_rings/v12/harness.py +1350 -0
- qcoder-0.1.0a0/src/qcoder/tools/runners/quantum_rings/v12/mirror.py +459 -0
- qcoder-0.1.0a0/src/qcoder/tools/runners/quantum_rings/v12/runner.py +549 -0
- qcoder-0.1.0a0/src/qcoder/tools/train_baseline_models.py +619 -0
- qcoder-0.1.0a0/src/qcoder/tools/validate_baseline.py +307 -0
- qcoder-0.1.0a0/src/qcoder.egg-info/PKG-INFO +86 -0
- qcoder-0.1.0a0/src/qcoder.egg-info/SOURCES.txt +96 -0
- qcoder-0.1.0a0/src/qcoder.egg-info/dependency_links.txt +1 -0
- qcoder-0.1.0a0/src/qcoder.egg-info/entry_points.txt +2 -0
- qcoder-0.1.0a0/src/qcoder.egg-info/requires.txt +4 -0
- qcoder-0.1.0a0/src/qcoder.egg-info/top_level.txt +1 -0
- qcoder-0.1.0a0/tests/__init__.py +0 -0
- qcoder-0.1.0a0/tests/test_adjoint_eligibility.py +61 -0
- qcoder-0.1.0a0/tests/test_analyze_pipeline.py +70 -0
- qcoder-0.1.0a0/tests/test_analyze_prediction_integration.py +62 -0
- qcoder-0.1.0a0/tests/test_analyze_shot_scaling.py +103 -0
- qcoder-0.1.0a0/tests/test_batch_pipeline.py +110 -0
- qcoder-0.1.0a0/tests/test_cli_batch_nested_discovery.py +43 -0
- qcoder-0.1.0a0/tests/test_cut_profile.py +43 -0
- qcoder-0.1.0a0/tests/test_entangling_layers.py +83 -0
- qcoder-0.1.0a0/tests/test_gate_set_stats.py +72 -0
- qcoder-0.1.0a0/tests/test_generate_corpus.py +113 -0
- qcoder-0.1.0a0/tests/test_harness_schema_labels.py +293 -0
- qcoder-0.1.0a0/tests/test_inspect_corpus_features.py +118 -0
- qcoder-0.1.0a0/tests/test_interaction_graph_metrics.py +52 -0
- qcoder-0.1.0a0/tests/test_join_runs_features.py +170 -0
- qcoder-0.1.0a0/tests/test_mirror_build.py +138 -0
- qcoder-0.1.0a0/tests/test_parse_qasm2_text.py +92 -0
- qcoder-0.1.0a0/tests/test_predict_baseline.py +400 -0
- qcoder-0.1.0a0/tests/test_prediction_artifact_io.py +55 -0
- qcoder-0.1.0a0/tests/test_prediction_fidelity_curve.py +151 -0
- qcoder-0.1.0a0/tests/test_prediction_policy.py +35 -0
- qcoder-0.1.0a0/tests/test_prediction_schema_alignment.py +40 -0
- qcoder-0.1.0a0/tests/test_qiskit_intake.py +95 -0
- qcoder-0.1.0a0/tests/test_quantumness_scorer.py +137 -0
- qcoder-0.1.0a0/tests/test_schema_stability.py +35 -0
- qcoder-0.1.0a0/tests/test_smoke.py +20 -0
- qcoder-0.1.0a0/tests/test_temporal_spans.py +32 -0
- qcoder-0.1.0a0/tests/test_train_baseline_models.py +158 -0
- qcoder-0.1.0a0/tests/test_validate_baseline.py +241 -0
qcoder-0.1.0a0/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.
|
qcoder-0.1.0a0/NOTICE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
qcoder
|
|
2
|
+
Copyright 2026 Quantum Ready Solutions
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
This distribution may include third-party software; see project
|
|
7
|
+
dependencies and their respective licenses (for example, NumPy).
|
|
8
|
+
|
|
9
|
+
Attribution: developed by Quantum Ready Solutions as pre-alpha
|
|
10
|
+
deterministic circuit analysis tooling. This NOTICE does not grant
|
|
11
|
+
trademark rights.
|
qcoder-0.1.0a0/PKG-INFO
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qcoder
|
|
3
|
+
Version: 0.1.0a0
|
|
4
|
+
Summary: Pre-alpha: deterministic circuit feature extraction and QASM analysis (local circuit intelligence).
|
|
5
|
+
Author-email: Quantum Ready Solutions <support@qcoder.ai>
|
|
6
|
+
Maintainer-email: Quantum Ready Solutions <support@qcoder.ai>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://qcoder.ai
|
|
9
|
+
Project-URL: Documentation, https://qcoder.ai/manual/
|
|
10
|
+
Project-URL: Repository, https://github.com/QuantumReadySolutions/qCoder
|
|
11
|
+
Project-URL: Issues, https://github.com/QuantumReadySolutions/qCoder/issues
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: NOTICE
|
|
22
|
+
Requires-Dist: numpy
|
|
23
|
+
Provides-Extra: qiskit
|
|
24
|
+
Requires-Dist: qiskit>=1.0; extra == "qiskit"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# qCoder
|
|
28
|
+
|
|
29
|
+
**qCoder** is a **pre-alpha**, **local-first** quantum circuit intelligence toolkit focused on **deterministic OpenQASM analysis** and **schema-locked circuit feature extraction**. It ships a small CLI and optional **Qiskit** intake; APIs and flags may change while the project is early.
|
|
30
|
+
|
|
31
|
+
**Company / legal:** Quantum Ready Solutions. **Product documentation:** [qcoder.ai](https://qcoder.ai) (manual at [qcoder.ai/manual/](https://qcoder.ai/manual/)). **Source:** [github.com/QuantumReadySolutions/qCoder](https://github.com/QuantumReadySolutions/qCoder). **Support:** [support@qcoder.ai](mailto:support@qcoder.ai).
|
|
32
|
+
|
|
33
|
+
## Scope and interpretation
|
|
34
|
+
|
|
35
|
+
qCoder produces **structured, deterministic outputs** from circuit sources (primarily OpenQASM) for workflows such as review, regression checks, and batch datasets. It is **not** a hosted service and does not provide accounts, payments, or managed execution. Combine outputs with **your own** validation, simulators, or hardware runs when you need execution evidence.
|
|
36
|
+
|
|
37
|
+
## Package layout (supported public surface)
|
|
38
|
+
|
|
39
|
+
In this **pre-alpha** release, treat the **supported surface** as:
|
|
40
|
+
|
|
41
|
+
- **`qcoder analyze`** — single-circuit extraction (human or `--json`).
|
|
42
|
+
- **`qcoder batch`** — directory batch to JSONL.
|
|
43
|
+
- **`qcoder[qiskit]`** — optional QuantumCircuit intake that feeds the same schema as OpenQASM.
|
|
44
|
+
- **Documented feature schema** — see [qcoder.ai manual — Feature reference](https://qcoder.ai/manual/feature-reference/) (and `engines/feature_extraction/features/schema_v0.py` alongside the extractor).
|
|
45
|
+
|
|
46
|
+
Additional Python modules ship in **`src/qcoder`** for ongoing research or prototyping (for example tooling or engines not surfaced by those commands). Unless called out explicitly in **`README`** or **`docs/`** here or on **qcoder.ai**, they do **not** carry the same compatibility expectations as the CLI and schema above.
|
|
47
|
+
|
|
48
|
+
Public architecture notes live in **`docs/architecture.md`**.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install qcoder
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Pre-release versions may use a pre-release segment (e.g. `0.1.0a0`) on PyPI when published.
|
|
57
|
+
|
|
58
|
+
**Optional Qiskit** adapter (only if you need `QuantumCircuit` intake):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install "qcoder[qiskit]"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Requires **Python 3.11+**. Runtime dependency: **NumPy**.
|
|
65
|
+
|
|
66
|
+
## CLI quickstart
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
qcoder analyze path/to/circuit.qasm
|
|
70
|
+
qcoder analyze path/to/circuit.qasm --json
|
|
71
|
+
qcoder batch path/to/qasm_dir/ --out features.jsonl
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Develop / test (from a clone)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
python -m venv .venv
|
|
78
|
+
source .venv/bin/activate
|
|
79
|
+
pip install -e ".[qiskit]"
|
|
80
|
+
pip install pytest
|
|
81
|
+
pytest -q
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
Licensed under the **Apache License 2.0**. See `LICENSE` and `NOTICE`.
|
qcoder-0.1.0a0/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# qCoder
|
|
2
|
+
|
|
3
|
+
**qCoder** is a **pre-alpha**, **local-first** quantum circuit intelligence toolkit focused on **deterministic OpenQASM analysis** and **schema-locked circuit feature extraction**. It ships a small CLI and optional **Qiskit** intake; APIs and flags may change while the project is early.
|
|
4
|
+
|
|
5
|
+
**Company / legal:** Quantum Ready Solutions. **Product documentation:** [qcoder.ai](https://qcoder.ai) (manual at [qcoder.ai/manual/](https://qcoder.ai/manual/)). **Source:** [github.com/QuantumReadySolutions/qCoder](https://github.com/QuantumReadySolutions/qCoder). **Support:** [support@qcoder.ai](mailto:support@qcoder.ai).
|
|
6
|
+
|
|
7
|
+
## Scope and interpretation
|
|
8
|
+
|
|
9
|
+
qCoder produces **structured, deterministic outputs** from circuit sources (primarily OpenQASM) for workflows such as review, regression checks, and batch datasets. It is **not** a hosted service and does not provide accounts, payments, or managed execution. Combine outputs with **your own** validation, simulators, or hardware runs when you need execution evidence.
|
|
10
|
+
|
|
11
|
+
## Package layout (supported public surface)
|
|
12
|
+
|
|
13
|
+
In this **pre-alpha** release, treat the **supported surface** as:
|
|
14
|
+
|
|
15
|
+
- **`qcoder analyze`** — single-circuit extraction (human or `--json`).
|
|
16
|
+
- **`qcoder batch`** — directory batch to JSONL.
|
|
17
|
+
- **`qcoder[qiskit]`** — optional QuantumCircuit intake that feeds the same schema as OpenQASM.
|
|
18
|
+
- **Documented feature schema** — see [qcoder.ai manual — Feature reference](https://qcoder.ai/manual/feature-reference/) (and `engines/feature_extraction/features/schema_v0.py` alongside the extractor).
|
|
19
|
+
|
|
20
|
+
Additional Python modules ship in **`src/qcoder`** for ongoing research or prototyping (for example tooling or engines not surfaced by those commands). Unless called out explicitly in **`README`** or **`docs/`** here or on **qcoder.ai**, they do **not** carry the same compatibility expectations as the CLI and schema above.
|
|
21
|
+
|
|
22
|
+
Public architecture notes live in **`docs/architecture.md`**.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install qcoder
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Pre-release versions may use a pre-release segment (e.g. `0.1.0a0`) on PyPI when published.
|
|
31
|
+
|
|
32
|
+
**Optional Qiskit** adapter (only if you need `QuantumCircuit` intake):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install "qcoder[qiskit]"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Requires **Python 3.11+**. Runtime dependency: **NumPy**.
|
|
39
|
+
|
|
40
|
+
## CLI quickstart
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
qcoder analyze path/to/circuit.qasm
|
|
44
|
+
qcoder analyze path/to/circuit.qasm --json
|
|
45
|
+
qcoder batch path/to/qasm_dir/ --out features.jsonl
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Develop / test (from a clone)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m venv .venv
|
|
52
|
+
source .venv/bin/activate
|
|
53
|
+
pip install -e ".[qiskit]"
|
|
54
|
+
pip install pytest
|
|
55
|
+
pytest -q
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
Licensed under the **Apache License 2.0**. See `LICENSE` and `NOTICE`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# qCoder architecture notes (public)
|
|
2
|
+
|
|
3
|
+
**qCoder** maps circuit sources onto a single **normalized, schema-versioned feature vector**:
|
|
4
|
+
|
|
5
|
+
- Primary path: **OpenQASM / QASM** text analyzed locally.
|
|
6
|
+
- Optional path: **`qcoder[qiskit]`** can ingest **Qiskit `QuantumCircuit`** objects and bridge into the **same extractor and schema** as the OpenQASM path.
|
|
7
|
+
|
|
8
|
+
The living **field glossary** lives in **`src/qcoder/engines/feature_extraction/features/schema_v0.py`** (`FEATURE_NAMES_V0` and schema version bundled with releases). [**qcoder.ai** manual — Feature reference](https://qcoder.ai/manual/feature-reference/) is the user-facing catalogue.
|
|
9
|
+
|
|
10
|
+
Supported product surface in pre-alpha builds is summarized in **`README.md`** under **Package layout** (CLI `analyze` / `batch`, documented schema / JSON output, optional Qiskit extra). Anything outside that surface should be treated as **research scaffolding** unless explicitly documented elsewhere.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "qcoder"
|
|
7
|
+
version = "0.1.0a0"
|
|
8
|
+
description = "Pre-alpha: deterministic circuit feature extraction and QASM analysis (local circuit intelligence)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Quantum Ready Solutions", email = "support@qcoder.ai" },
|
|
15
|
+
]
|
|
16
|
+
maintainers = [
|
|
17
|
+
{ name = "Quantum Ready Solutions", email = "support@qcoder.ai" },
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Topic :: Scientific/Engineering",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
+
]
|
|
27
|
+
dependencies = ["numpy"]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
qiskit = ["qiskit>=1.0"]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://qcoder.ai"
|
|
34
|
+
Documentation = "https://qcoder.ai/manual/"
|
|
35
|
+
Repository = "https://github.com/QuantumReadySolutions/qCoder"
|
|
36
|
+
Issues = "https://github.com/QuantumReadySolutions/qCoder/issues"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
qcoder = "qcoder.cli:main"
|
|
40
|
+
|
|
41
|
+
[tool.setuptools]
|
|
42
|
+
package-dir = {"" = "src"}
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
line-length = 100
|
qcoder-0.1.0a0/setup.cfg
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
from qcoder.pipelines.analyze import analyze_qasm
|
|
8
|
+
from qcoder.tools.batch import analyze_qasm_dir_to_jsonl
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _cmd_analyze(argv: list[str]) -> int:
|
|
12
|
+
p = argparse.ArgumentParser(prog="qcoder analyze", add_help=True)
|
|
13
|
+
p.add_argument("qasm", help="Path to a .qasm file")
|
|
14
|
+
|
|
15
|
+
# Circuit identity / metadata
|
|
16
|
+
p.add_argument("--id", dest="circuit_id", default=None, help="Optional circuit id")
|
|
17
|
+
p.add_argument("--name", dest="circuit_name", default=None, help="Optional circuit name")
|
|
18
|
+
|
|
19
|
+
# Run config (conditioning vars for predictors; not used by feature extraction)
|
|
20
|
+
p.add_argument(
|
|
21
|
+
"--processor",
|
|
22
|
+
"--backend",
|
|
23
|
+
dest="processor",
|
|
24
|
+
default="CPU",
|
|
25
|
+
help='Processor/backend label (aliases: Scarlet/Amber, CPU/GPU)',
|
|
26
|
+
)
|
|
27
|
+
p.add_argument("--precision", default="single", help="Precision: single|double (aliases: fp32/fp64)")
|
|
28
|
+
p.add_argument("--threshold", type=float, default=None, help="Optional threshold/bond-dim conditioning value")
|
|
29
|
+
p.add_argument("--mirror-artifacts-dir", default=None, metavar="DIR", help="If set, write mirror QASM to DIR and add adjoint_supported/adjoint_reason/mirror_qasm_ref to output")
|
|
30
|
+
|
|
31
|
+
p.add_argument("--json", action="store_true", help="Emit machine-readable JSON")
|
|
32
|
+
args = p.parse_args(argv)
|
|
33
|
+
|
|
34
|
+
report = analyze_qasm(
|
|
35
|
+
args.qasm,
|
|
36
|
+
circuit_id=args.circuit_id,
|
|
37
|
+
circuit_name=args.circuit_name,
|
|
38
|
+
processor=args.processor,
|
|
39
|
+
precision=args.precision,
|
|
40
|
+
threshold=args.threshold,
|
|
41
|
+
mirror_artifacts_dir=args.mirror_artifacts_dir or None,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
if args.json:
|
|
45
|
+
print(json.dumps(report.to_json_dict(), indent=2, sort_keys=True))
|
|
46
|
+
return 0
|
|
47
|
+
|
|
48
|
+
ex = report.example
|
|
49
|
+
rc = report.run_config
|
|
50
|
+
print(f"file: {ex.qasm_path}")
|
|
51
|
+
print(f"format: {ex.ir.source_format}")
|
|
52
|
+
if ex.name:
|
|
53
|
+
print(f"name: {ex.name}")
|
|
54
|
+
print(f"function_hint: {ex.function_hint} ({ex.function_source})")
|
|
55
|
+
print(f"processor: {rc.processor} backend: {rc.backend} precision: {rc.precision} threshold: {rc.threshold}")
|
|
56
|
+
print(f"n_qubits: {ex.ir.n_qubits}")
|
|
57
|
+
print(f"n_ops: {ex.ir.n_ops}")
|
|
58
|
+
fv = ex.global_features
|
|
59
|
+
print(f"schema: {fv.schema_version}")
|
|
60
|
+
print(f"n_features: {len(fv.features)}")
|
|
61
|
+
return 0
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _cmd_batch(argv: list[str]) -> int:
|
|
65
|
+
p = argparse.ArgumentParser(prog="qcoder batch", add_help=True)
|
|
66
|
+
p.add_argument("circuits_dir", help="Directory containing QASM files")
|
|
67
|
+
p.add_argument("--out", required=True, help="Output JSONL path")
|
|
68
|
+
p.set_defaults(recursive=True)
|
|
69
|
+
p.add_argument("--recursive", dest="recursive", action="store_true", help="Discover files recursively (default)")
|
|
70
|
+
p.add_argument("--non-recursive", dest="recursive", action="store_false", help="Only discover top-level files")
|
|
71
|
+
p.add_argument("--pattern", default="*.qasm", help="Glob pattern for files (default: *.qasm)")
|
|
72
|
+
p.add_argument("--skip-errors", action="store_true", help="Continue on error, emit error records (default: fail-fast)")
|
|
73
|
+
p.add_argument("--processor", default=None, help="Processor/backend label for run_config")
|
|
74
|
+
p.add_argument("--backend", default=None, help="Backend label (CPU/GPU, etc.)")
|
|
75
|
+
p.add_argument("--precision", default=None, help="Precision: single|double|fp32|fp64")
|
|
76
|
+
p.add_argument("--threshold", type=float, default=None, help="Optional threshold for run_config")
|
|
77
|
+
p.add_argument("--mirror-artifacts-dir", default=None, metavar="DIR", help="If set, write mirror QASM to DIR and add adjoint_supported/adjoint_reason/mirror_qasm_ref to each record")
|
|
78
|
+
args = p.parse_args(argv)
|
|
79
|
+
|
|
80
|
+
n = analyze_qasm_dir_to_jsonl(
|
|
81
|
+
args.circuits_dir,
|
|
82
|
+
args.out,
|
|
83
|
+
processor=args.processor,
|
|
84
|
+
backend=args.backend,
|
|
85
|
+
precision=args.precision,
|
|
86
|
+
threshold=args.threshold,
|
|
87
|
+
recursive=args.recursive,
|
|
88
|
+
pattern=args.pattern,
|
|
89
|
+
fail_fast=not args.skip_errors,
|
|
90
|
+
mirror_artifacts_dir=args.mirror_artifacts_dir or None,
|
|
91
|
+
)
|
|
92
|
+
print(f"Wrote {n} records to {args.out}", file=sys.stderr)
|
|
93
|
+
return 0
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def main(argv: list[str] | None = None) -> int:
|
|
97
|
+
if argv is None:
|
|
98
|
+
argv = sys.argv[1:]
|
|
99
|
+
|
|
100
|
+
parser = argparse.ArgumentParser(prog="qcoder")
|
|
101
|
+
sub = parser.add_subparsers(dest="cmd", required=True)
|
|
102
|
+
sub.add_parser("analyze", help="Analyze a QASM file (feature extraction + metadata + run config)")
|
|
103
|
+
sub.add_parser("batch", help="Batch extract directory to JSONL")
|
|
104
|
+
ns, rest = parser.parse_known_args(argv)
|
|
105
|
+
|
|
106
|
+
if ns.cmd == "analyze":
|
|
107
|
+
return _cmd_analyze(rest)
|
|
108
|
+
if ns.cmd == "batch":
|
|
109
|
+
return _cmd_batch(rest)
|
|
110
|
+
|
|
111
|
+
parser.error(f"Unknown command: {ns.cmd}")
|
|
112
|
+
return 2
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
if __name__ == "__main__":
|
|
116
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Core shared types and utilities
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
# Backwards-compatible shim.
|
|
4
|
+
# Prefer: from qcoder.core.run_config import RunConfig
|
|
5
|
+
from qcoder.core.run_config import (
|
|
6
|
+
CPU_ALIASES,
|
|
7
|
+
GPU_ALIASES,
|
|
8
|
+
SINGLE_ALIASES,
|
|
9
|
+
DOUBLE_ALIASES,
|
|
10
|
+
RunConfig,
|
|
11
|
+
normalize_backend,
|
|
12
|
+
normalize_precision,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
# Older code referred to Context; keep it as an alias.
|
|
16
|
+
Context = RunConfig
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# QASM2 lightweight utilities (e.g. mirror build)
|