hamiltonian-vqe-kit 0.1.0__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.
@@ -0,0 +1,190 @@
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 exemplary 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
+ Copyright 2026 Ashraf Khan
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: hamiltonian-vqe-kit
3
+ Version: 0.1.0
4
+ Summary: Validated, honest VQE and ADAPT-VQE toolkit for chemical accuracy and honest cost accounting
5
+ Author-email: Ashraf Khan <research@appliedquantum.ai>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/aashiq-parinda/hamiltonian-vqe-kit
8
+ Project-URL: Repository, https://github.com/aashiq-parinda/hamiltonian-vqe-kit
9
+ Project-URL: Issues, https://github.com/aashiq-parinda/hamiltonian-vqe-kit/issues
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Scientific/Engineering :: Physics
17
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: numpy>=1.24.0
23
+ Requires-Dist: scipy>=1.10.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
26
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
27
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
28
+ Requires-Dist: mypy>=1.6.0; extra == "dev"
29
+ Requires-Dist: pre-commit>=3.5.0; extra == "dev"
30
+ Provides-Extra: chemistry
31
+ Requires-Dist: pyscf>=2.4.0; platform_system != "Windows" and extra == "chemistry"
32
+ Requires-Dist: openfermion>=1.6.0; extra == "chemistry"
33
+ Provides-Extra: ml
34
+ Requires-Dist: torch>=2.0.0; extra == "ml"
35
+ Provides-Extra: exporters
36
+ Requires-Dist: qiskit>=1.0.0; extra == "exporters"
37
+ Requires-Dist: pennylane>=0.35.0; extra == "exporters"
38
+ Requires-Dist: cirq-core>=1.3.0; extra == "exporters"
39
+ Provides-Extra: all
40
+ Requires-Dist: hamiltonian-vqe-kit[chemistry,dev,exporters,ml]; extra == "all"
41
+ Dynamic: license-file
42
+
43
+ # Hamiltonian VQE Kit (`hvk`)
44
+
45
+ [![CI](https://github.com/aashiq-parinda/hamiltonian-vqe-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/aashiq-parinda/hamiltonian-vqe-kit/actions)
46
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
47
+ [![Python: 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
48
+ [![Prior Work DOI](https://img.shields.io/badge/Prior%20Work-10.5281%2Fzenodo.22013110-blue.svg)](https://doi.org/10.5281/zenodo.22013110)
49
+ [![Code Style: Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
50
+ [![Type Checked: Mypy](https://img.shields.io/badge/type%20checked-mypy-blue.svg)](https://mypy-lang.org/)
51
+
52
+ **Hamiltonian VQE Kit (`hvk`)** is an open-source, scientifically validated toolkit designed to take any molecular or qubit Hamiltonian and synthesize a diagnosed VQE / ADAPT-VQE workflow capable of achieving **chemical accuracy ($\le 1.6\,\text{mHa}$ vs. Full Configuration Interaction / FCI)** with strict, verifiable accounting of quantum simulation cost.
53
+
54
+ ---
55
+
56
+ ## 📌 Core Modules
57
+
58
+ | Module | Purpose |
59
+ | :--- | :--- |
60
+ | **`hvk.chemistry`** | PySCF & OpenFermion Hamiltonian loaders, Jordan-Wigner transformation, Pauli parsing, FCI & HF reference solutions |
61
+ | **`hvk.audit`** | Hamiltonian 2-body interaction graph analysis and wasted CNOT audit vs. rigid hardware-efficient ansätze (HEA) |
62
+ | **`hvk.adapt`** | Exact ADAPT-VQE engine with fermionic/qubit operator pools, commutator gradients, and strict measurement tracking |
63
+ | **`hvk.ansatz`** | Deterministic, connected sparse ansatz generator derived directly from Hamiltonian interaction topology |
64
+ | **`hvk.init`** | Principled statevector initializers (Random, Hartree-Fock, Perturbation-Adjusted HF, Guarded Residual ML) |
65
+ | **`hvk.diagnostics`** | Barren plateau gradient variance analyzers and realistic NISQ energy-error-under-noise benchmarks |
66
+ | **`hvk.exporters`** | Zero-overhead circuit and operator export to Qiskit, PennyLane, and Cirq |
67
+ | **`hvk.cli`** | Unified command-line interface (`hvk audit | adapt | build | init | diagnose | benchmark`) |
68
+
69
+ ---
70
+
71
+ ## ⚖️ Non-Negotiable Honesty Rules
72
+
73
+ This repository operates under strict scientific reproducibility constraints:
74
+
75
+ 1. **Zero Hardcoded Numbers**: Every metric, iteration count, and energy reported in documentation or tables must be generated by verifiable scripts in `benchmarks/results/` recording random seed, commit hash, and dependency versions.
76
+ 2. **FCI/PySCF Parity**: All molecular test systems ($H_2$, $\text{LiH}$, $\text{BeH}_2$, $H_4$ chain) must be validated directly against PySCF Hartree-Fock and FCI exact ground states. Tests fail if reference energies diverge.
77
+ 3. **Core is 100% Non-ML**: The core toolkit operates with standard numerical computing dependencies (`numpy`, `scipy`). Machine learning models are strictly optional extras (`pip install hvk[ml]`).
78
+ 4. **Honest Baseline Comparisons**: ML components must be compared head-to-head against exact non-ML and simple heuristic methods. If ML does not win, the null or negative result will be reported plainly.
79
+ 5. **Guarded Residual Initializer**: The residual-ML initializer is explicitly *guarded*, not guaranteed: it evaluates energy at $\boldsymbol{\theta}_{\text{HF}}$ and $\boldsymbol{\theta}_{\text{HF}} + \Delta\boldsymbol{\theta}$, returns the lower energy, and falls back to PA-HF when an explicit out-of-distribution (OOD) criterion is triggered.
80
+ 6. **Physical Noise Metric**: Noise benchmarks measure **ENERGY ERROR under noise vs. the exact ground state** with confidence intervals. State fidelity vs. ideal state is only reported if explicitly labeled as such.
81
+ 7. **Strict Measurement Accounting**: ADAPT execution tracks every energy evaluation, commutator measurement, and appended operator using documented, deterministic counting conventions.
82
+ 8. **Code Quality Standards**: 100% type annotations, comprehensive docstrings, clean `ruff` and `mypy` audits, unit tests for every public function, and test coverage $> 85\%$.
83
+
84
+ ---
85
+
86
+ ## ⚡ Quickstart
87
+
88
+ ### Installation
89
+
90
+ ```bash
91
+ # Core package (zero ML overhead)
92
+ pip install hamiltonian-vqe-kit
93
+
94
+ # With optional chemistry and dev dependencies
95
+ pip install "hamiltonian-vqe-kit[chemistry,dev]"
96
+
97
+ # With optional machine learning extensions
98
+ pip install "hamiltonian-vqe-kit[ml]"
99
+ ```
100
+
101
+ ### Command-Line Interface (CLI)
102
+
103
+ ```bash
104
+ # 1. Audit Hamiltonian locality and interaction graph
105
+ hvk audit H2
106
+
107
+ # 2. Run exact ADAPT-VQE toward chemical accuracy (<= 1.6 mHa)
108
+ hvk adapt LiH --accuracy 0.0016
109
+
110
+ # 3. Build a sparse ansatz from the interaction graph
111
+ hvk build BeH2
112
+
113
+ # 4. Run barren plateau diagnostic
114
+ hvk diagnose H4
115
+
116
+ # 5. Execute full reproducible multi-molecule benchmark suite
117
+ hvk benchmark --output-dir benchmarks/results
118
+ ```
119
+
120
+ ---
121
+
122
+ ## ⚠️ Limitations and Known Failures
123
+
124
+ *This section is continuously updated as empirical benchmarks are evaluated.*
125
+
126
+ - **Phase 0 Status**: Initial repository scaffolding and packaging phase. Core chemistry validation (Phase 1) is currently queued.
127
+ - **Qubit Active Space Boundaries**: Phase 1 through Phase 4 focus on small-molecule STO-3G active spaces ($N \le 8$ qubits). Systems exceeding 8 qubits require frozen-core approximations or extended basis set loaders.
128
+ - **Physical Noise Assumptions**: Energy-error-under-noise simulation in Phase 4 models quantum channels via stochastic Kraus operators; cross-talk and drift are not modeled in initial releases.
129
+
130
+ ---
131
+
132
+ ## 📜 Prior Work & Citation
133
+
134
+ If you use this toolkit in your research, please cite:
135
+
136
+ ```bibtex
137
+ @software{khan2026hvk,
138
+ author = {Ashraf Khan},
139
+ title = {Hamiltonian VQE Kit: Validated, Honest VQE and ADAPT-VQE Toolkit},
140
+ year = {2026},
141
+ publisher = {GitHub},
142
+ version = {0.1.0},
143
+ url = {https://github.com/aashiq-parinda/hamiltonian-vqe-kit}
144
+ }
145
+ ```
146
+
147
+ This project builds upon foundational theoretical and architectural insights pre-registered in:
148
+ * Ashraf Khan (2026). *Rigorous Generalization Study: Transformer-Accelerated VQE Warm-Starting Across Multi-Molecule Families.* [Zenodo Record #22013110](https://doi.org/10.5281/zenodo.22013110).
149
+
150
+ ---
151
+
152
+ ## 📄 License
153
+
154
+ Licensed under the Apache License, Version 2.0 (the "License"). See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,112 @@
1
+ # Hamiltonian VQE Kit (`hvk`)
2
+
3
+ [![CI](https://github.com/aashiq-parinda/hamiltonian-vqe-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/aashiq-parinda/hamiltonian-vqe-kit/actions)
4
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
5
+ [![Python: 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
6
+ [![Prior Work DOI](https://img.shields.io/badge/Prior%20Work-10.5281%2Fzenodo.22013110-blue.svg)](https://doi.org/10.5281/zenodo.22013110)
7
+ [![Code Style: Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
8
+ [![Type Checked: Mypy](https://img.shields.io/badge/type%20checked-mypy-blue.svg)](https://mypy-lang.org/)
9
+
10
+ **Hamiltonian VQE Kit (`hvk`)** is an open-source, scientifically validated toolkit designed to take any molecular or qubit Hamiltonian and synthesize a diagnosed VQE / ADAPT-VQE workflow capable of achieving **chemical accuracy ($\le 1.6\,\text{mHa}$ vs. Full Configuration Interaction / FCI)** with strict, verifiable accounting of quantum simulation cost.
11
+
12
+ ---
13
+
14
+ ## 📌 Core Modules
15
+
16
+ | Module | Purpose |
17
+ | :--- | :--- |
18
+ | **`hvk.chemistry`** | PySCF & OpenFermion Hamiltonian loaders, Jordan-Wigner transformation, Pauli parsing, FCI & HF reference solutions |
19
+ | **`hvk.audit`** | Hamiltonian 2-body interaction graph analysis and wasted CNOT audit vs. rigid hardware-efficient ansätze (HEA) |
20
+ | **`hvk.adapt`** | Exact ADAPT-VQE engine with fermionic/qubit operator pools, commutator gradients, and strict measurement tracking |
21
+ | **`hvk.ansatz`** | Deterministic, connected sparse ansatz generator derived directly from Hamiltonian interaction topology |
22
+ | **`hvk.init`** | Principled statevector initializers (Random, Hartree-Fock, Perturbation-Adjusted HF, Guarded Residual ML) |
23
+ | **`hvk.diagnostics`** | Barren plateau gradient variance analyzers and realistic NISQ energy-error-under-noise benchmarks |
24
+ | **`hvk.exporters`** | Zero-overhead circuit and operator export to Qiskit, PennyLane, and Cirq |
25
+ | **`hvk.cli`** | Unified command-line interface (`hvk audit | adapt | build | init | diagnose | benchmark`) |
26
+
27
+ ---
28
+
29
+ ## ⚖️ Non-Negotiable Honesty Rules
30
+
31
+ This repository operates under strict scientific reproducibility constraints:
32
+
33
+ 1. **Zero Hardcoded Numbers**: Every metric, iteration count, and energy reported in documentation or tables must be generated by verifiable scripts in `benchmarks/results/` recording random seed, commit hash, and dependency versions.
34
+ 2. **FCI/PySCF Parity**: All molecular test systems ($H_2$, $\text{LiH}$, $\text{BeH}_2$, $H_4$ chain) must be validated directly against PySCF Hartree-Fock and FCI exact ground states. Tests fail if reference energies diverge.
35
+ 3. **Core is 100% Non-ML**: The core toolkit operates with standard numerical computing dependencies (`numpy`, `scipy`). Machine learning models are strictly optional extras (`pip install hvk[ml]`).
36
+ 4. **Honest Baseline Comparisons**: ML components must be compared head-to-head against exact non-ML and simple heuristic methods. If ML does not win, the null or negative result will be reported plainly.
37
+ 5. **Guarded Residual Initializer**: The residual-ML initializer is explicitly *guarded*, not guaranteed: it evaluates energy at $\boldsymbol{\theta}_{\text{HF}}$ and $\boldsymbol{\theta}_{\text{HF}} + \Delta\boldsymbol{\theta}$, returns the lower energy, and falls back to PA-HF when an explicit out-of-distribution (OOD) criterion is triggered.
38
+ 6. **Physical Noise Metric**: Noise benchmarks measure **ENERGY ERROR under noise vs. the exact ground state** with confidence intervals. State fidelity vs. ideal state is only reported if explicitly labeled as such.
39
+ 7. **Strict Measurement Accounting**: ADAPT execution tracks every energy evaluation, commutator measurement, and appended operator using documented, deterministic counting conventions.
40
+ 8. **Code Quality Standards**: 100% type annotations, comprehensive docstrings, clean `ruff` and `mypy` audits, unit tests for every public function, and test coverage $> 85\%$.
41
+
42
+ ---
43
+
44
+ ## ⚡ Quickstart
45
+
46
+ ### Installation
47
+
48
+ ```bash
49
+ # Core package (zero ML overhead)
50
+ pip install hamiltonian-vqe-kit
51
+
52
+ # With optional chemistry and dev dependencies
53
+ pip install "hamiltonian-vqe-kit[chemistry,dev]"
54
+
55
+ # With optional machine learning extensions
56
+ pip install "hamiltonian-vqe-kit[ml]"
57
+ ```
58
+
59
+ ### Command-Line Interface (CLI)
60
+
61
+ ```bash
62
+ # 1. Audit Hamiltonian locality and interaction graph
63
+ hvk audit H2
64
+
65
+ # 2. Run exact ADAPT-VQE toward chemical accuracy (<= 1.6 mHa)
66
+ hvk adapt LiH --accuracy 0.0016
67
+
68
+ # 3. Build a sparse ansatz from the interaction graph
69
+ hvk build BeH2
70
+
71
+ # 4. Run barren plateau diagnostic
72
+ hvk diagnose H4
73
+
74
+ # 5. Execute full reproducible multi-molecule benchmark suite
75
+ hvk benchmark --output-dir benchmarks/results
76
+ ```
77
+
78
+ ---
79
+
80
+ ## ⚠️ Limitations and Known Failures
81
+
82
+ *This section is continuously updated as empirical benchmarks are evaluated.*
83
+
84
+ - **Phase 0 Status**: Initial repository scaffolding and packaging phase. Core chemistry validation (Phase 1) is currently queued.
85
+ - **Qubit Active Space Boundaries**: Phase 1 through Phase 4 focus on small-molecule STO-3G active spaces ($N \le 8$ qubits). Systems exceeding 8 qubits require frozen-core approximations or extended basis set loaders.
86
+ - **Physical Noise Assumptions**: Energy-error-under-noise simulation in Phase 4 models quantum channels via stochastic Kraus operators; cross-talk and drift are not modeled in initial releases.
87
+
88
+ ---
89
+
90
+ ## 📜 Prior Work & Citation
91
+
92
+ If you use this toolkit in your research, please cite:
93
+
94
+ ```bibtex
95
+ @software{khan2026hvk,
96
+ author = {Ashraf Khan},
97
+ title = {Hamiltonian VQE Kit: Validated, Honest VQE and ADAPT-VQE Toolkit},
98
+ year = {2026},
99
+ publisher = {GitHub},
100
+ version = {0.1.0},
101
+ url = {https://github.com/aashiq-parinda/hamiltonian-vqe-kit}
102
+ }
103
+ ```
104
+
105
+ This project builds upon foundational theoretical and architectural insights pre-registered in:
106
+ * Ashraf Khan (2026). *Rigorous Generalization Study: Transformer-Accelerated VQE Warm-Starting Across Multi-Molecule Families.* [Zenodo Record #22013110](https://doi.org/10.5281/zenodo.22013110).
107
+
108
+ ---
109
+
110
+ ## 📄 License
111
+
112
+ Licensed under the Apache License, Version 2.0 (the "License"). See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,133 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "hamiltonian-vqe-kit"
7
+ version = "0.1.0"
8
+ description = "Validated, honest VQE and ADAPT-VQE toolkit for chemical accuracy and honest cost accounting"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ authors = [
13
+ { name = "Ashraf Khan", email = "research@appliedquantum.ai" }
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Science/Research",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Scientific/Engineering :: Physics",
23
+ "Topic :: Scientific/Engineering :: Chemistry",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "numpy>=1.24.0",
28
+ "scipy>=1.10.0",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ dev = [
33
+ "pytest>=7.4.0",
34
+ "pytest-cov>=4.1.0",
35
+ "ruff>=0.1.0",
36
+ "mypy>=1.6.0",
37
+ "pre-commit>=3.5.0",
38
+ ]
39
+ chemistry = [
40
+ "pyscf>=2.4.0; platform_system != 'Windows'",
41
+ "openfermion>=1.6.0",
42
+ ]
43
+ ml = [
44
+ "torch>=2.0.0",
45
+ ]
46
+ exporters = [
47
+ "qiskit>=1.0.0",
48
+ "pennylane>=0.35.0",
49
+ "cirq-core>=1.3.0",
50
+ ]
51
+ all = [
52
+ "hamiltonian-vqe-kit[dev,chemistry,ml,exporters]",
53
+ ]
54
+
55
+ [project.scripts]
56
+ hvk = "hvk.cli:main"
57
+
58
+ [project.urls]
59
+ Homepage = "https://github.com/aashiq-parinda/hamiltonian-vqe-kit"
60
+ Repository = "https://github.com/aashiq-parinda/hamiltonian-vqe-kit"
61
+ Issues = "https://github.com/aashiq-parinda/hamiltonian-vqe-kit/issues"
62
+
63
+ [tool.setuptools.packages.find]
64
+ where = ["src"]
65
+
66
+ [tool.setuptools.package-data]
67
+ hvk = ["py.typed"]
68
+
69
+ [tool.ruff]
70
+ line-length = 100
71
+ target-version = "py310"
72
+
73
+ [tool.ruff.lint]
74
+ select = [
75
+ "E", # pycodestyle errors
76
+ "W", # pycodestyle warnings
77
+ "F", # pyflakes
78
+ "I", # isort
79
+ "B", # flake8-bugbear
80
+ "C4", # flake8-comprehensions
81
+ "UP", # pyupgrade
82
+ "ARG", # flake8-unused-arguments
83
+ ]
84
+ ignore = [
85
+ "E501", # line too long (handled by formatter)
86
+ ]
87
+
88
+ [tool.ruff.format]
89
+ quote-style = "double"
90
+ indent-style = "space"
91
+
92
+ [tool.mypy]
93
+ python_version = "3.10"
94
+ warn_return_any = true
95
+ warn_unused_configs = false
96
+ disallow_untyped_defs = true
97
+ disallow_incomplete_defs = true
98
+ check_untyped_defs = true
99
+ no_implicit_optional = true
100
+ warn_redundant_casts = true
101
+ warn_unused_ignores = true
102
+
103
+ [[tool.mypy.overrides]]
104
+ module = [
105
+ "pyscf.*",
106
+ "openfermion.*",
107
+ "qiskit.*",
108
+ "pennylane.*",
109
+ "cirq.*",
110
+ "scipy.*",
111
+ ]
112
+ ignore_missing_imports = true
113
+
114
+ [tool.pytest.ini_options]
115
+ minversion = "7.0"
116
+ addopts = "-ra -q --strict-markers"
117
+ testpaths = ["tests"]
118
+ pythonpath = ["src"]
119
+
120
+ [tool.coverage.run]
121
+ source = ["hvk"]
122
+ branch = true
123
+
124
+ [tool.coverage.report]
125
+ fail_under = 85.0
126
+ show_missing = true
127
+ exclude_lines = [
128
+ "pragma: no cover",
129
+ "def __repr__",
130
+ "raise NotImplementedError",
131
+ "if __name__ == .__main__.:",
132
+ "if TYPE_CHECKING:",
133
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+