bilinear-quantum 1.0.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.

Potentially problematic release.


This version of bilinear-quantum might be problematic. Click here for more details.

Files changed (89) hide show
  1. bilinear_quantum-1.0.0/LICENSE +201 -0
  2. bilinear_quantum-1.0.0/PKG-INFO +130 -0
  3. bilinear_quantum-1.0.0/README.md +90 -0
  4. bilinear_quantum-1.0.0/pyproject.toml +87 -0
  5. bilinear_quantum-1.0.0/setup.cfg +4 -0
  6. bilinear_quantum-1.0.0/src/bilinear_quantum/__init__.py +44 -0
  7. bilinear_quantum-1.0.0/src/bilinear_quantum/analysis/__init__.py +1 -0
  8. bilinear_quantum-1.0.0/src/bilinear_quantum/analysis/audit.py +351 -0
  9. bilinear_quantum-1.0.0/src/bilinear_quantum/backends/__init__.py +5 -0
  10. bilinear_quantum-1.0.0/src/bilinear_quantum/backends/cirq_backend.py +38 -0
  11. bilinear_quantum-1.0.0/src/bilinear_quantum/backends/tfq_backend.py +44 -0
  12. bilinear_quantum-1.0.0/src/bilinear_quantum/circuits/__init__.py +5 -0
  13. bilinear_quantum-1.0.0/src/bilinear_quantum/circuits/bql_exact.py +56 -0
  14. bilinear_quantum-1.0.0/src/bilinear_quantum/circuits/canonical.py +86 -0
  15. bilinear_quantum-1.0.0/src/bilinear_quantum/configs/experiment_registry.yaml +67 -0
  16. bilinear_quantum-1.0.0/src/bilinear_quantum/core/__init__.py +15 -0
  17. bilinear_quantum-1.0.0/src/bilinear_quantum/core/bql.py +175 -0
  18. bilinear_quantum-1.0.0/src/bilinear_quantum/core/factorization.py +129 -0
  19. bilinear_quantum-1.0.0/src/bilinear_quantum/core/hirota.py +89 -0
  20. bilinear_quantum-1.0.0/src/bilinear_quantum/data/__init__.py +5 -0
  21. bilinear_quantum-1.0.0/src/bilinear_quantum/data/fourier.py +147 -0
  22. bilinear_quantum-1.0.0/src/bilinear_quantum/data/har.py +202 -0
  23. bilinear_quantum-1.0.0/src/bilinear_quantum/data/kdv.py +148 -0
  24. bilinear_quantum-1.0.0/src/bilinear_quantum/data/synthetic.py +73 -0
  25. bilinear_quantum-1.0.0/src/bilinear_quantum/data/wireless.py +52 -0
  26. bilinear_quantum-1.0.0/src/bilinear_quantum/estimators/__init__.py +15 -0
  27. bilinear_quantum-1.0.0/src/bilinear_quantum/estimators/parameter_shift.py +122 -0
  28. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/__init__.py +1 -0
  29. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/cli.py +68 -0
  30. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/common.py +153 -0
  31. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e10_dequantization.py +229 -0
  32. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e1_controlled_rank.py +187 -0
  33. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e2_true_hirota.py +191 -0
  34. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e3_kdv_operator.py +221 -0
  35. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e4_har.py +285 -0
  36. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e4_har_quantum.py +238 -0
  37. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e5_order.py +110 -0
  38. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e6_resources.py +104 -0
  39. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e7_shots.py +157 -0
  40. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e8_noise.py +134 -0
  41. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/e9_trainability.py +187 -0
  42. bilinear_quantum-1.0.0/src/bilinear_quantum/experiments/w0_wireless.py +98 -0
  43. bilinear_quantum-1.0.0/src/bilinear_quantum/gates/__init__.py +1 -0
  44. bilinear_quantum-1.0.0/src/bilinear_quantum/gates/environment.py +84 -0
  45. bilinear_quantum-1.0.0/src/bilinear_quantum/gates/runner.py +121 -0
  46. bilinear_quantum-1.0.0/src/bilinear_quantum/layers/__init__.py +6 -0
  47. bilinear_quantum-1.0.0/src/bilinear_quantum/layers/bql.py +178 -0
  48. bilinear_quantum-1.0.0/src/bilinear_quantum/layers/hqbl_core.py +123 -0
  49. bilinear_quantum-1.0.0/src/bilinear_quantum/models/__init__.py +5 -0
  50. bilinear_quantum-1.0.0/src/bilinear_quantum/models/bilinear.py +85 -0
  51. bilinear_quantum-1.0.0/src/bilinear_quantum/observables/__init__.py +5 -0
  52. bilinear_quantum-1.0.0/src/bilinear_quantum/observables/pauli.py +237 -0
  53. bilinear_quantum-1.0.0/src/bilinear_quantum/resources/__init__.py +5 -0
  54. bilinear_quantum-1.0.0/src/bilinear_quantum/resources/circuits.py +44 -0
  55. bilinear_quantum-1.0.0/src/bilinear_quantum/statistics/__init__.py +5 -0
  56. bilinear_quantum-1.0.0/src/bilinear_quantum/statistics/inference.py +68 -0
  57. bilinear_quantum-1.0.0/src/bilinear_quantum/utils/__init__.py +1 -0
  58. bilinear_quantum-1.0.0/src/bilinear_quantum/utils/artifacts.py +86 -0
  59. bilinear_quantum-1.0.0/src/bilinear_quantum.egg-info/PKG-INFO +130 -0
  60. bilinear_quantum-1.0.0/src/bilinear_quantum.egg-info/SOURCES.txt +87 -0
  61. bilinear_quantum-1.0.0/src/bilinear_quantum.egg-info/dependency_links.txt +1 -0
  62. bilinear_quantum-1.0.0/src/bilinear_quantum.egg-info/entry_points.txt +5 -0
  63. bilinear_quantum-1.0.0/src/bilinear_quantum.egg-info/requires.txt +21 -0
  64. bilinear_quantum-1.0.0/src/bilinear_quantum.egg-info/top_level.txt +1 -0
  65. bilinear_quantum-1.0.0/tests/test_artifact_json.py +15 -0
  66. bilinear_quantum-1.0.0/tests/test_bql_backends.py +52 -0
  67. bilinear_quantum-1.0.0/tests/test_bql_numpy.py +53 -0
  68. bilinear_quantum-1.0.0/tests/test_canonical_architecture.py +40 -0
  69. bilinear_quantum-1.0.0/tests/test_data_models_statistics.py +62 -0
  70. bilinear_quantum-1.0.0/tests/test_dequantization_e10.py +40 -0
  71. bilinear_quantum-1.0.0/tests/test_e4_features.py +28 -0
  72. bilinear_quantum-1.0.0/tests/test_e4_quantum_features.py +13 -0
  73. bilinear_quantum-1.0.0/tests/test_e5_w0.py +19 -0
  74. bilinear_quantum-1.0.0/tests/test_experiment_artifacts.py +43 -0
  75. bilinear_quantum-1.0.0/tests/test_experiment_e1_smoke.py +18 -0
  76. bilinear_quantum-1.0.0/tests/test_factorization.py +39 -0
  77. bilinear_quantum-1.0.0/tests/test_fourier_e2.py +37 -0
  78. bilinear_quantum-1.0.0/tests/test_gate_runner.py +16 -0
  79. bilinear_quantum-1.0.0/tests/test_gjo_parameter_shift.py +74 -0
  80. bilinear_quantum-1.0.0/tests/test_har_splits.py +65 -0
  81. bilinear_quantum-1.0.0/tests/test_hirota_core.py +57 -0
  82. bilinear_quantum-1.0.0/tests/test_kdv_e3.py +46 -0
  83. bilinear_quantum-1.0.0/tests/test_layers.py +66 -0
  84. bilinear_quantum-1.0.0/tests/test_noise_e8.py +19 -0
  85. bilinear_quantum-1.0.0/tests/test_packaged_registry.py +9 -0
  86. bilinear_quantum-1.0.0/tests/test_reproduction_script.py +27 -0
  87. bilinear_quantum-1.0.0/tests/test_resources_e6.py +20 -0
  88. bilinear_quantum-1.0.0/tests/test_shots_e7.py +16 -0
  89. bilinear_quantum-1.0.0/tests/test_trainability_e9.py +21 -0
