qcoder 0.4.0a2__tar.gz → 0.5.0a1__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.4.0a2 → qcoder-0.5.0a1}/CHANGELOG.md +18 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/MANIFEST.in +6 -2
- qcoder-0.5.0a1/PKG-INFO +88 -0
- qcoder-0.5.0a1/README.md +58 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/pyproject.toml +2 -1
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/__init__.py +1 -1
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/cli.py +112 -15
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/ir.py +8 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/qasm2_regex_parser.py +15 -2
- qcoder-0.5.0a1/src/qcoder.egg-info/PKG-INFO +88 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder.egg-info/SOURCES.txt +1 -31
- qcoder-0.4.0a2/PKG-INFO +0 -188
- qcoder-0.4.0a2/README.md +0 -158
- qcoder-0.4.0a2/docs/architecture.md +0 -32
- qcoder-0.4.0a2/docs/model-cards/resource-guidance-local-v0.md +0 -33
- qcoder-0.4.0a2/src/qcoder.egg-info/PKG-INFO +0 -188
- qcoder-0.4.0a2/tests/__init__.py +0 -0
- qcoder-0.4.0a2/tests/test_adjoint_eligibility.py +0 -61
- qcoder-0.4.0a2/tests/test_analyze_pipeline.py +0 -106
- qcoder-0.4.0a2/tests/test_batch_pipeline.py +0 -127
- qcoder-0.4.0a2/tests/test_cirq_intake.py +0 -97
- qcoder-0.4.0a2/tests/test_cli_batch_nested_discovery.py +0 -43
- qcoder-0.4.0a2/tests/test_cli_context_review.py +0 -191
- qcoder-0.4.0a2/tests/test_cli_help.py +0 -197
- qcoder-0.4.0a2/tests/test_context_bundle.py +0 -260
- qcoder-0.4.0a2/tests/test_cut_profile.py +0 -43
- qcoder-0.4.0a2/tests/test_entangling_layers.py +0 -83
- qcoder-0.4.0a2/tests/test_examples_smoke.py +0 -95
- qcoder-0.4.0a2/tests/test_feature_glossary.py +0 -23
- qcoder-0.4.0a2/tests/test_feature_profiles.py +0 -135
- qcoder-0.4.0a2/tests/test_gate_set_stats.py +0 -72
- qcoder-0.4.0a2/tests/test_guidance_model_pack.py +0 -146
- qcoder-0.4.0a2/tests/test_interaction_graph_metrics.py +0 -52
- qcoder-0.4.0a2/tests/test_mirror_build.py +0 -138
- qcoder-0.4.0a2/tests/test_parse_qasm2_text.py +0 -92
- qcoder-0.4.0a2/tests/test_pennylane_intake.py +0 -105
- qcoder-0.4.0a2/tests/test_qiskit_intake.py +0 -136
- qcoder-0.4.0a2/tests/test_resource_guidance.py +0 -182
- qcoder-0.4.0a2/tests/test_review_bundle.py +0 -220
- qcoder-0.4.0a2/tests/test_review_counts_v0.py +0 -30
- qcoder-0.4.0a2/tests/test_review_qiskit_counts.py +0 -32
- qcoder-0.4.0a2/tests/test_schema_stability.py +0 -35
- qcoder-0.4.0a2/tests/test_smoke.py +0 -23
- qcoder-0.4.0a2/tests/test_temporal_spans.py +0 -32
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/LICENSE +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/NOTICE +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/setup.cfg +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/__main__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/context.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/qasm2/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/qasm2/adjoint_eligibility.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/qasm2/mirror_build.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/run_config.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/core/schema.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/context/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/context/bundle.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/context/markdown.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/adapters/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/adapters/cirq_intake.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/adapters/pennylane_intake.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/adapters/qiskit_intake.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/extractor.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/features/compute_v0.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/features/glossary_v0.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/features/schema_v0.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/labeling.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/parsers/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/cut_profile.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/depth.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/entangling_layers.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/gate_set_stats.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/interaction_graph.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/interaction_graph_metrics.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/reps/spans.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/guidance/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/guidance/model_pack.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/guidance/resource.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/guidance/structural_scores.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/profiles/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/profiles/feature_profiles_v0.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/review/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/review/bundle.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/review/counts_v0.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/review/markdown.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/review/qiskit_counts.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/model_packs/__init__.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/model_packs/resource_guidance_local_v0.json +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/pipelines/analyze.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/pipelines/batch.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/pipelines/context.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/pipelines/review.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/tools/batch.py +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder.egg-info/dependency_links.txt +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder.egg-info/entry_points.txt +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder.egg-info/requires.txt +0 -0
- {qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder.egg-info/top_level.txt +0 -0
|
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on common practice for pre-1.0 semantic versioning: **`MAJOR.MINOR.PATCH`** with **`aN`** for alpha prereleases.
|
|
6
6
|
|
|
7
|
+
## 0.5.0a1 (alpha — public Free + Pro Preview shell)
|
|
8
|
+
|
|
9
|
+
First public package version for the **Option 3 product line**: local/offline Free CLI plus a service-backed Pro Preview shell. Version **`0.5.0a1`** is distinct from the internal frozen local private-alpha RC **`0.4.0a4`** (not shipped here).
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Package version** — public Free + service-backed Pro Preview shell ships as **`0.5.0a1`**.
|
|
14
|
+
- **Public package** — Free local/offline CLI (`analyze`, `batch`, `context`, `review`) with no cards; confidential local Pro implementation is not included.
|
|
15
|
+
- **`qcoder pro` shell** — service-backed Pro Preview stub (`signup`, `status`, `login`, `workflow`); no local cards or Pro analysis in the wheel.
|
|
16
|
+
- **Release-check** — public Free + Pro shell smoke; wheel/sdist scanned for forbidden Pro artifacts.
|
|
17
|
+
|
|
18
|
+
### Scope / boundaries
|
|
19
|
+
|
|
20
|
+
- Free qCoder remains local/offline and useful without Pro.
|
|
21
|
+
- Pro Preview service is not implemented in this repository slice.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
7
25
|
## 0.4.0a2 (alpha)
|
|
8
26
|
|
|
9
27
|
### Added
|
|
@@ -4,8 +4,12 @@ include README.md
|
|
|
4
4
|
include CHANGELOG.md
|
|
5
5
|
include pyproject.toml
|
|
6
6
|
graft src
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
prune src/qcoder/pro_v0
|
|
8
|
+
prune tests
|
|
9
|
+
prune docs
|
|
10
|
+
exclude docs/pro-v0-install.md
|
|
11
|
+
exclude docs/private-alpha-quickstart.md
|
|
12
|
+
exclude docs/private-alpha-release-candidate-validation.md
|
|
9
13
|
global-exclude __pycache__
|
|
10
14
|
global-exclude *.py[cod]
|
|
11
15
|
global-exclude .DS_Store
|
qcoder-0.5.0a1/PKG-INFO
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qcoder
|
|
3
|
+
Version: 0.5.0a1
|
|
4
|
+
Summary: Quantum circuit analysis and structured feature extraction tools.
|
|
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 :: 3 - 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
|
+
Provides-Extra: cirq
|
|
26
|
+
Requires-Dist: cirq-core>=1.4; extra == "cirq"
|
|
27
|
+
Provides-Extra: pennylane
|
|
28
|
+
Requires-Dist: pennylane>=0.44; extra == "pennylane"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# qCoder
|
|
32
|
+
|
|
33
|
+
`qcoder` is a local, deterministic quantum circuit evidence CLI.
|
|
34
|
+
|
|
35
|
+
Free `qcoder` commands run offline and do not call hosted services, upload telemetry, or run QPU/simulator jobs.
|
|
36
|
+
|
|
37
|
+
## Public CLI surface
|
|
38
|
+
|
|
39
|
+
- `qcoder analyze`
|
|
40
|
+
- `qcoder batch`
|
|
41
|
+
- `qcoder context`
|
|
42
|
+
- `qcoder review`
|
|
43
|
+
- `qcoder pro` (service-backed Preview shell/stub)
|
|
44
|
+
|
|
45
|
+
## Quick start
|
|
46
|
+
|
|
47
|
+
Install:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install qcoder
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Analyze a circuit:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
qcoder analyze path/to/circuit.qasm --json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Create local context and review artifacts:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
qcoder context path/to/circuit.qasm --out-json preflight.context.json --out-md preflight.context.md
|
|
63
|
+
qcoder review --counts-json counts.json --format qiskit_counts --preflight-json preflight.context.json --out-json execution.review.json --out-md execution.review.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Pro Preview shell:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
qcoder pro --help
|
|
70
|
+
qcoder pro signup
|
|
71
|
+
qcoder pro status
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`qcoder pro workflow` is a service-backed stub in this slice; confidential Pro analysis is not bundled in this package.
|
|
75
|
+
|
|
76
|
+
Architecture notes: [`docs/architecture.md`](docs/architecture.md).
|
|
77
|
+
|
|
78
|
+
## Optional extras
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install "qcoder[qiskit]"
|
|
82
|
+
pip install "qcoder[cirq]"
|
|
83
|
+
pip install "qcoder[pennylane]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
Apache-2.0 (see `LICENSE` and `NOTICE`).
|
qcoder-0.5.0a1/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# qCoder
|
|
2
|
+
|
|
3
|
+
`qcoder` is a local, deterministic quantum circuit evidence CLI.
|
|
4
|
+
|
|
5
|
+
Free `qcoder` commands run offline and do not call hosted services, upload telemetry, or run QPU/simulator jobs.
|
|
6
|
+
|
|
7
|
+
## Public CLI surface
|
|
8
|
+
|
|
9
|
+
- `qcoder analyze`
|
|
10
|
+
- `qcoder batch`
|
|
11
|
+
- `qcoder context`
|
|
12
|
+
- `qcoder review`
|
|
13
|
+
- `qcoder pro` (service-backed Preview shell/stub)
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Install:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install qcoder
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Analyze a circuit:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
qcoder analyze path/to/circuit.qasm --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Create local context and review artifacts:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
qcoder context path/to/circuit.qasm --out-json preflight.context.json --out-md preflight.context.md
|
|
33
|
+
qcoder review --counts-json counts.json --format qiskit_counts --preflight-json preflight.context.json --out-json execution.review.json --out-md execution.review.md
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Pro Preview shell:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
qcoder pro --help
|
|
40
|
+
qcoder pro signup
|
|
41
|
+
qcoder pro status
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`qcoder pro workflow` is a service-backed stub in this slice; confidential Pro analysis is not bundled in this package.
|
|
45
|
+
|
|
46
|
+
Architecture notes: [`docs/architecture.md`](docs/architecture.md).
|
|
47
|
+
|
|
48
|
+
## Optional extras
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install "qcoder[qiskit]"
|
|
52
|
+
pip install "qcoder[cirq]"
|
|
53
|
+
pip install "qcoder[pennylane]"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
Apache-2.0 (see `LICENSE` and `NOTICE`).
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qcoder"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.5.0a1"
|
|
8
8
|
description = "Quantum circuit analysis and structured feature extraction tools."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -45,6 +45,7 @@ package-dir = {"" = "src"}
|
|
|
45
45
|
|
|
46
46
|
[tool.setuptools.packages.find]
|
|
47
47
|
where = ["src"]
|
|
48
|
+
exclude = ["qcoder.pro_v0", "qcoder.pro_v0.*"]
|
|
48
49
|
|
|
49
50
|
[tool.setuptools.package-data]
|
|
50
51
|
qcoder = ["model_packs/*.json"]
|
|
@@ -5,20 +5,18 @@ import json
|
|
|
5
5
|
import sys
|
|
6
6
|
|
|
7
7
|
from qcoder.pipelines.analyze import analyze_qasm
|
|
8
|
-
from qcoder.tools.batch import analyze_qasm_dir_to_jsonl
|
|
9
8
|
from qcoder.pipelines.context import write_preflight_context
|
|
10
9
|
from qcoder.pipelines.review import write_execution_review
|
|
10
|
+
from qcoder.tools.batch import analyze_qasm_dir_to_jsonl
|
|
11
|
+
|
|
12
|
+
PREVIEW_SIGNUP_URL = "https://qcoder.ai/preview"
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
def _cmd_analyze(argv: list[str]) -> int:
|
|
14
16
|
p = argparse.ArgumentParser(prog="qcoder analyze", add_help=True)
|
|
15
17
|
p.add_argument("qasm", help="Path to a .qasm file")
|
|
16
|
-
|
|
17
|
-
# Circuit identity / metadata
|
|
18
18
|
p.add_argument("--id", dest="circuit_id", default=None, help="Optional circuit id")
|
|
19
19
|
p.add_argument("--name", dest="circuit_name", default=None, help="Optional circuit name")
|
|
20
|
-
|
|
21
|
-
# Run config (conditioning vars for predictors; not used by feature extraction)
|
|
22
20
|
p.add_argument(
|
|
23
21
|
"--processor",
|
|
24
22
|
"--backend",
|
|
@@ -28,14 +26,22 @@ def _cmd_analyze(argv: list[str]) -> int:
|
|
|
28
26
|
)
|
|
29
27
|
p.add_argument("--precision", default="single", help="Precision: single|double (aliases: fp32/fp64)")
|
|
30
28
|
p.add_argument("--threshold", type=float, default=None, help="Optional threshold/bond-dim conditioning value")
|
|
31
|
-
p.add_argument(
|
|
32
|
-
|
|
29
|
+
p.add_argument(
|
|
30
|
+
"--mirror-artifacts-dir",
|
|
31
|
+
default=None,
|
|
32
|
+
metavar="DIR",
|
|
33
|
+
help="If set, write mirror QASM to DIR and add adjoint_supported/adjoint_reason/mirror_qasm_ref to output",
|
|
34
|
+
)
|
|
35
|
+
p.add_argument(
|
|
36
|
+
"--guidance",
|
|
37
|
+
action="store_true",
|
|
38
|
+
help="Include heuristic resource guidance (shots and simulator/MPS starting points)",
|
|
39
|
+
)
|
|
33
40
|
p.add_argument(
|
|
34
41
|
"--profiles",
|
|
35
42
|
action="store_true",
|
|
36
43
|
help="Include derived feature_profiles in JSON output (requires --json for analyze)",
|
|
37
44
|
)
|
|
38
|
-
|
|
39
45
|
p.add_argument("--json", action="store_true", help="Emit machine-readable JSON")
|
|
40
46
|
args = p.parse_args(argv)
|
|
41
47
|
|
|
@@ -111,7 +117,12 @@ def _cmd_batch(argv: list[str]) -> int:
|
|
|
111
117
|
p.add_argument("--backend", default=None, help="Backend label (CPU/GPU, etc.)")
|
|
112
118
|
p.add_argument("--precision", default=None, help="Precision: single|double|fp32|fp64")
|
|
113
119
|
p.add_argument("--threshold", type=float, default=None, help="Optional threshold for run_config")
|
|
114
|
-
p.add_argument(
|
|
120
|
+
p.add_argument(
|
|
121
|
+
"--mirror-artifacts-dir",
|
|
122
|
+
default=None,
|
|
123
|
+
metavar="DIR",
|
|
124
|
+
help="If set, write mirror QASM to DIR and add adjoint_supported/adjoint_reason/mirror_qasm_ref to each record",
|
|
125
|
+
)
|
|
115
126
|
p.add_argument("--guidance", action="store_true", help="Include heuristic resource guidance block in each successful JSONL record")
|
|
116
127
|
args = p.parse_args(argv)
|
|
117
128
|
|
|
@@ -194,17 +205,101 @@ def _cmd_review(argv: list[str]) -> int:
|
|
|
194
205
|
return 0
|
|
195
206
|
|
|
196
207
|
|
|
208
|
+
def _cmd_pro(argv: list[str]) -> int:
|
|
209
|
+
p = argparse.ArgumentParser(
|
|
210
|
+
prog="qcoder pro",
|
|
211
|
+
add_help=True,
|
|
212
|
+
description=(
|
|
213
|
+
"qCoder Pro Preview shell (service-backed).\n"
|
|
214
|
+
"Confidential Pro analysis is not shipped in this package."
|
|
215
|
+
),
|
|
216
|
+
)
|
|
217
|
+
p.add_argument(
|
|
218
|
+
"--json",
|
|
219
|
+
action="store_true",
|
|
220
|
+
help="Emit JSON where available.",
|
|
221
|
+
)
|
|
222
|
+
sub = p.add_subparsers(dest="pro_command")
|
|
223
|
+
|
|
224
|
+
p_signup = sub.add_parser("signup", help="Show Pro Preview signup URL.")
|
|
225
|
+
p_signup.set_defaults(pro_command="signup")
|
|
226
|
+
|
|
227
|
+
p_status = sub.add_parser("status", help="Show local Pro Preview client status.")
|
|
228
|
+
p_status.set_defaults(pro_command="status")
|
|
229
|
+
|
|
230
|
+
p_login = sub.add_parser("login", help="Store Preview token (service validation not available in this slice).")
|
|
231
|
+
p_login.add_argument("--token", required=False, help="Preview token (optional in this stub).")
|
|
232
|
+
p_login.set_defaults(pro_command="login")
|
|
233
|
+
|
|
234
|
+
p_workflow = sub.add_parser("workflow", help="Submit a Pro workflow to the hosted service (not yet available).")
|
|
235
|
+
p_workflow.add_argument("--qasm", default=None, help="Path to a single QASM file.")
|
|
236
|
+
p_workflow.add_argument("--before-qasm", default=None, help="Path to before QASM file.")
|
|
237
|
+
p_workflow.add_argument("--after-qasm", default=None, help="Path to after QASM file.")
|
|
238
|
+
p_workflow.add_argument("--project-dir", default=None, help="Local project directory.")
|
|
239
|
+
p_workflow.set_defaults(pro_command="workflow")
|
|
240
|
+
|
|
241
|
+
args, _unknown = p.parse_known_args(argv)
|
|
242
|
+
cmd = args.pro_command
|
|
243
|
+
|
|
244
|
+
if cmd is None:
|
|
245
|
+
p.print_help()
|
|
246
|
+
return 0
|
|
247
|
+
|
|
248
|
+
if cmd == "signup":
|
|
249
|
+
payload = {
|
|
250
|
+
"schema_id": "qcoder.pro_preview_shell.v0",
|
|
251
|
+
"signup_url": PREVIEW_SIGNUP_URL,
|
|
252
|
+
"service_backed": True,
|
|
253
|
+
"local_only": False,
|
|
254
|
+
"cards_local": False,
|
|
255
|
+
"status": "signup_required",
|
|
256
|
+
}
|
|
257
|
+
if args.json:
|
|
258
|
+
print(json.dumps(payload, indent=2, sort_keys=True))
|
|
259
|
+
else:
|
|
260
|
+
print("qCoder Pro Preview signup")
|
|
261
|
+
print(f" url: {PREVIEW_SIGNUP_URL}")
|
|
262
|
+
print(" mode: service-backed")
|
|
263
|
+
print(" note: no confidential Pro analysis is bundled locally")
|
|
264
|
+
return 0
|
|
265
|
+
|
|
266
|
+
if cmd == "status":
|
|
267
|
+
payload = {
|
|
268
|
+
"schema_id": "qcoder.pro_preview_shell.v0",
|
|
269
|
+
"service_backed": True,
|
|
270
|
+
"configured": False,
|
|
271
|
+
"status": "not_configured",
|
|
272
|
+
"cards_local": False,
|
|
273
|
+
"upload_on_explicit_pro_command_only": True,
|
|
274
|
+
}
|
|
275
|
+
if args.json:
|
|
276
|
+
print(json.dumps(payload, indent=2, sort_keys=True))
|
|
277
|
+
else:
|
|
278
|
+
print("qCoder Pro status: not configured.")
|
|
279
|
+
print(" mode: service-backed preview shell")
|
|
280
|
+
print(" local cards/analysis: disabled in public package")
|
|
281
|
+
print(f" signup: {PREVIEW_SIGNUP_URL}")
|
|
282
|
+
return 0
|
|
283
|
+
|
|
284
|
+
print(
|
|
285
|
+
"qcoder pro: hosted Pro Preview service is not configured in this build.\n"
|
|
286
|
+
f"Run `qcoder pro signup` for access details: {PREVIEW_SIGNUP_URL}",
|
|
287
|
+
file=sys.stderr,
|
|
288
|
+
)
|
|
289
|
+
return 2
|
|
290
|
+
|
|
291
|
+
|
|
197
292
|
def _print_root_help() -> None:
|
|
198
|
-
"""Top-level help (subcommand parsers own analyze/batch --help)."""
|
|
199
293
|
print(
|
|
200
|
-
"usage: qcoder [--version | -V] [-h] {analyze,batch,context,review} ...\n\n"
|
|
294
|
+
"usage: qcoder [--version | -V] [-h] {analyze,batch,context,review,pro} ...\n\n"
|
|
201
295
|
"Quantum circuit analysis CLI.\n\n"
|
|
202
296
|
"positional arguments:\n"
|
|
203
|
-
" {analyze,batch,context,review} subcommand\n\n"
|
|
297
|
+
" {analyze,batch,context,review,pro} subcommand\n\n"
|
|
204
298
|
" analyze Analyze a QASM file (feature extraction + metadata + run config).\n"
|
|
205
|
-
" batch Batch extract a directory to JSONL (requires --out).\n
|
|
299
|
+
" batch Batch extract a directory to JSONL (requires --out).\n"
|
|
206
300
|
" context Build deterministic preflight context artifacts.\n"
|
|
207
|
-
" review Build deterministic execution review artifacts from counts.\n
|
|
301
|
+
" review Build deterministic execution review artifacts from counts.\n"
|
|
302
|
+
" pro Service-backed Pro Preview shell (signup/status/workflow stub).\n\n"
|
|
208
303
|
"Run `qcoder <subcommand> --help` for subcommand options.",
|
|
209
304
|
end="",
|
|
210
305
|
)
|
|
@@ -233,9 +328,11 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
233
328
|
return _cmd_context(rest)
|
|
234
329
|
if cmd == "review":
|
|
235
330
|
return _cmd_review(rest)
|
|
331
|
+
if cmd == "pro":
|
|
332
|
+
return _cmd_pro(rest)
|
|
236
333
|
|
|
237
334
|
print(
|
|
238
|
-
f"qcoder: unknown subcommand {cmd!r} (expected analyze, batch, context, or
|
|
335
|
+
f"qcoder: unknown subcommand {cmd!r} (expected analyze, batch, context, review, or pro)",
|
|
239
336
|
file=sys.stderr,
|
|
240
337
|
)
|
|
241
338
|
print("Run `qcoder --help` for usage.", file=sys.stderr)
|
|
@@ -21,12 +21,20 @@ class Operation:
|
|
|
21
21
|
return len(self.qubits)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
@dataclass(frozen=True)
|
|
25
|
+
class QRegDecl:
|
|
26
|
+
name: str
|
|
27
|
+
size: int
|
|
28
|
+
base: int
|
|
29
|
+
|
|
30
|
+
|
|
24
31
|
@dataclass(frozen=True)
|
|
25
32
|
class CircuitIR:
|
|
26
33
|
n_qubits: int
|
|
27
34
|
n_cbits: int
|
|
28
35
|
operations: tuple[Operation, ...]
|
|
29
36
|
qasm_format: str # "qasm2" | "qasm3" | "unknown"
|
|
37
|
+
qregs: tuple[QRegDecl, ...] = ()
|
|
30
38
|
|
|
31
39
|
@property
|
|
32
40
|
def source_format(self) -> str:
|
{qcoder-0.4.0a2 → qcoder-0.5.0a1}/src/qcoder/engines/feature_extraction/qasm2_regex_parser.py
RENAMED
|
@@ -4,7 +4,7 @@ import re
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
|
-
from .ir import CircuitIR, Operation
|
|
7
|
+
from .ir import CircuitIR, Operation, QRegDecl
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
_RE_QREG = re.compile(r"^\s*qreg\s+([A-Za-z_]\w*)\s*\[\s*(\d+)\s*\]\s*;\s*$")
|
|
@@ -26,6 +26,7 @@ _RE_QREF = re.compile(r"([A-Za-z_]\w*)\s*\[\s*(\d+)\s*\]")
|
|
|
26
26
|
class _Regs:
|
|
27
27
|
qreg_base: dict[str, int]
|
|
28
28
|
qreg_size: dict[str, int]
|
|
29
|
+
qreg_order: tuple[str, ...]
|
|
29
30
|
n_qubits: int
|
|
30
31
|
n_cbits: int
|
|
31
32
|
|
|
@@ -52,6 +53,7 @@ def _detect_format(lines: list[str]) -> str:
|
|
|
52
53
|
def _build_regs(lines: list[str]) -> _Regs:
|
|
53
54
|
qreg_base: dict[str, int] = {}
|
|
54
55
|
qreg_size: dict[str, int] = {}
|
|
56
|
+
qreg_order: list[str] = []
|
|
55
57
|
n_qubits = 0
|
|
56
58
|
n_cbits = 0
|
|
57
59
|
|
|
@@ -67,6 +69,7 @@ def _build_regs(lines: list[str]) -> _Regs:
|
|
|
67
69
|
if name not in qreg_base:
|
|
68
70
|
qreg_base[name] = n_qubits
|
|
69
71
|
qreg_size[name] = size
|
|
72
|
+
qreg_order.append(name)
|
|
70
73
|
n_qubits += size
|
|
71
74
|
continue
|
|
72
75
|
|
|
@@ -76,7 +79,13 @@ def _build_regs(lines: list[str]) -> _Regs:
|
|
|
76
79
|
n_cbits += size
|
|
77
80
|
continue
|
|
78
81
|
|
|
79
|
-
return _Regs(
|
|
82
|
+
return _Regs(
|
|
83
|
+
qreg_base=qreg_base,
|
|
84
|
+
qreg_size=qreg_size,
|
|
85
|
+
qreg_order=tuple(qreg_order),
|
|
86
|
+
n_qubits=n_qubits,
|
|
87
|
+
n_cbits=n_cbits,
|
|
88
|
+
)
|
|
80
89
|
|
|
81
90
|
|
|
82
91
|
def _flatten_qubits(arg_str: str, regs: _Regs) -> tuple[int, ...]:
|
|
@@ -152,11 +161,15 @@ def _parse_qasm2_lines(lines: list[str]) -> CircuitIR:
|
|
|
152
161
|
ops.append(Operation(name=name.lower(), qubits=qubits, params=params, line_index=line_index, op_index=op_index, is_custom=is_custom))
|
|
153
162
|
op_index += 1
|
|
154
163
|
|
|
164
|
+
qregs = tuple(
|
|
165
|
+
QRegDecl(name=name, size=regs.qreg_size[name], base=regs.qreg_base[name]) for name in regs.qreg_order
|
|
166
|
+
)
|
|
155
167
|
return CircuitIR(
|
|
156
168
|
n_qubits=regs.n_qubits,
|
|
157
169
|
n_cbits=regs.n_cbits,
|
|
158
170
|
operations=tuple(ops),
|
|
159
171
|
qasm_format=fmt,
|
|
172
|
+
qregs=qregs,
|
|
160
173
|
)
|
|
161
174
|
|
|
162
175
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qcoder
|
|
3
|
+
Version: 0.5.0a1
|
|
4
|
+
Summary: Quantum circuit analysis and structured feature extraction tools.
|
|
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 :: 3 - 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
|
+
Provides-Extra: cirq
|
|
26
|
+
Requires-Dist: cirq-core>=1.4; extra == "cirq"
|
|
27
|
+
Provides-Extra: pennylane
|
|
28
|
+
Requires-Dist: pennylane>=0.44; extra == "pennylane"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# qCoder
|
|
32
|
+
|
|
33
|
+
`qcoder` is a local, deterministic quantum circuit evidence CLI.
|
|
34
|
+
|
|
35
|
+
Free `qcoder` commands run offline and do not call hosted services, upload telemetry, or run QPU/simulator jobs.
|
|
36
|
+
|
|
37
|
+
## Public CLI surface
|
|
38
|
+
|
|
39
|
+
- `qcoder analyze`
|
|
40
|
+
- `qcoder batch`
|
|
41
|
+
- `qcoder context`
|
|
42
|
+
- `qcoder review`
|
|
43
|
+
- `qcoder pro` (service-backed Preview shell/stub)
|
|
44
|
+
|
|
45
|
+
## Quick start
|
|
46
|
+
|
|
47
|
+
Install:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install qcoder
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Analyze a circuit:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
qcoder analyze path/to/circuit.qasm --json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Create local context and review artifacts:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
qcoder context path/to/circuit.qasm --out-json preflight.context.json --out-md preflight.context.md
|
|
63
|
+
qcoder review --counts-json counts.json --format qiskit_counts --preflight-json preflight.context.json --out-json execution.review.json --out-md execution.review.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Pro Preview shell:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
qcoder pro --help
|
|
70
|
+
qcoder pro signup
|
|
71
|
+
qcoder pro status
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`qcoder pro workflow` is a service-backed stub in this slice; confidential Pro analysis is not bundled in this package.
|
|
75
|
+
|
|
76
|
+
Architecture notes: [`docs/architecture.md`](docs/architecture.md).
|
|
77
|
+
|
|
78
|
+
## Optional extras
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install "qcoder[qiskit]"
|
|
82
|
+
pip install "qcoder[cirq]"
|
|
83
|
+
pip install "qcoder[pennylane]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
Apache-2.0 (see `LICENSE` and `NOTICE`).
|
|
@@ -4,8 +4,6 @@ MANIFEST.in
|
|
|
4
4
|
NOTICE
|
|
5
5
|
README.md
|
|
6
6
|
pyproject.toml
|
|
7
|
-
docs/architecture.md
|
|
8
|
-
docs/model-cards/resource-guidance-local-v0.md
|
|
9
7
|
src/qcoder/__init__.py
|
|
10
8
|
src/qcoder/__main__.py
|
|
11
9
|
src/qcoder/cli.py
|
|
@@ -61,32 +59,4 @@ src/qcoder/pipelines/analyze.py
|
|
|
61
59
|
src/qcoder/pipelines/batch.py
|
|
62
60
|
src/qcoder/pipelines/context.py
|
|
63
61
|
src/qcoder/pipelines/review.py
|
|
64
|
-
src/qcoder/tools/batch.py
|
|
65
|
-
tests/__init__.py
|
|
66
|
-
tests/test_adjoint_eligibility.py
|
|
67
|
-
tests/test_analyze_pipeline.py
|
|
68
|
-
tests/test_batch_pipeline.py
|
|
69
|
-
tests/test_cirq_intake.py
|
|
70
|
-
tests/test_cli_batch_nested_discovery.py
|
|
71
|
-
tests/test_cli_context_review.py
|
|
72
|
-
tests/test_cli_help.py
|
|
73
|
-
tests/test_context_bundle.py
|
|
74
|
-
tests/test_cut_profile.py
|
|
75
|
-
tests/test_entangling_layers.py
|
|
76
|
-
tests/test_examples_smoke.py
|
|
77
|
-
tests/test_feature_glossary.py
|
|
78
|
-
tests/test_feature_profiles.py
|
|
79
|
-
tests/test_gate_set_stats.py
|
|
80
|
-
tests/test_guidance_model_pack.py
|
|
81
|
-
tests/test_interaction_graph_metrics.py
|
|
82
|
-
tests/test_mirror_build.py
|
|
83
|
-
tests/test_parse_qasm2_text.py
|
|
84
|
-
tests/test_pennylane_intake.py
|
|
85
|
-
tests/test_qiskit_intake.py
|
|
86
|
-
tests/test_resource_guidance.py
|
|
87
|
-
tests/test_review_bundle.py
|
|
88
|
-
tests/test_review_counts_v0.py
|
|
89
|
-
tests/test_review_qiskit_counts.py
|
|
90
|
-
tests/test_schema_stability.py
|
|
91
|
-
tests/test_smoke.py
|
|
92
|
-
tests/test_temporal_spans.py
|
|
62
|
+
src/qcoder/tools/batch.py
|