@@ -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.
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.4
2
+ Name: bilinear-quantum
3
+ Version: 1.0.0
4
+ Summary: TensorFlow Quantum implementation of Bilinear and Hirota Quantum Bilinear Learning
5
+ Author-email: Nguyen Minh Tuan <minhtuan@ptit.edu.vn>, Bui Phi Hung <n23dcat028@student.ptithcm.edu.vn>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://pypi.org/project/bilinear-quantum/
8
+ Keywords: bilinear learning,Hirota bilinear operator,quantum machine learning,TensorFlow Quantum
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
16
+ Requires-Python: <3.13,>=3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: numpy==2.0.2
20
+ Requires-Dist: scipy==1.15.3
21
+ Requires-Dist: sympy==1.14.0
22
+ Requires-Dist: tensorflow==2.18.1
23
+ Requires-Dist: tf-keras==2.18.0
24
+ Requires-Dist: tensorflow-quantum==0.7.6
25
+ Requires-Dist: cirq-core==1.5.0
26
+ Requires-Dist: cirq-google==1.5.0
27
+ Requires-Dist: pandas<3,>=2.2
28
+ Requires-Dist: scikit-learn<2,>=1.5
29
+ Requires-Dist: matplotlib<4,>=3.9
30
+ Requires-Dist: seaborn<1,>=0.13
31
+ Requires-Dist: statsmodels<1,>=0.14
32
+ Requires-Dist: PyYAML<7,>=6
33
+ Requires-Dist: psutil<8,>=6
34
+ Provides-Extra: dev
35
+ Requires-Dist: build<2,>=1.2; extra == "dev"
36
+ Requires-Dist: pytest==8.3.5; extra == "dev"
37
+ Requires-Dist: pytest-cov<7,>=6; extra == "dev"
38
+ Requires-Dist: ruff<1,>=0.12; extra == "dev"
39
+ Dynamic: license-file
40
+
41
+ # Bilinear Quantum Learning / Hirota Quantum Bilinear Learning
42
+
43
+ This repository is the canonical implementation and evidence package for a
44
+ gate-based Bilinear Quantum Learning (BQL) foundation and its Hirota Quantum
45
+ Bilinear Learning (HQBL) hierarchy.
46
+
47
+ The project is governed by falsification-first gates:
48
+
49
+ 1. no backend skip is promoted to a pass;
50
+ 2. no learning experiment opens before exact mathematical invariants pass;
51
+ 3. classical, quantum, ordinary-bilinear, and Hirota comparisons are matched;
52
+ 4. negative results remain part of the evidence package;
53
+ 5. quantum advantage is not an assumed contribution.
54
+
55
+ ## Canonical runtime
56
+
57
+ The reproducible binary runtime is Linux x86-64, CPython 3.12, TensorFlow
58
+ 2.18.1, TF-Keras 2.18, TensorFlow Quantum 0.7.6, Cirq 1.5, NumPy 2.0,
59
+ SciPy 1.15, and SymPy 1.14. The exact environment is verified by
60
+ `scripts/verify_environment.py`; version drift is a hard failure.
61
+
62
+ ## Repository map
63
+
64
+ - `src/bilinear_quantum`: installable TensorFlow/TFQ library;
65
+ - `tests`: mathematical, backend, layer, serialization, and gate tests;
66
+ - `configs`: immutable experiment specifications;
67
+ - `scripts`: environment, gate, experiment, analysis, and release entrypoints;
68
+ - `docs`: master specification, traceability, and library documentation;
69
+ - `manuscript`: submission manuscript and supplementary material;
70
+ - `references`: immutable source packages supplied for the project;
71
+ - `artifacts`: generated evidence, reports, figures, and tables.
72
+ - `manuscript`: editable publication sources and bibliography;
73
+ - `output`: generated DOCX/PDF manuscripts, packages, and release bundle.
74
+
75
+ ## Current status
76
+
77
+ Work is accepted only through machine-readable gate reports. See
78
+ `artifacts/gates/` after executing the canonical gate runner.
79
+
80
+ ## Install and verify
81
+
82
+ Install the immutable public release on Linux x86-64 with CPython 3.12:
83
+
84
+ ```bash
85
+ python -m pip install bilinear-quantum==1.0.0
86
+ ```
87
+
88
+ Run a packaged smoke experiment without a repository checkout:
89
+
90
+ ```bash
91
+ bq-run-experiment E1 --profile smoke --output-root reproduced/smoke
92
+ ```
93
+
94
+ For development and full-profile evidence reproduction from a clean source
95
+ release:
96
+
97
+ ```bash
98
+ python -m pip install -r requirements-lock.txt
99
+ python -m pip install --no-deps -e .
100
+ export TF_USE_LEGACY_KERAS=1
101
+ bq-run-gates --project-root .
102
+ ```
103
+
104
+ To reproduce into a fresh immutable destination without touching the evidence
105
+ shipped with the release:
106
+
107
+ ```bash
108
+ python scripts/run_reproduction.py \
109
+ --profile full \
110
+ --artifact-root reproduced/full-20260825
111
+ ```
112
+
113
+ The exact API contract is documented in `docs/API.md`; the end-to-end data and
114
+ evidence procedure is in `docs/REPRODUCIBILITY.md`. Full-profile experiments
115
+ refuse an uncommitted or dirty source tree, and completed output directories
116
+ cannot be overwritten.
117
+
118
+ ## Authors and citation
119
+
120
+ The software release is authored by Nguyen Minh Tuan and Bui Phi Hung,
121
+ Faculty of Information Technology, Posts and Telecommunications Institute of
122
+ Technology, Ho Chi Minh City, Vietnam. Citation metadata is provided in
123
+ `CITATION.cff`.
124
+
125
+ ## License and third-party software
126
+
127
+ Original project code is released under the Apache License 2.0. Runtime
128
+ dependencies remain governed by their respective licenses and are installed
129
+ separately; no Elsevier template or third-party research document is bundled
130
+ in the Python distribution.
@@ -0,0 +1,90 @@
1
+ # Bilinear Quantum Learning / Hirota Quantum Bilinear Learning
2
+
3
+ This repository is the canonical implementation and evidence package for a
4
+ gate-based Bilinear Quantum Learning (BQL) foundation and its Hirota Quantum
5
+ Bilinear Learning (HQBL) hierarchy.
6
+
7
+ The project is governed by falsification-first gates:
8
+
9
+ 1. no backend skip is promoted to a pass;
10
+ 2. no learning experiment opens before exact mathematical invariants pass;
11
+ 3. classical, quantum, ordinary-bilinear, and Hirota comparisons are matched;
12
+ 4. negative results remain part of the evidence package;
13
+ 5. quantum advantage is not an assumed contribution.
14
+
15
+ ## Canonical runtime
16
+
17
+ The reproducible binary runtime is Linux x86-64, CPython 3.12, TensorFlow
18
+ 2.18.1, TF-Keras 2.18, TensorFlow Quantum 0.7.6, Cirq 1.5, NumPy 2.0,
19
+ SciPy 1.15, and SymPy 1.14. The exact environment is verified by
20
+ `scripts/verify_environment.py`; version drift is a hard failure.
21
+
22
+ ## Repository map
23
+
24
+ - `src/bilinear_quantum`: installable TensorFlow/TFQ library;
25
+ - `tests`: mathematical, backend, layer, serialization, and gate tests;
26
+ - `configs`: immutable experiment specifications;
27
+ - `scripts`: environment, gate, experiment, analysis, and release entrypoints;
28
+ - `docs`: master specification, traceability, and library documentation;
29
+ - `manuscript`: submission manuscript and supplementary material;
30
+ - `references`: immutable source packages supplied for the project;
31
+ - `artifacts`: generated evidence, reports, figures, and tables.
32
+ - `manuscript`: editable publication sources and bibliography;
33
+ - `output`: generated DOCX/PDF manuscripts, packages, and release bundle.
34
+
35
+ ## Current status
36
+
37
+ Work is accepted only through machine-readable gate reports. See
38
+ `artifacts/gates/` after executing the canonical gate runner.
39
+
40
+ ## Install and verify
41
+
42
+ Install the immutable public release on Linux x86-64 with CPython 3.12:
43
+
44
+ ```bash
45
+ python -m pip install bilinear-quantum==1.0.0
46
+ ```
47
+
48
+ Run a packaged smoke experiment without a repository checkout:
49
+
50
+ ```bash
51
+ bq-run-experiment E1 --profile smoke --output-root reproduced/smoke
52
+ ```
53
+
54
+ For development and full-profile evidence reproduction from a clean source
55
+ release:
56
+
57
+ ```bash
58
+ python -m pip install -r requirements-lock.txt
59
+ python -m pip install --no-deps -e .
60
+ export TF_USE_LEGACY_KERAS=1
61
+ bq-run-gates --project-root .
62
+ ```
63
+
64
+ To reproduce into a fresh immutable destination without touching the evidence
65
+ shipped with the release:
66
+
67
+ ```bash
68
+ python scripts/run_reproduction.py \
69
+ --profile full \
70
+ --artifact-root reproduced/full-20260825
71
+ ```
72
+
73
+ The exact API contract is documented in `docs/API.md`; the end-to-end data and
74
+ evidence procedure is in `docs/REPRODUCIBILITY.md`. Full-profile experiments
75
+ refuse an uncommitted or dirty source tree, and completed output directories
76
+ cannot be overwritten.
77
+
78
+ ## Authors and citation
79
+
80
+ The software release is authored by Nguyen Minh Tuan and Bui Phi Hung,
81
+ Faculty of Information Technology, Posts and Telecommunications Institute of
82
+ Technology, Ho Chi Minh City, Vietnam. Citation metadata is provided in
83
+ `CITATION.cff`.
84
+
85
+ ## License and third-party software
86
+
87
+ Original project code is released under the Apache License 2.0. Runtime
88
+ dependencies remain governed by their respective licenses and are installed
89
+ separately; no Elsevier template or third-party research document is bundled
90
+ in the Python distribution.
@@ -0,0 +1,87 @@
1
+ [build-system]
2
+ requires = ["setuptools>=75", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "bilinear-quantum"
7
+ version = "1.0.0"
8
+ description = "TensorFlow Quantum implementation of Bilinear and Hirota Quantum Bilinear Learning"
9
+ readme = "README.md"
10
+ requires-python = ">=3.12,<3.13"
11
+ license = "Apache-2.0"
12
+ authors = [
13
+ {name = "Nguyen Minh Tuan", email = "minhtuan@ptit.edu.vn"},
14
+ {name = "Bui Phi Hung", email = "n23dcat028@student.ptithcm.edu.vn"},
15
+ ]
16
+ keywords = [
17
+ "bilinear learning",
18
+ "Hirota bilinear operator",
19
+ "quantum machine learning",
20
+ "TensorFlow Quantum",
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 5 - Production/Stable",
24
+ "Intended Audience :: Science/Research",
25
+ "Operating System :: POSIX :: Linux",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
29
+ "Topic :: Scientific/Engineering :: Mathematics",
30
+ ]
31
+ dependencies = [
32
+ "numpy==2.0.2",
33
+ "scipy==1.15.3",
34
+ "sympy==1.14.0",
35
+ "tensorflow==2.18.1",
36
+ "tf-keras==2.18.0",
37
+ "tensorflow-quantum==0.7.6",
38
+ "cirq-core==1.5.0",
39
+ "cirq-google==1.5.0",
40
+ "pandas>=2.2,<3",
41
+ "scikit-learn>=1.5,<2",
42
+ "matplotlib>=3.9,<4",
43
+ "seaborn>=0.13,<1",
44
+ "statsmodels>=0.14,<1",
45
+ "PyYAML>=6,<7",
46
+ "psutil>=6,<8",
47
+ ]
48
+
49
+ [project.optional-dependencies]
50
+ dev = [
51
+ "build>=1.2,<2",
52
+ "pytest==8.3.5",
53
+ "pytest-cov>=6,<7",
54
+ "ruff>=0.12,<1",
55
+ ]
56
+
57
+ [project.scripts]
58
+ bq-verify-environment = "bilinear_quantum.gates.environment:main"
59
+ bq-run-gates = "bilinear_quantum.gates.runner:main"
60
+ bq-run-experiment = "bilinear_quantum.experiments.cli:main"
61
+ bq-audit = "bilinear_quantum.analysis.audit:main"
62
+
63
+ [project.urls]
64
+ Homepage = "https://pypi.org/project/bilinear-quantum/"
65
+
66
+ [tool.setuptools.package-data]
67
+ bilinear_quantum = ["configs/*.yaml"]
68
+
69
+ [tool.setuptools.packages.find]
70
+ where = ["src"]
71
+
72
+ [tool.pytest.ini_options]
73
+ pythonpath = ["src"]
74
+ testpaths = ["tests"]
75
+ addopts = "-ra --strict-markers"
76
+ markers = [
77
+ "canonical: requires the complete TensorFlow Quantum runtime",
78
+ "slow: computationally expensive validation",
79
+ ]
80
+
81
+ [tool.ruff]
82
+ line-length = 100
83
+ target-version = "py312"
84
+
85
+ [tool.ruff.lint]
86
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
87
+ ignore = ["E501"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,44 @@
1
+ """Bilinear Quantum Learning and Hirota Quantum Bilinear Learning.
2
+
3
+ The package separates exact mathematical reductions from empirical claims.
4
+ Importing the top-level package does not import TensorFlow Quantum; backend
5
+ modules load that relatively expensive dependency only when it is requested.
6
+ """
7
+
8
+ from .core.bql import (
9
+ Calibration,
10
+ CalibrationParameters,
11
+ bql_exact_numpy,
12
+ calibration_parameters,
13
+ classical_bilinear,
14
+ )
15
+ from .core.factorization import (
16
+ BilinearFactorization,
17
+ factorize_bilinear_matrix,
18
+ projection_radii,
19
+ truncated_svd_error_bound,
20
+ )
21
+ from .core.hirota import (
22
+ exchange_parity_residual,
23
+ hirota_bilinear,
24
+ hirota_rank_channels,
25
+ required_jet_indices,
26
+ )
27
+
28
+ __all__ = [
29
+ "BilinearFactorization",
30
+ "Calibration",
31
+ "CalibrationParameters",
32
+ "bql_exact_numpy",
33
+ "calibration_parameters",
34
+ "classical_bilinear",
35
+ "exchange_parity_residual",
36
+ "factorize_bilinear_matrix",
37
+ "hirota_bilinear",
38
+ "hirota_rank_channels",
39
+ "projection_radii",
40
+ "required_jet_indices",
41
+ "truncated_svd_error_bound",
42
+ ]
43
+
44
+ __version__ = "1.0.0"
@@ -0,0 +1 @@
1
+ """Post-run statistical and claim-evidence audits."""