oracq 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.
Files changed (614) hide show
  1. oracq-0.1.0/AGENTS.md +13 -0
  2. oracq-0.1.0/CONTRIBUTING.md +39 -0
  3. oracq-0.1.0/CONTRIBUTING.zh-CN.md +27 -0
  4. oracq-0.1.0/LICENSE +21 -0
  5. oracq-0.1.0/MANIFEST.in +6 -0
  6. oracq-0.1.0/PKG-INFO +201 -0
  7. oracq-0.1.0/README.md +164 -0
  8. oracq-0.1.0/README.zh-CN.md +128 -0
  9. oracq-0.1.0/SECURITY.md +12 -0
  10. oracq-0.1.0/docs/_ext/search_support.py +54 -0
  11. oracq-0.1.0/docs/_static/custom.css +5 -0
  12. oracq-0.1.0/docs/api/algorithms/basics/number_theory.rst +9 -0
  13. oracq-0.1.0/docs/api/algorithms/basics/oracle_algorithms.rst +9 -0
  14. oracq-0.1.0/docs/api/algorithms/common/arithmetic.rst +9 -0
  15. oracq-0.1.0/docs/api/algorithms/common/estimation.rst +9 -0
  16. oracq-0.1.0/docs/api/algorithms/common/fourier.rst +9 -0
  17. oracq-0.1.0/docs/api/algorithms/common/hamiltonian.rst +9 -0
  18. oracq-0.1.0/docs/api/algorithms/common/integration.rst +9 -0
  19. oracq-0.1.0/docs/api/algorithms/common/prepare_select.rst +9 -0
  20. oracq-0.1.0/docs/api/algorithms/common/qsvt.rst +9 -0
  21. oracq-0.1.0/docs/api/algorithms/common/search.rst +9 -0
  22. oracq-0.1.0/docs/api/algorithms/common/spectral_synthesis.rst +9 -0
  23. oracq-0.1.0/docs/api/algorithms/common/state_preparation.rst +9 -0
  24. oracq-0.1.0/docs/api/algorithms/common/transforms.rst +9 -0
  25. oracq-0.1.0/docs/api/algorithms/common/walks.rst +9 -0
  26. oracq-0.1.0/docs/api/algorithms/index.rst +53 -0
  27. oracq-0.1.0/docs/api/algorithms/input_model/block_encoding.rst +9 -0
  28. oracq-0.1.0/docs/api/algorithms/input_model/contracts.rst +9 -0
  29. oracq-0.1.0/docs/api/algorithms/input_model/data_loading.rst +9 -0
  30. oracq-0.1.0/docs/api/algorithms/input_model/density.rst +9 -0
  31. oracq-0.1.0/docs/api/algorithms/input_model/graph_walks.rst +9 -0
  32. oracq-0.1.0/docs/api/algorithms/input_model/interfaces.rst +9 -0
  33. oracq-0.1.0/docs/api/algorithms/input_model/lowrank.rst +9 -0
  34. oracq-0.1.0/docs/api/algorithms/input_model/operators.rst +9 -0
  35. oracq-0.1.0/docs/api/algorithms/input_model/oracles.rst +9 -0
  36. oracq-0.1.0/docs/api/algorithms/input_model/qdata.rst +9 -0
  37. oracq-0.1.0/docs/api/algorithms/input_model/qham.rst +9 -0
  38. oracq-0.1.0/docs/api/algorithms/input_model/sparse.rst +9 -0
  39. oracq-0.1.0/docs/api/algorithms/input_model/spectral.rst +9 -0
  40. oracq-0.1.0/docs/api/algorithms/optimization/dqi.rst +9 -0
  41. oracq-0.1.0/docs/api/algorithms/optimization/gradient.rst +9 -0
  42. oracq-0.1.0/docs/api/algorithms/optimization/variational.rst +9 -0
  43. oracq-0.1.0/docs/api/algorithms/qec/error_correction.rst +9 -0
  44. oracq-0.1.0/docs/api/algorithms/qlss/qlss.rst +9 -0
  45. oracq-0.1.0/docs/api/algorithms/qlss/vtaa_cks.rst +9 -0
  46. oracq-0.1.0/docs/api/algorithms/qml/qcnn.rst +9 -0
  47. oracq-0.1.0/docs/api/algorithms/qml/qcnn_layer.rst +9 -0
  48. oracq-0.1.0/docs/api/algorithms/qml/qpca.rst +9 -0
  49. oracq-0.1.0/docs/api/algorithms/qml/qsdp.rst +9 -0
  50. oracq-0.1.0/docs/api/algorithms/qml/recommendation.rst +9 -0
  51. oracq-0.1.0/docs/api/algorithms/qnlss/carleman.rst +9 -0
  52. oracq-0.1.0/docs/api/algorithms/qnlss/newton.rst +9 -0
  53. oracq-0.1.0/docs/api/algorithms/qode/cbmd.rst +9 -0
  54. oracq-0.1.0/docs/api/algorithms/qode/lchs.rst +9 -0
  55. oracq-0.1.0/docs/api/algorithms/qode/ode.rst +9 -0
  56. oracq-0.1.0/docs/api/algorithms/qode/ode_models.rst +9 -0
  57. oracq-0.1.0/docs/api/algorithms/qode/schrodingerization.rst +9 -0
  58. oracq-0.1.0/docs/api/algorithms/qode/sde.rst +9 -0
  59. oracq-0.1.0/docs/api/algorithms/qpde/pde.rst +9 -0
  60. oracq-0.1.0/docs/api/applications/catalog.rst +9 -0
  61. oracq-0.1.0/docs/api/applications/flow_data.rst +9 -0
  62. oracq-0.1.0/docs/api/applications/gallery.rst +9 -0
  63. oracq-0.1.0/docs/api/applications/index.rst +20 -0
  64. oracq-0.1.0/docs/api/applications/oracle_study.rst +9 -0
  65. oracq-0.1.0/docs/api/applications/qfvm.rst +9 -0
  66. oracq-0.1.0/docs/api/applications/qfvm_qmem.rst +9 -0
  67. oracq-0.1.0/docs/api/applications/qham/examples.rst +9 -0
  68. oracq-0.1.0/docs/api/applications/qham/linearization.rst +9 -0
  69. oracq-0.1.0/docs/api/applications/qham/pde.rst +9 -0
  70. oracq-0.1.0/docs/api/applications/qham/reference.rst +9 -0
  71. oracq-0.1.0/docs/api/applications/qham/report.rst +9 -0
  72. oracq-0.1.0/docs/api/applications/qham/stencils.rst +9 -0
  73. oracq-0.1.0/docs/api/applications/roe.rst +9 -0
  74. oracq-0.1.0/docs/api/applications/roe_formulas.rst +9 -0
  75. oracq-0.1.0/docs/api/index.rst +12 -0
  76. oracq-0.1.0/docs/api/infrastructure/backends/basis.rst +9 -0
  77. oracq-0.1.0/docs/api/infrastructure/backends/originir.rst +9 -0
  78. oracq-0.1.0/docs/api/infrastructure/backends/pysparq.rst +9 -0
  79. oracq-0.1.0/docs/api/infrastructure/backends/quantikz.rst +9 -0
  80. oracq-0.1.0/docs/api/infrastructure/backends/strict.rst +9 -0
  81. oracq-0.1.0/docs/api/infrastructure/builder.rst +9 -0
  82. oracq-0.1.0/docs/api/infrastructure/estimate.rst +9 -0
  83. oracq-0.1.0/docs/api/infrastructure/execution.rst +9 -0
  84. oracq-0.1.0/docs/api/infrastructure/index.rst +28 -0
  85. oracq-0.1.0/docs/api/infrastructure/ir.rst +9 -0
  86. oracq-0.1.0/docs/api/infrastructure/layout.rst +9 -0
  87. oracq-0.1.0/docs/api/infrastructure/linking.rst +9 -0
  88. oracq-0.1.0/docs/api/infrastructure/mathfunc/frontend.rst +9 -0
  89. oracq-0.1.0/docs/api/infrastructure/mathfunc/graph.rst +9 -0
  90. oracq-0.1.0/docs/api/infrastructure/mathfunc/lowering.rst +9 -0
  91. oracq-0.1.0/docs/api/infrastructure/mathfunc/numeric.rst +9 -0
  92. oracq-0.1.0/docs/api/infrastructure/mathfunc.rst +9 -0
  93. oracq-0.1.0/docs/api/infrastructure/native.rst +9 -0
  94. oracq-0.1.0/docs/api/infrastructure/qmem.rst +9 -0
  95. oracq-0.1.0/docs/api/infrastructure/qram_schema.rst +9 -0
  96. oracq-0.1.0/docs/api/infrastructure/readout.rst +9 -0
  97. oracq-0.1.0/docs/api/infrastructure/serialization.rst +9 -0
  98. oracq-0.1.0/docs/api/infrastructure/validation.rst +9 -0
  99. oracq-0.1.0/docs/api/toplevel.rst +95 -0
  100. oracq-0.1.0/docs/archive/application-assemblies.md +51 -0
  101. oracq-0.1.0/docs/archive/architecture.md +56 -0
  102. oracq-0.1.0/docs/archive/case-inventory.json +467 -0
  103. oracq-0.1.0/docs/archive/contract-hardening-plan.md +15 -0
  104. oracq-0.1.0/docs/archive/contract-hardening-validation.json +43 -0
  105. oracq-0.1.0/docs/archive/coverage.json +843 -0
  106. oracq-0.1.0/docs/archive/coverage.md +85 -0
  107. oracq-0.1.0/docs/archive/engineering-readiness-0.7.md +46 -0
  108. oracq-0.1.0/docs/archive/function-compiler-plan.md +29 -0
  109. oracq-0.1.0/docs/archive/function-compiler-validation.json +163 -0
  110. oracq-0.1.0/docs/archive/guide-0.6.md +423 -0
  111. oracq-0.1.0/docs/archive/language-0.7.md +477 -0
  112. oracq-0.1.0/docs/archive/oracle-paradigms.md +62 -0
  113. oracq-0.1.0/docs/archive/phase-validation.json +22 -0
  114. oracq-0.1.0/docs/archive/qfvm-qlss-plan.md +16 -0
  115. oracq-0.1.0/docs/archive/qfvm-qlss-validation.json +127 -0
  116. oracq-0.1.0/docs/archive/qham-general-plan.md +28 -0
  117. oracq-0.1.0/docs/archive/qham-general-validation.json +224 -0
  118. oracq-0.1.0/docs/archive/stage2-board.json +100 -0
  119. oracq-0.1.0/docs/archive/stage2-board.md +20 -0
  120. oracq-0.1.0/docs/archive/stage2-implementation.md +126 -0
  121. oracq-0.1.0/docs/archive/stage2-plan.md +30 -0
  122. oracq-0.1.0/docs/archive/stage2-validation.json +167 -0
  123. oracq-0.1.0/docs/archive/validation.md +32 -0
  124. oracq-0.1.0/docs/archive/workboard.json +90 -0
  125. oracq-0.1.0/docs/archive/workboard.md +75 -0
  126. oracq-0.1.0/docs/conf.py +56 -0
  127. oracq-0.1.0/docs/development/algorithm-coverage.md +86 -0
  128. oracq-0.1.0/docs/development/contributing.md +48 -0
  129. oracq-0.1.0/docs/development/index.md +25 -0
  130. oracq-0.1.0/docs/development/research-workflow-plan.md +80 -0
  131. oracq-0.1.0/docs/development/roadmap.md +36 -0
  132. oracq-0.1.0/docs/development/translation-glossary.md +154 -0
  133. oracq-0.1.0/docs/development/validation-coverage.md +132 -0
  134. oracq-0.1.0/docs/development/validation-plan.md +159 -0
  135. oracq-0.1.0/docs/development/validation.json +123 -0
  136. oracq-0.1.0/docs/development/validation.md +84 -0
  137. oracq-0.1.0/docs/development/writing-docs.md +193 -0
  138. oracq-0.1.0/docs/index.md +46 -0
  139. oracq-0.1.0/docs/manual/algorithms/index.md +24 -0
  140. oracq-0.1.0/docs/manual/architecture.md +78 -0
  141. oracq-0.1.0/docs/manual/backends.md +62 -0
  142. oracq-0.1.0/docs/manual/cli.md +88 -0
  143. oracq-0.1.0/docs/manual/compatibility.md +102 -0
  144. oracq-0.1.0/docs/manual/concepts.md +71 -0
  145. oracq-0.1.0/docs/manual/contracts.md +237 -0
  146. oracq-0.1.0/docs/manual/differential-equations.md +545 -0
  147. oracq-0.1.0/docs/manual/index.md +32 -0
  148. oracq-0.1.0/docs/manual/installation.md +54 -0
  149. oracq-0.1.0/docs/manual/limits.md +52 -0
  150. oracq-0.1.0/docs/manual/math-functions.md +144 -0
  151. oracq-0.1.0/docs/manual/operators.md +33 -0
  152. oracq-0.1.0/docs/manual/qcnn-walkthrough.md +150 -0
  153. oracq-0.1.0/docs/manual/qdata.md +52 -0
  154. oracq-0.1.0/docs/manual/qfvm.md +304 -0
  155. oracq-0.1.0/docs/manual/qham.md +384 -0
  156. oracq-0.1.0/docs/manual/qmem.md +62 -0
  157. oracq-0.1.0/docs/manual/resource-estimation.md +69 -0
  158. oracq-0.1.0/docs/reference/backend-compatibility.md +87 -0
  159. oracq-0.1.0/docs/reference/index.md +18 -0
  160. oracq-0.1.0/docs/reference/language.md +71 -0
  161. oracq-0.1.0/docs/reference/math-ir.md +63 -0
  162. oracq-0.1.0/docs/reference/open-ir.md +74 -0
  163. oracq-0.1.0/docs/reference/qfvm-input-models.md +231 -0
  164. oracq-0.1.0/docs/reference/qham-derivation.md +125 -0
  165. oracq-0.1.0/docs/reference/qram-memory.md +65 -0
  166. oracq-0.1.0/docs/reference/rir.md +941 -0
  167. oracq-0.1.0/docs/reference/schemas/math-ir.schema.json +160 -0
  168. oracq-0.1.0/docs/reference/schemas/pde.schema.json +133 -0
  169. oracq-0.1.0/docs/reference/schemas/qcl-plan.schema.json +154 -0
  170. oracq-0.1.0/docs/reference/schemas/qram-memory.schema.json +122 -0
  171. oracq-0.1.0/docs/reference/schemas/rir.schema.json +489 -0
  172. oracq-0.1.0/docs/tutorials/algorithm-research.md +69 -0
  173. oracq-0.1.0/docs/tutorials/differential-equations.md +54 -0
  174. oracq-0.1.0/docs/tutorials/first-program.md +103 -0
  175. oracq-0.1.0/docs/tutorials/gallery.md +75 -0
  176. oracq-0.1.0/docs/tutorials/hamiltonian.md +43 -0
  177. oracq-0.1.0/docs/tutorials/index.md +19 -0
  178. oracq-0.1.0/docs/tutorials/oracle-binding.md +62 -0
  179. oracq-0.1.0/docs/tutorials/qham.md +46 -0
  180. oracq-0.1.0/docs/tutorials/scientific-workflows.md +167 -0
  181. oracq-0.1.0/docs/tutorials/search-and-estimation.md +53 -0
  182. oracq-0.1.0/docs/zh/api/algorithms/basics/number_theory.rst +9 -0
  183. oracq-0.1.0/docs/zh/api/algorithms/basics/oracle_algorithms.rst +9 -0
  184. oracq-0.1.0/docs/zh/api/algorithms/common/arithmetic.rst +9 -0
  185. oracq-0.1.0/docs/zh/api/algorithms/common/estimation.rst +9 -0
  186. oracq-0.1.0/docs/zh/api/algorithms/common/fourier.rst +9 -0
  187. oracq-0.1.0/docs/zh/api/algorithms/common/hamiltonian.rst +9 -0
  188. oracq-0.1.0/docs/zh/api/algorithms/common/integration.rst +9 -0
  189. oracq-0.1.0/docs/zh/api/algorithms/common/prepare_select.rst +9 -0
  190. oracq-0.1.0/docs/zh/api/algorithms/common/qsvt.rst +9 -0
  191. oracq-0.1.0/docs/zh/api/algorithms/common/search.rst +9 -0
  192. oracq-0.1.0/docs/zh/api/algorithms/common/spectral_synthesis.rst +9 -0
  193. oracq-0.1.0/docs/zh/api/algorithms/common/state_preparation.rst +9 -0
  194. oracq-0.1.0/docs/zh/api/algorithms/common/transforms.rst +9 -0
  195. oracq-0.1.0/docs/zh/api/algorithms/common/walks.rst +9 -0
  196. oracq-0.1.0/docs/zh/api/algorithms/index.rst +53 -0
  197. oracq-0.1.0/docs/zh/api/algorithms/input_model/block_encoding.rst +9 -0
  198. oracq-0.1.0/docs/zh/api/algorithms/input_model/contracts.rst +9 -0
  199. oracq-0.1.0/docs/zh/api/algorithms/input_model/data_loading.rst +9 -0
  200. oracq-0.1.0/docs/zh/api/algorithms/input_model/density.rst +9 -0
  201. oracq-0.1.0/docs/zh/api/algorithms/input_model/graph_walks.rst +9 -0
  202. oracq-0.1.0/docs/zh/api/algorithms/input_model/interfaces.rst +9 -0
  203. oracq-0.1.0/docs/zh/api/algorithms/input_model/lowrank.rst +9 -0
  204. oracq-0.1.0/docs/zh/api/algorithms/input_model/operators.rst +9 -0
  205. oracq-0.1.0/docs/zh/api/algorithms/input_model/oracles.rst +9 -0
  206. oracq-0.1.0/docs/zh/api/algorithms/input_model/qdata.rst +9 -0
  207. oracq-0.1.0/docs/zh/api/algorithms/input_model/qham.rst +9 -0
  208. oracq-0.1.0/docs/zh/api/algorithms/input_model/sparse.rst +9 -0
  209. oracq-0.1.0/docs/zh/api/algorithms/input_model/spectral.rst +9 -0
  210. oracq-0.1.0/docs/zh/api/algorithms/optimization/dqi.rst +9 -0
  211. oracq-0.1.0/docs/zh/api/algorithms/optimization/gradient.rst +9 -0
  212. oracq-0.1.0/docs/zh/api/algorithms/optimization/variational.rst +9 -0
  213. oracq-0.1.0/docs/zh/api/algorithms/qec/error_correction.rst +9 -0
  214. oracq-0.1.0/docs/zh/api/algorithms/qlss/qlss.rst +9 -0
  215. oracq-0.1.0/docs/zh/api/algorithms/qlss/vtaa_cks.rst +9 -0
  216. oracq-0.1.0/docs/zh/api/algorithms/qml/qcnn.rst +9 -0
  217. oracq-0.1.0/docs/zh/api/algorithms/qml/qcnn_layer.rst +9 -0
  218. oracq-0.1.0/docs/zh/api/algorithms/qml/qpca.rst +9 -0
  219. oracq-0.1.0/docs/zh/api/algorithms/qml/qsdp.rst +9 -0
  220. oracq-0.1.0/docs/zh/api/algorithms/qml/recommendation.rst +9 -0
  221. oracq-0.1.0/docs/zh/api/algorithms/qnlss/carleman.rst +9 -0
  222. oracq-0.1.0/docs/zh/api/algorithms/qnlss/newton.rst +9 -0
  223. oracq-0.1.0/docs/zh/api/algorithms/qode/cbmd.rst +9 -0
  224. oracq-0.1.0/docs/zh/api/algorithms/qode/lchs.rst +9 -0
  225. oracq-0.1.0/docs/zh/api/algorithms/qode/ode.rst +9 -0
  226. oracq-0.1.0/docs/zh/api/algorithms/qode/ode_models.rst +9 -0
  227. oracq-0.1.0/docs/zh/api/algorithms/qode/schrodingerization.rst +9 -0
  228. oracq-0.1.0/docs/zh/api/algorithms/qode/sde.rst +9 -0
  229. oracq-0.1.0/docs/zh/api/algorithms/qpde/pde.rst +9 -0
  230. oracq-0.1.0/docs/zh/api/applications/catalog.rst +9 -0
  231. oracq-0.1.0/docs/zh/api/applications/flow_data.rst +9 -0
  232. oracq-0.1.0/docs/zh/api/applications/gallery.rst +9 -0
  233. oracq-0.1.0/docs/zh/api/applications/index.rst +20 -0
  234. oracq-0.1.0/docs/zh/api/applications/oracle_study.rst +9 -0
  235. oracq-0.1.0/docs/zh/api/applications/qfvm.rst +9 -0
  236. oracq-0.1.0/docs/zh/api/applications/qfvm_qmem.rst +9 -0
  237. oracq-0.1.0/docs/zh/api/applications/qham/examples.rst +9 -0
  238. oracq-0.1.0/docs/zh/api/applications/qham/linearization.rst +9 -0
  239. oracq-0.1.0/docs/zh/api/applications/qham/pde.rst +9 -0
  240. oracq-0.1.0/docs/zh/api/applications/qham/reference.rst +9 -0
  241. oracq-0.1.0/docs/zh/api/applications/qham/report.rst +9 -0
  242. oracq-0.1.0/docs/zh/api/applications/qham/stencils.rst +9 -0
  243. oracq-0.1.0/docs/zh/api/applications/roe.rst +9 -0
  244. oracq-0.1.0/docs/zh/api/applications/roe_formulas.rst +9 -0
  245. oracq-0.1.0/docs/zh/api/index.rst +12 -0
  246. oracq-0.1.0/docs/zh/api/infrastructure/backends/basis.rst +9 -0
  247. oracq-0.1.0/docs/zh/api/infrastructure/backends/originir.rst +9 -0
  248. oracq-0.1.0/docs/zh/api/infrastructure/backends/pysparq.rst +9 -0
  249. oracq-0.1.0/docs/zh/api/infrastructure/backends/quantikz.rst +9 -0
  250. oracq-0.1.0/docs/zh/api/infrastructure/backends/strict.rst +9 -0
  251. oracq-0.1.0/docs/zh/api/infrastructure/builder.rst +9 -0
  252. oracq-0.1.0/docs/zh/api/infrastructure/estimate.rst +9 -0
  253. oracq-0.1.0/docs/zh/api/infrastructure/execution.rst +9 -0
  254. oracq-0.1.0/docs/zh/api/infrastructure/index.rst +28 -0
  255. oracq-0.1.0/docs/zh/api/infrastructure/ir.rst +9 -0
  256. oracq-0.1.0/docs/zh/api/infrastructure/layout.rst +9 -0
  257. oracq-0.1.0/docs/zh/api/infrastructure/linking.rst +9 -0
  258. oracq-0.1.0/docs/zh/api/infrastructure/mathfunc/frontend.rst +9 -0
  259. oracq-0.1.0/docs/zh/api/infrastructure/mathfunc/graph.rst +9 -0
  260. oracq-0.1.0/docs/zh/api/infrastructure/mathfunc/lowering.rst +9 -0
  261. oracq-0.1.0/docs/zh/api/infrastructure/mathfunc/numeric.rst +9 -0
  262. oracq-0.1.0/docs/zh/api/infrastructure/mathfunc.rst +9 -0
  263. oracq-0.1.0/docs/zh/api/infrastructure/native.rst +9 -0
  264. oracq-0.1.0/docs/zh/api/infrastructure/qmem.rst +9 -0
  265. oracq-0.1.0/docs/zh/api/infrastructure/qram_schema.rst +9 -0
  266. oracq-0.1.0/docs/zh/api/infrastructure/readout.rst +9 -0
  267. oracq-0.1.0/docs/zh/api/infrastructure/serialization.rst +9 -0
  268. oracq-0.1.0/docs/zh/api/infrastructure/validation.rst +9 -0
  269. oracq-0.1.0/docs/zh/api/toplevel.rst +95 -0
  270. oracq-0.1.0/docs/zh/conf.py +22 -0
  271. oracq-0.1.0/docs/zh/development/algorithm-coverage.md +72 -0
  272. oracq-0.1.0/docs/zh/development/contributing.md +29 -0
  273. oracq-0.1.0/docs/zh/development/index.md +21 -0
  274. oracq-0.1.0/docs/zh/development/research-workflow-plan.md +56 -0
  275. oracq-0.1.0/docs/zh/development/roadmap.md +18 -0
  276. oracq-0.1.0/docs/zh/development/translation-glossary.md +154 -0
  277. oracq-0.1.0/docs/zh/development/validation-coverage.md +98 -0
  278. oracq-0.1.0/docs/zh/development/validation-plan.md +113 -0
  279. oracq-0.1.0/docs/zh/development/validation.json +123 -0
  280. oracq-0.1.0/docs/zh/development/validation.md +44 -0
  281. oracq-0.1.0/docs/zh/development/writing-docs.md +67 -0
  282. oracq-0.1.0/docs/zh/index.md +32 -0
  283. oracq-0.1.0/docs/zh/manual/algorithms/adjacency-oracle.md +83 -0
  284. oracq-0.1.0/docs/zh/manual/algorithms/alias-preparation.md +82 -0
  285. oracq-0.1.0/docs/zh/manual/algorithms/amplitude-amplification.md +76 -0
  286. oracq-0.1.0/docs/zh/manual/algorithms/bernstein-vazirani.md +83 -0
  287. oracq-0.1.0/docs/zh/manual/algorithms/block-encoding-algebra.md +97 -0
  288. oracq-0.1.0/docs/zh/manual/algorithms/boolean-networks.md +77 -0
  289. oracq-0.1.0/docs/zh/manual/algorithms/carleman.md +103 -0
  290. oracq-0.1.0/docs/zh/manual/algorithms/cbmd.md +97 -0
  291. oracq-0.1.0/docs/zh/manual/algorithms/cks.md +99 -0
  292. oracq-0.1.0/docs/zh/manual/algorithms/coined-cycle-walk.md +70 -0
  293. oracq-0.1.0/docs/zh/manual/algorithms/costa-walk.md +82 -0
  294. oracq-0.1.0/docs/zh/manual/algorithms/density-matrix-exponentiation.md +84 -0
  295. oracq-0.1.0/docs/zh/manual/algorithms/deutsch-jozsa.md +75 -0
  296. oracq-0.1.0/docs/zh/manual/algorithms/double-factorization.md +98 -0
  297. oracq-0.1.0/docs/zh/manual/algorithms/dqi.md +89 -0
  298. oracq-0.1.0/docs/zh/manual/algorithms/eigenstate-filtering.md +86 -0
  299. oracq-0.1.0/docs/zh/manual/algorithms/fixed-point-arithmetic.md +68 -0
  300. oracq-0.1.0/docs/zh/manual/algorithms/fixed-point-search.md +80 -0
  301. oracq-0.1.0/docs/zh/manual/algorithms/fokker-planck.md +114 -0
  302. oracq-0.1.0/docs/zh/manual/algorithms/fourier-addition.md +65 -0
  303. oracq-0.1.0/docs/zh/manual/algorithms/gibbs-state.md +89 -0
  304. oracq-0.1.0/docs/zh/manual/algorithms/grover.md +80 -0
  305. oracq-0.1.0/docs/zh/manual/algorithms/hadamard-test.md +78 -0
  306. oracq-0.1.0/docs/zh/manual/algorithms/hamiltonian-simulation.md +80 -0
  307. oracq-0.1.0/docs/zh/manual/algorithms/heinrich-integration.md +86 -0
  308. oracq-0.1.0/docs/zh/manual/algorithms/heinrich-summation.md +85 -0
  309. oracq-0.1.0/docs/zh/manual/algorithms/index.md +144 -0
  310. oracq-0.1.0/docs/zh/manual/algorithms/jordan-gradient.md +88 -0
  311. oracq-0.1.0/docs/zh/manual/algorithms/lchs.md +95 -0
  312. oracq-0.1.0/docs/zh/manual/algorithms/mathfunc.md +87 -0
  313. oracq-0.1.0/docs/zh/manual/algorithms/mnrs-search.md +85 -0
  314. oracq-0.1.0/docs/zh/manual/algorithms/modular-multiplication.md +88 -0
  315. oracq-0.1.0/docs/zh/manual/algorithms/oblivious-amplification.md +100 -0
  316. oracq-0.1.0/docs/zh/manual/algorithms/order-finding.md +81 -0
  317. oracq-0.1.0/docs/zh/manual/algorithms/prepare-select.md +102 -0
  318. oracq-0.1.0/docs/zh/manual/algorithms/purification.md +93 -0
  319. oracq-0.1.0/docs/zh/manual/algorithms/qae.md +90 -0
  320. oracq-0.1.0/docs/zh/manual/algorithms/qaoa-maxcut.md +83 -0
  321. oracq-0.1.0/docs/zh/manual/algorithms/qcnn.md +62 -0
  322. oracq-0.1.0/docs/zh/manual/algorithms/qft.md +78 -0
  323. oracq-0.1.0/docs/zh/manual/algorithms/qfvm.md +91 -0
  324. oracq-0.1.0/docs/zh/manual/algorithms/qham.md +109 -0
  325. oracq-0.1.0/docs/zh/manual/algorithms/qode-problem.md +111 -0
  326. oracq-0.1.0/docs/zh/manual/algorithms/qpca.md +90 -0
  327. oracq-0.1.0/docs/zh/manual/algorithms/qpe.md +83 -0
  328. oracq-0.1.0/docs/zh/manual/algorithms/qrom-lookup.md +92 -0
  329. oracq-0.1.0/docs/zh/manual/algorithms/qsp-phase-synthesis.md +72 -0
  330. oracq-0.1.0/docs/zh/manual/algorithms/qsvt-hamiltonian-simulation.md +77 -0
  331. oracq-0.1.0/docs/zh/manual/algorithms/qsvt-matrix-inversion.md +91 -0
  332. oracq-0.1.0/docs/zh/manual/algorithms/qsvt-sequence.md +101 -0
  333. oracq-0.1.0/docs/zh/manual/algorithms/quantum-counting.md +72 -0
  334. oracq-0.1.0/docs/zh/manual/algorithms/qubitization-walk.md +101 -0
  335. oracq-0.1.0/docs/zh/manual/algorithms/repetition-codes.md +77 -0
  336. oracq-0.1.0/docs/zh/manual/algorithms/schrodingerization.md +98 -0
  337. oracq-0.1.0/docs/zh/manual/algorithms/select-swap.md +84 -0
  338. oracq-0.1.0/docs/zh/manual/algorithms/simon.md +78 -0
  339. oracq-0.1.0/docs/zh/manual/algorithms/sparse-access.md +94 -0
  340. oracq-0.1.0/docs/zh/manual/algorithms/sparse-block-encoding.md +96 -0
  341. oracq-0.1.0/docs/zh/manual/algorithms/state-preparation.md +108 -0
  342. oracq-0.1.0/docs/zh/manual/algorithms/swap-test.md +79 -0
  343. oracq-0.1.0/docs/zh/manual/algorithms/szegedy-walk.md +80 -0
  344. oracq-0.1.0/docs/zh/manual/algorithms/taylor-block-encoding.md +85 -0
  345. oracq-0.1.0/docs/zh/manual/algorithms/thc.md +84 -0
  346. oracq-0.1.0/docs/zh/manual/algorithms/trotter.md +87 -0
  347. oracq-0.1.0/docs/zh/manual/algorithms/variational-ansatz.md +72 -0
  348. oracq-0.1.0/docs/zh/manual/algorithms/vqe.md +77 -0
  349. oracq-0.1.0/docs/zh/manual/algorithms/vtaa-cks.md +64 -0
  350. oracq-0.1.0/docs/zh/manual/algorithms/xor-database.md +92 -0
  351. oracq-0.1.0/docs/zh/manual/architecture.md +45 -0
  352. oracq-0.1.0/docs/zh/manual/backends.md +27 -0
  353. oracq-0.1.0/docs/zh/manual/cli.md +66 -0
  354. oracq-0.1.0/docs/zh/manual/compatibility.md +78 -0
  355. oracq-0.1.0/docs/zh/manual/concepts.md +35 -0
  356. oracq-0.1.0/docs/zh/manual/contracts.md +238 -0
  357. oracq-0.1.0/docs/zh/manual/differential-equations.md +545 -0
  358. oracq-0.1.0/docs/zh/manual/index.md +28 -0
  359. oracq-0.1.0/docs/zh/manual/installation.md +39 -0
  360. oracq-0.1.0/docs/zh/manual/limits.md +32 -0
  361. oracq-0.1.0/docs/zh/manual/math-functions.md +144 -0
  362. oracq-0.1.0/docs/zh/manual/operators.md +33 -0
  363. oracq-0.1.0/docs/zh/manual/qcnn-walkthrough.md +150 -0
  364. oracq-0.1.0/docs/zh/manual/qdata.md +52 -0
  365. oracq-0.1.0/docs/zh/manual/qfvm.md +297 -0
  366. oracq-0.1.0/docs/zh/manual/qham.md +370 -0
  367. oracq-0.1.0/docs/zh/manual/qmem.md +62 -0
  368. oracq-0.1.0/docs/zh/manual/resource-estimation.md +107 -0
  369. oracq-0.1.0/docs/zh/reference/backend-compatibility.md +87 -0
  370. oracq-0.1.0/docs/zh/reference/index.md +18 -0
  371. oracq-0.1.0/docs/zh/reference/language.md +71 -0
  372. oracq-0.1.0/docs/zh/reference/math-ir.md +63 -0
  373. oracq-0.1.0/docs/zh/reference/open-ir.md +85 -0
  374. oracq-0.1.0/docs/zh/reference/qfvm-input-models.md +230 -0
  375. oracq-0.1.0/docs/zh/reference/qham-derivation.md +125 -0
  376. oracq-0.1.0/docs/zh/reference/qram-memory.md +65 -0
  377. oracq-0.1.0/docs/zh/reference/rir.md +939 -0
  378. oracq-0.1.0/docs/zh/reference/schemas/math-ir.schema.json +160 -0
  379. oracq-0.1.0/docs/zh/reference/schemas/pde.schema.json +133 -0
  380. oracq-0.1.0/docs/zh/reference/schemas/qcl-plan.schema.json +154 -0
  381. oracq-0.1.0/docs/zh/reference/schemas/qram-memory.schema.json +122 -0
  382. oracq-0.1.0/docs/zh/reference/schemas/rir.schema.json +489 -0
  383. oracq-0.1.0/docs/zh/tutorials/algorithm-research.md +71 -0
  384. oracq-0.1.0/docs/zh/tutorials/differential-equations.md +54 -0
  385. oracq-0.1.0/docs/zh/tutorials/first-program.md +103 -0
  386. oracq-0.1.0/docs/zh/tutorials/gallery.md +75 -0
  387. oracq-0.1.0/docs/zh/tutorials/hamiltonian.md +43 -0
  388. oracq-0.1.0/docs/zh/tutorials/index.md +19 -0
  389. oracq-0.1.0/docs/zh/tutorials/oracle-binding.md +62 -0
  390. oracq-0.1.0/docs/zh/tutorials/qham.md +46 -0
  391. oracq-0.1.0/docs/zh/tutorials/scientific-workflows.md +158 -0
  392. oracq-0.1.0/docs/zh/tutorials/search-and-estimation.md +52 -0
  393. oracq-0.1.0/examples/algorithm_contracts.py +164 -0
  394. oracq-0.1.0/examples/algorithm_gallery.py +70 -0
  395. oracq-0.1.0/examples/general_qham.py +42 -0
  396. oracq-0.1.0/examples/input_models.py +409 -0
  397. oracq-0.1.0/examples/math_functions.py +39 -0
  398. oracq-0.1.0/examples/memory.qram.yaml +6 -0
  399. oracq-0.1.0/examples/ode_input_models.py +387 -0
  400. oracq-0.1.0/examples/qdata_recommendation.py +46 -0
  401. oracq-0.1.0/examples/qmem_pointers.py +76 -0
  402. oracq-0.1.0/examples/qram.originir +16 -0
  403. oracq-0.1.0/examples/qram.rir.json +290 -0
  404. oracq-0.1.0/examples/qram.rir.yaml +183 -0
  405. oracq-0.1.0/examples/qram_modules.py +36 -0
  406. oracq-0.1.0/examples/research_workflow.py +78 -0
  407. oracq-0.1.0/pyproject.toml +62 -0
  408. oracq-0.1.0/setup.cfg +4 -0
  409. oracq-0.1.0/src/oracq/__init__.py +240 -0
  410. oracq-0.1.0/src/oracq/__main__.py +212 -0
  411. oracq-0.1.0/src/oracq/_compat.py +127 -0
  412. oracq-0.1.0/src/oracq/algorithms/__init__.py +1 -0
  413. oracq-0.1.0/src/oracq/algorithms/basics/__init__.py +1 -0
  414. oracq-0.1.0/src/oracq/algorithms/basics/number_theory.py +131 -0
  415. oracq-0.1.0/src/oracq/algorithms/basics/oracle_algorithms.py +169 -0
  416. oracq-0.1.0/src/oracq/algorithms/common/__init__.py +1 -0
  417. oracq-0.1.0/src/oracq/algorithms/common/arithmetic.py +768 -0
  418. oracq-0.1.0/src/oracq/algorithms/common/estimation.py +203 -0
  419. oracq-0.1.0/src/oracq/algorithms/common/fourier.py +85 -0
  420. oracq-0.1.0/src/oracq/algorithms/common/hamiltonian.py +438 -0
  421. oracq-0.1.0/src/oracq/algorithms/common/integration.py +343 -0
  422. oracq-0.1.0/src/oracq/algorithms/common/prepare_select.py +459 -0
  423. oracq-0.1.0/src/oracq/algorithms/common/qsvt.py +836 -0
  424. oracq-0.1.0/src/oracq/algorithms/common/search.py +170 -0
  425. oracq-0.1.0/src/oracq/algorithms/common/spectral_synthesis.py +225 -0
  426. oracq-0.1.0/src/oracq/algorithms/common/state_preparation.py +118 -0
  427. oracq-0.1.0/src/oracq/algorithms/common/transforms.py +107 -0
  428. oracq-0.1.0/src/oracq/algorithms/common/walks.py +37 -0
  429. oracq-0.1.0/src/oracq/algorithms/input_model/__init__.py +1 -0
  430. oracq-0.1.0/src/oracq/algorithms/input_model/block_encoding.py +299 -0
  431. oracq-0.1.0/src/oracq/algorithms/input_model/contracts.py +664 -0
  432. oracq-0.1.0/src/oracq/algorithms/input_model/data_loading.py +295 -0
  433. oracq-0.1.0/src/oracq/algorithms/input_model/density.py +810 -0
  434. oracq-0.1.0/src/oracq/algorithms/input_model/graph_walks.py +505 -0
  435. oracq-0.1.0/src/oracq/algorithms/input_model/interfaces.py +289 -0
  436. oracq-0.1.0/src/oracq/algorithms/input_model/lowrank.py +501 -0
  437. oracq-0.1.0/src/oracq/algorithms/input_model/operators.py +296 -0
  438. oracq-0.1.0/src/oracq/algorithms/input_model/oracles.py +1070 -0
  439. oracq-0.1.0/src/oracq/algorithms/input_model/qdata.py +454 -0
  440. oracq-0.1.0/src/oracq/algorithms/input_model/qham.py +706 -0
  441. oracq-0.1.0/src/oracq/algorithms/input_model/sparse.py +437 -0
  442. oracq-0.1.0/src/oracq/algorithms/input_model/spectral.py +324 -0
  443. oracq-0.1.0/src/oracq/algorithms/optimization/__init__.py +1 -0
  444. oracq-0.1.0/src/oracq/algorithms/optimization/dqi.py +370 -0
  445. oracq-0.1.0/src/oracq/algorithms/optimization/gradient.py +351 -0
  446. oracq-0.1.0/src/oracq/algorithms/optimization/variational.py +165 -0
  447. oracq-0.1.0/src/oracq/algorithms/qec/__init__.py +1 -0
  448. oracq-0.1.0/src/oracq/algorithms/qec/error_correction.py +62 -0
  449. oracq-0.1.0/src/oracq/algorithms/qlss/__init__.py +1 -0
  450. oracq-0.1.0/src/oracq/algorithms/qlss/qlss.py +1068 -0
  451. oracq-0.1.0/src/oracq/algorithms/qlss/vtaa_cks.py +598 -0
  452. oracq-0.1.0/src/oracq/algorithms/qml/__init__.py +1 -0
  453. oracq-0.1.0/src/oracq/algorithms/qml/qcnn.py +312 -0
  454. oracq-0.1.0/src/oracq/algorithms/qml/qcnn_layer.py +436 -0
  455. oracq-0.1.0/src/oracq/algorithms/qml/qpca.py +230 -0
  456. oracq-0.1.0/src/oracq/algorithms/qml/qsdp.py +396 -0
  457. oracq-0.1.0/src/oracq/algorithms/qml/recommendation.py +244 -0
  458. oracq-0.1.0/src/oracq/algorithms/qnlss/__init__.py +1 -0
  459. oracq-0.1.0/src/oracq/algorithms/qnlss/carleman.py +277 -0
  460. oracq-0.1.0/src/oracq/algorithms/qnlss/newton.py +443 -0
  461. oracq-0.1.0/src/oracq/algorithms/qode/__init__.py +1 -0
  462. oracq-0.1.0/src/oracq/algorithms/qode/_dynamics.py +84 -0
  463. oracq-0.1.0/src/oracq/algorithms/qode/cbmd.py +187 -0
  464. oracq-0.1.0/src/oracq/algorithms/qode/lchs.py +114 -0
  465. oracq-0.1.0/src/oracq/algorithms/qode/legacy.py +94 -0
  466. oracq-0.1.0/src/oracq/algorithms/qode/ode.py +344 -0
  467. oracq-0.1.0/src/oracq/algorithms/qode/ode_models.py +72 -0
  468. oracq-0.1.0/src/oracq/algorithms/qode/schrodingerization.py +169 -0
  469. oracq-0.1.0/src/oracq/algorithms/qode/sde.py +420 -0
  470. oracq-0.1.0/src/oracq/algorithms/qpde/__init__.py +1 -0
  471. oracq-0.1.0/src/oracq/algorithms/qpde/pde.py +85 -0
  472. oracq-0.1.0/src/oracq/applications/__init__.py +3 -0
  473. oracq-0.1.0/src/oracq/applications/catalog.py +606 -0
  474. oracq-0.1.0/src/oracq/applications/flow_data.py +316 -0
  475. oracq-0.1.0/src/oracq/applications/gallery.py +191 -0
  476. oracq-0.1.0/src/oracq/applications/legacy.py +399 -0
  477. oracq-0.1.0/src/oracq/applications/oracle_study.py +68 -0
  478. oracq-0.1.0/src/oracq/applications/qfvm.py +676 -0
  479. oracq-0.1.0/src/oracq/applications/qfvm_qmem.py +352 -0
  480. oracq-0.1.0/src/oracq/applications/qham/__init__.py +108 -0
  481. oracq-0.1.0/src/oracq/applications/qham/__main__.py +58 -0
  482. oracq-0.1.0/src/oracq/applications/qham/examples.py +51 -0
  483. oracq-0.1.0/src/oracq/applications/qham/linearization.py +517 -0
  484. oracq-0.1.0/src/oracq/applications/qham/pde.py +558 -0
  485. oracq-0.1.0/src/oracq/applications/qham/reference.py +739 -0
  486. oracq-0.1.0/src/oracq/applications/qham/report.py +180 -0
  487. oracq-0.1.0/src/oracq/applications/qham/stencils.py +420 -0
  488. oracq-0.1.0/src/oracq/applications/roe.py +283 -0
  489. oracq-0.1.0/src/oracq/applications/roe_formulas.py +163 -0
  490. oracq-0.1.0/src/oracq/infrastructure/__init__.py +1 -0
  491. oracq-0.1.0/src/oracq/infrastructure/backends/__init__.py +18 -0
  492. oracq-0.1.0/src/oracq/infrastructure/backends/basis.py +194 -0
  493. oracq-0.1.0/src/oracq/infrastructure/backends/originir.py +432 -0
  494. oracq-0.1.0/src/oracq/infrastructure/backends/pysparq.py +280 -0
  495. oracq-0.1.0/src/oracq/infrastructure/backends/quantikz.py +378 -0
  496. oracq-0.1.0/src/oracq/infrastructure/backends/strict.py +155 -0
  497. oracq-0.1.0/src/oracq/infrastructure/builder.py +431 -0
  498. oracq-0.1.0/src/oracq/infrastructure/estimate.py +593 -0
  499. oracq-0.1.0/src/oracq/infrastructure/execution.py +568 -0
  500. oracq-0.1.0/src/oracq/infrastructure/ir.py +367 -0
  501. oracq-0.1.0/src/oracq/infrastructure/layout.py +36 -0
  502. oracq-0.1.0/src/oracq/infrastructure/linking.py +518 -0
  503. oracq-0.1.0/src/oracq/infrastructure/mathfunc/__init__.py +96 -0
  504. oracq-0.1.0/src/oracq/infrastructure/mathfunc/frontend.py +874 -0
  505. oracq-0.1.0/src/oracq/infrastructure/mathfunc/graph.py +362 -0
  506. oracq-0.1.0/src/oracq/infrastructure/mathfunc/lowering.py +244 -0
  507. oracq-0.1.0/src/oracq/infrastructure/mathfunc/numeric.py +776 -0
  508. oracq-0.1.0/src/oracq/infrastructure/native.py +223 -0
  509. oracq-0.1.0/src/oracq/infrastructure/qmem.py +348 -0
  510. oracq-0.1.0/src/oracq/infrastructure/qram_schema.py +182 -0
  511. oracq-0.1.0/src/oracq/infrastructure/readout.py +66 -0
  512. oracq-0.1.0/src/oracq/infrastructure/serialization.py +250 -0
  513. oracq-0.1.0/src/oracq/infrastructure/validation.py +383 -0
  514. oracq-0.1.0/src/oracq/py.typed +0 -0
  515. oracq-0.1.0/src/oracq/qham/__init__.py +3 -0
  516. oracq-0.1.0/src/oracq/qham/__main__.py +6 -0
  517. oracq-0.1.0/src/oracq.egg-info/PKG-INFO +201 -0
  518. oracq-0.1.0/src/oracq.egg-info/SOURCES.txt +612 -0
  519. oracq-0.1.0/src/oracq.egg-info/dependency_links.txt +1 -0
  520. oracq-0.1.0/src/oracq.egg-info/entry_points.txt +2 -0
  521. oracq-0.1.0/src/oracq.egg-info/requires.txt +14 -0
  522. oracq-0.1.0/src/oracq.egg-info/top_level.txt +1 -0
  523. oracq-0.1.0/tests/core/test_algorithm_expansion.py +201 -0
  524. oracq-0.1.0/tests/core/test_algorithm_protocols.py +117 -0
  525. oracq-0.1.0/tests/core/test_check_project.py +32 -0
  526. oracq-0.1.0/tests/core/test_contracts.py +233 -0
  527. oracq-0.1.0/tests/core/test_data_loading.py +146 -0
  528. oracq-0.1.0/tests/core/test_density.py +214 -0
  529. oracq-0.1.0/tests/core/test_differential.py +101 -0
  530. oracq-0.1.0/tests/core/test_dqi.py +137 -0
  531. oracq-0.1.0/tests/core/test_estimate.py +195 -0
  532. oracq-0.1.0/tests/core/test_gradient.py +147 -0
  533. oracq-0.1.0/tests/core/test_graph_walks.py +231 -0
  534. oracq-0.1.0/tests/core/test_integration.py +164 -0
  535. oracq-0.1.0/tests/core/test_language.py +369 -0
  536. oracq-0.1.0/tests/core/test_lowrank.py +228 -0
  537. oracq-0.1.0/tests/core/test_mathfunc.py +147 -0
  538. oracq-0.1.0/tests/core/test_open_ir.py +88 -0
  539. oracq-0.1.0/tests/core/test_prepare_select.py +236 -0
  540. oracq-0.1.0/tests/core/test_qcnn.py +213 -0
  541. oracq-0.1.0/tests/core/test_qdata.py +175 -0
  542. oracq-0.1.0/tests/core/test_qfvm_qmem.py +293 -0
  543. oracq-0.1.0/tests/core/test_qham_general.py +311 -0
  544. oracq-0.1.0/tests/core/test_qlss_input_models.py +224 -0
  545. oracq-0.1.0/tests/core/test_qmem.py +259 -0
  546. oracq-0.1.0/tests/core/test_qpca.py +138 -0
  547. oracq-0.1.0/tests/core/test_qram_schema.py +191 -0
  548. oracq-0.1.0/tests/core/test_qsdp.py +129 -0
  549. oracq-0.1.0/tests/core/test_qsvt.py +198 -0
  550. oracq-0.1.0/tests/core/test_quantikz.py +83 -0
  551. oracq-0.1.0/tests/core/test_recommendation.py +112 -0
  552. oracq-0.1.0/tests/core/test_repository_layout.py +61 -0
  553. oracq-0.1.0/tests/core/test_research_workflow.py +239 -0
  554. oracq-0.1.0/tests/core/test_sde.py +174 -0
  555. oracq-0.1.0/tests/core/test_spectral.py +132 -0
  556. oracq-0.1.0/tests/core/test_spectral_synthesis.py +120 -0
  557. oracq-0.1.0/tests/core/test_stage2.py +86 -0
  558. oracq-0.1.0/tests/core/test_vtaa_cks.py +281 -0
  559. oracq-0.1.0/tests/core/test_witness.py +126 -0
  560. oracq-0.1.0/tests/core/test_workloads.py +81 -0
  561. oracq-0.1.0/tests/core/witness.py +158 -0
  562. oracq-0.1.0/tests/docs/test_search.py +27 -0
  563. oracq-0.1.0/tests/docs/test_switch_links.py +76 -0
  564. oracq-0.1.0/tests/docs/test_xrefs.py +182 -0
  565. oracq-0.1.0/tests/integration/test_algorithm_contracts_native.py +31 -0
  566. oracq-0.1.0/tests/integration/test_algorithm_gallery.py +25 -0
  567. oracq-0.1.0/tests/integration/test_backends.py +185 -0
  568. oracq-0.1.0/tests/integration/test_catalog.py +37 -0
  569. oracq-0.1.0/tests/integration/test_mathfunc_native.py +99 -0
  570. oracq-0.1.0/tests/integration/test_qdata.py +115 -0
  571. oracq-0.1.0/tests/integration/test_qfvm_input_models.py +128 -0
  572. oracq-0.1.0/tests/integration/test_qham_general_native.py +106 -0
  573. oracq-0.1.0/tests/integration/test_qmem.py +84 -0
  574. oracq-0.1.0/tests/integration/test_stage2_native.py +116 -0
  575. oracq-0.1.0/tests/schema/test_math_schema.py +44 -0
  576. oracq-0.1.0/tests/schema/test_qham_schema.py +39 -0
  577. oracq-0.1.0/tests/schema/test_schema.py +126 -0
  578. oracq-0.1.0/tests/verification/harness.py +257 -0
  579. oracq-0.1.0/tests/verification/verify_arithmetic.py +359 -0
  580. oracq-0.1.0/tests/verification/verify_blockencoding.py +1466 -0
  581. oracq-0.1.0/tests/verification/verify_estimation.py +749 -0
  582. oracq-0.1.0/tests/verification/verify_fourier.py +696 -0
  583. oracq-0.1.0/tests/verification/verify_hamiltonian.py +985 -0
  584. oracq-0.1.0/tests/verification/verify_mathfunc.py +1119 -0
  585. oracq-0.1.0/tests/verification/verify_misc_algorithms.py +1073 -0
  586. oracq-0.1.0/tests/verification/verify_nt_qlss_sde.py +1467 -0
  587. oracq-0.1.0/tests/verification/verify_ode.py +1485 -0
  588. oracq-0.1.0/tests/verification/verify_oracles.py +711 -0
  589. oracq-0.1.0/tests/verification/verify_qham_qfvm.py +1349 -0
  590. oracq-0.1.0/tests/verification/verify_search_walks.py +863 -0
  591. oracq-0.1.0/tests/verification/verify_stateprep.py +936 -0
  592. oracq-0.1.0/tools/add_switchers.py +45 -0
  593. oracq-0.1.0/tools/build_catalog.py +97 -0
  594. oracq-0.1.0/tools/build_docs.py +80 -0
  595. oracq-0.1.0/tools/build_general_qham.py +162 -0
  596. oracq-0.1.0/tools/build_math_functions.py +89 -0
  597. oracq-0.1.0/tools/build_qlss_comparison.py +82 -0
  598. oracq-0.1.0/tools/build_qram_queries.py +68 -0
  599. oracq-0.1.0/tools/build_resource_estimates.py +286 -0
  600. oracq-0.1.0/tools/build_stage2.py +222 -0
  601. oracq-0.1.0/tools/check_project.py +150 -0
  602. oracq-0.1.0/tools/expressiveness/t1_qsp_phases.py +75 -0
  603. oracq-0.1.0/tools/expressiveness/t2_qsvt_inversion.py +87 -0
  604. oracq-0.1.0/tools/expressiveness/t3_hhl.py +126 -0
  605. oracq-0.1.0/tools/expressiveness/t4_lchs.py +107 -0
  606. oracq-0.1.0/tools/expressiveness/t5_schrodingerization_heat.py +87 -0
  607. oracq-0.1.0/tools/expressiveness/t6_qsp_advection.py +123 -0
  608. oracq-0.1.0/tools/generate_api_docs.py +354 -0
  609. oracq-0.1.0/tools/run_verification.py +39 -0
  610. oracq-0.1.0/tools/update_coverage.py +152 -0
  611. oracq-0.1.0/tools/update_workboard.py +111 -0
  612. oracq-0.1.0/tools/verify_math_functions.py +58 -0
  613. oracq-0.1.0/tools/verify_stage2_backend.py +68 -0
  614. oracq-0.1.0/uv.lock +1213 -0
oracq-0.1.0/AGENTS.md ADDED
@@ -0,0 +1,13 @@
1
+ # oracq Development Conventions
2
+
3
+ This repository is a standalone Python package. All work happens here; do not modify the neighboring UnifiedQuantum, QRAM-Simulator, or QECC.Lang projects for compatibility testing.
4
+
5
+ RIR is the architectural center. When changing the IR, update docs/reference/rir.md, the JSON Schema, the serializers, and the semantic tests in lockstep. Register names, bit widths, and views must survive until backend lowering. Module calls and Repeat structures must not be unconditionally expanded during generation or text serialization.
6
+
7
+ The core does not depend on quantum backends. Backend export and execution are separated; native dependencies are imported only at execution entry points. Code identifiers, comments, docstrings, and user-facing strings (exception messages, CLI help, printed output) are written in English. Documentation is English-first with a maintained Chinese mirror under docs/zh/. Commit messages are written in English.
8
+
9
+ The core validation command is `python -m unittest discover -s tests/core -v`. Real-backend validation runs tests/integration with an interpreter that has uniqc and pysparq installed; never substitute mocks or skips for a real cross-check. Static checks use `ruff check src tests examples`; type checking uses `mypy src examples`.
10
+
11
+ Do not commit virtual environments, caches, build artifacts, or simulated output. Do not run git commit or push without an explicit request.
12
+
13
+ The source tree is layered into infrastructure, algorithms, and applications. New algorithms go into the matching category file, not into legacy import-compatibility layers. Documentation uses Sphinx with manual, tutorials, reference, and api sections per language tree; historical material lives in archive. Documentation changes run both the HTML and doctest builders, and warnings are treated as errors.
@@ -0,0 +1,39 @@
1
+ # Contributing
2
+
3
+ **English** · [简体中文](CONTRIBUTING.zh-CN.md)
4
+
5
+ Install the development and documentation environments with
6
+ `uv sync --locked --extra dev --extra docs`. Write code identifiers, comments,
7
+ and user-facing strings in English; documentation is English-first with a
8
+ Chinese mirror under `docs/zh/`.
9
+
10
+ - Infrastructure lives in `src/oracq/infrastructure/`.
11
+ - Quantum algorithms live in the matching category files under `src/oracq/algorithms/`.
12
+ - Domain models, data preparation, and application-level composition live in `src/oracq/applications/`.
13
+ - Documentation uses Sphinx; full manuals and tutorials are separate, and API pages are generated from source. Historical records go into `docs/archive/`.
14
+
15
+ Run the core, case, typing, and documentation checks (including `ruff`,
16
+ `mypy src examples`, and the Sphinx builds):
17
+
18
+ ```bash
19
+ uv run python tools/check_project.py --docs
20
+ ```
21
+
22
+ Full native acceptance requires a real-backend interpreter:
23
+
24
+ ```bash
25
+ PATH="$PWD/out/toolchain:$PATH" uv run python tools/check_project.py --docs \
26
+ --backend-python ../QECC.Lang/.venv/bin/python
27
+ ```
28
+
29
+ Changing RIR requires updating the specification, the JSON Schema, the
30
+ serializers, and the semantic tests in lockstep. Python protocols owned by an
31
+ algorithm do not require RIR changes. See
32
+ [development and acceptance](docs/development/contributing.md) and
33
+ [writing documentation](docs/development/writing-docs.md) for details.
34
+
35
+ Generated output goes into the ignored `out/` directory. Do not commit or push
36
+ without explicit authorization; commits follow Conventional Commits in English,
37
+ and virtual environments, run data, or binaries are never committed. GitHub is
38
+ the primary publishing remote; day-to-day development is synced to the Gitea
39
+ intermediate remote.
@@ -0,0 +1,27 @@
1
+ # 参与开发
2
+
3
+ [English](CONTRIBUTING.md) · **简体中文**
4
+
5
+ 使用 `uv sync --locked --extra dev --extra docs` 安装开发与文档环境。代码标识符、注释与用户可见文本使用英文;文档以英文为主,中文镜像位于 `docs/zh/`。
6
+
7
+ - 基础设施放在 `src/oracq/infrastructure/`。
8
+ - 量子算法放在 `src/oracq/algorithms/` 的相应类别文件。
9
+ - 领域模型、数据准备和应用级组合放在 `src/oracq/applications/`。
10
+ - 文档使用 Sphinx;完整文档与教程分开,API 从源码生成。历史记录放入 `docs/archive/`。
11
+
12
+ 运行核心、案例、类型与文档检查(含 `ruff`、`mypy src examples` 与 Sphinx 构建):
13
+
14
+ ```bash
15
+ uv run python tools/check_project.py --docs
16
+ ```
17
+
18
+ 完整原生验收需要真实后端解释器:
19
+
20
+ ```bash
21
+ PATH="$PWD/out/toolchain:$PATH" uv run python tools/check_project.py --docs \
22
+ --backend-python ../QECC.Lang/.venv/bin/python
23
+ ```
24
+
25
+ 修改 RIR 必须同步规范、Schema、序列化和语义测试。算法自己的 Python 协议不需要修改 RIR。详情见[开发与验收](docs/zh/development/contributing.md)和[文档写作](docs/zh/development/writing-docs.md)。
26
+
27
+ 生成结果写入被忽略的 `out/`。没有明确授权不 commit/push;提交采用 Conventional Commits(英文),不提交虚拟环境、运行数据或二进制。主力发布远端为 GitHub,日常开发同步到 Gitea 中间远端。
oracq-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 oracq contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ include README.md README.zh-CN.md LICENSE AGENTS.md CONTRIBUTING.md CONTRIBUTING.zh-CN.md SECURITY.md backend-revisions.json uv.lock
2
+ recursive-include docs *.md *.json *.rst *.py *.css
3
+ recursive-include examples *.py *.json *.yaml *.originir
4
+ recursive-include tests *.py
5
+ recursive-include tools *.py
6
+ include src/oracq/py.typed
oracq-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: oracq
3
+ Version: 0.1.0
4
+ Summary: Python quantum generators with a modular register-level IR
5
+ Author-email: agony <chenzhaoyun@iai.ustc.edu.cn>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/IAI-USTC-Quantum/oracq
8
+ Project-URL: Repository, https://github.com/IAI-USTC-Quantum/oracq
9
+ Project-URL: Issues, https://github.com/IAI-USTC-Quantum/oracq/issues
10
+ Project-URL: Documentation, https://iai-ustc-quantum.github.io/oracq/
11
+ Keywords: quantum,quantum-computing,quantum-algorithms,resource-estimation,compiler,ir
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Physics
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: pyyaml>=6.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8; extra == "dev"
27
+ Requires-Dist: ruff>=0.9; extra == "dev"
28
+ Requires-Dist: jsonschema>=4.23; extra == "dev"
29
+ Requires-Dist: mypy>=1.14; extra == "dev"
30
+ Requires-Dist: types-PyYAML>=6; extra == "dev"
31
+ Provides-Extra: docs
32
+ Requires-Dist: sphinx<10,>=8; extra == "docs"
33
+ Requires-Dist: myst-parser<6,>=4; extra == "docs"
34
+ Requires-Dist: furo>=2024.8.6; extra == "docs"
35
+ Requires-Dist: sphinxcontrib-mermaid<3,>=1; extra == "docs"
36
+ Dynamic: license-file
37
+
38
+ # oracq
39
+
40
+ **English** · [简体中文](README.zh-CN.md)
41
+
42
+ [![CI](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/python-ci.yml/badge.svg)](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/python-ci.yml)
43
+ [![Docs](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/docs.yml/badge.svg)](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/docs.yml)
44
+ [![PyPI](https://img.shields.io/pypi/v/oracq.svg)](https://pypi.org/project/oracq/)
45
+ [![Python](https://img.shields.io/pypi/pyversions/oracq.svg)](https://pypi.org/project/oracq/)
46
+ [![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](LICENSE)
47
+
48
+ oracq is a scientific-computing algorithm implementation framework for quantum
49
+ algorithm researchers. Composable algorithms are written in Python against
50
+ access models and compiled to a register-level intermediate representation
51
+ (RIR) that preserves module structure; oracle placeholders stay unimplemented
52
+ until you compare gate-network, QRAM, and reversible-arithmetic candidates,
53
+ bind them, and proceed to numerical validation and resource analysis.
54
+
55
+ The current package version is **0.1.0** and the RIR format is **0.1**
56
+ ([full specification](docs/reference/rir.md)). Algorithms declare inputs and
57
+ outputs through plain Python protocols; no language-level type-system
58
+ extension is required.
59
+
60
+ ## Core concepts at a glance
61
+
62
+ | Concept | One-liner | Manual / spec | API reference |
63
+ |---|---|---|---|
64
+ | RIR | Register-level IR; module calls and Repeat structures survive to the text form | [RIR 0.1 spec](docs/reference/rir.md) | [ir](docs/api/infrastructure/ir.rst) |
65
+ | Builder | `Builder`/`Operation` three-stage generation of modules and programs | [Core concepts](docs/manual/concepts.md#modules-and-oracle-placeholders) | [builder](docs/api/infrastructure/builder.rst) |
66
+ | Registers and views | bits/uint/qubit interpretations, slicing, reinterpretation; index 0 is the least significant bit | [Core concepts](docs/manual/concepts.md#registers-and-views) | [ir](docs/api/infrastructure/ir.rst) |
67
+ | Open oracles and binding | Declare first, bind later: capability conjunction, candidate comparison, QRAM capture | [Binding tutorial](docs/tutorials/oracle-binding.md) | [linking](docs/api/infrastructure/linking.rst) |
68
+ | Algorithm contracts | Checkable input protocols, capability specifications, and acceptance reports | [Contracts](docs/manual/contracts.md) | [contracts](docs/api/algorithms/input_model/contracts.rst) |
69
+ | Structural validation | Generation-time checks of bit widths, overlaps, and structural constraints | [Core concepts](docs/manual/concepts.md) | [validation](docs/api/infrastructure/validation.rst) |
70
+ | Serialization | RIR defaults to YAML with optional JSON; both text forms agree field by field | [RIR spec](docs/reference/rir.md) | [serialization](docs/api/infrastructure/serialization.rst) |
71
+ | Execution and readout | Register reference executor and host readout | [Backends](docs/manual/backends.md) | [execution](docs/api/infrastructure/execution.rst), [readout](docs/api/infrastructure/readout.rst) |
72
+ | QMem | Pointer-style reads/writes and multidimensional views over QRAM resources | [QMem](docs/manual/qmem.md) | [qmem](docs/api/infrastructure/qmem.rst) |
73
+ | QRAM data files | Loading and writing `*.qram.yaml` memory definitions | [QRAM memory](docs/reference/qram-memory.md) | [qram_schema](docs/api/infrastructure/qram_schema.rst) |
74
+ | Math-function frontend | Python callables compiled into reversible circuits | [Math functions](docs/manual/math-functions.md) | [mathfunc](docs/api/infrastructure/mathfunc.rst) |
75
+ | Resource estimation | Counting models and open analysis for T gates / rotations / QRAM accesses | [Resource estimation](docs/manual/resource-estimation.md) | [estimate](docs/api/infrastructure/estimate.rst) |
76
+ | Backend export | OriginIR-ext, strict netlist, PySparQ, quantikz | [Backends](docs/manual/backends.md) | [backends](docs/api/infrastructure/backends/originir.rst) |
77
+
78
+ ## A minimal program
79
+
80
+ ```python
81
+ from oracq import Bits, Builder, export_originir, simulate
82
+
83
+ b = Builder("bell_pair", {"pair": Bits(2)})
84
+ b.h(b["pair"][0])
85
+ b.xor(b["pair"][0], b["pair"][1])
86
+ program = b.finish().program()
87
+
88
+ print(simulate(program).amplitudes)
89
+ print(export_originir(program).text)
90
+ ```
91
+
92
+ The result has equal amplitudes on `00` and `11`. Module calls and Repeat
93
+ structures are preserved in RIR and in the YAML/JSON text forms; they are not
94
+ expanded during generation.
95
+
96
+ APIs used in this example: [`Builder`](docs/api/infrastructure/builder.rst) ·
97
+ [`Bits`](docs/api/infrastructure/ir.rst) ·
98
+ [`simulate`](docs/api/infrastructure/execution.rst) ·
99
+ [`export_originir`](docs/api/infrastructure/backends/originir.rst).
100
+ For a step-by-step walkthrough see the
101
+ [first register program](docs/tutorials/first-program.md) tutorial.
102
+
103
+ ## Typical workflow
104
+
105
+ | Step | Entry point | Further reading |
106
+ |---|---|---|
107
+ | 1. Declare open oracles | [`declare`](docs/api/algorithms/input_model/oracles.rst), capabilities and specs | [Algorithm contracts](docs/manual/contracts.md) |
108
+ | 2. Build the program | [`Builder`](docs/api/infrastructure/builder.rst) composing module calls | [Tutorial: first program](docs/tutorials/first-program.md) |
109
+ | 3. Validate structure | [`validate`](docs/api/infrastructure/validation.rst) | [Core concepts](docs/manual/concepts.md) |
110
+ | 4. Bind implementations | [`bind`](docs/api/infrastructure/linking.rst); `bind_with_report` compares candidates | [Tutorial: replacing oracles](docs/tutorials/oracle-binding.md), [algorithm-research tutorial](docs/tutorials/algorithm-research.md) |
111
+ | 5. Export / execute / estimate | [`export_originir`](docs/api/infrastructure/backends/originir.rst), [`simulate`](docs/api/infrastructure/execution.rst), [`estimate_resources`](docs/api/infrastructure/estimate.rst) | [Backends](docs/manual/backends.md), [resource estimation](docs/manual/resource-estimation.md) |
112
+
113
+ ## Algorithm library
114
+
115
+ The algorithm library is organized into ten subpackages by purpose; the
116
+ complete catalog with selection guidance is the
117
+ [algorithm index](docs/manual/algorithms/index.md), with one manual page per
118
+ algorithm (interface, implementation notes, validation approach, and known
119
+ gaps). Representatives per category:
120
+
121
+ | Category | Representative algorithm pages |
122
+ |---|---|
123
+ | Query and search | [Grover search](docs/manual/algorithms/grover.md), [amplitude estimation](docs/manual/algorithms/qae.md), [quantum counting](docs/manual/algorithms/quantum-counting.md) |
124
+ | Basic query algorithms | [Deutsch–Jozsa](docs/manual/algorithms/deutsch-jozsa.md), [Simon](docs/manual/algorithms/simon.md), [Bernstein–Vazirani](docs/manual/algorithms/bernstein-vazirani.md) |
125
+ | Fourier and arithmetic | [QFT](docs/manual/algorithms/qft.md), [Fourier addition](docs/manual/algorithms/fourier-addition.md), [order finding](docs/manual/algorithms/order-finding.md) |
126
+ | Hamiltonian evolution | [Trotter](docs/manual/algorithms/trotter.md), [QSP phase synthesis](docs/manual/algorithms/qsp-phase-synthesis.md), [QSVT HamSim](docs/manual/algorithms/qsvt-hamiltonian-simulation.md) |
127
+ | Estimation and testing | [QPE](docs/manual/algorithms/qpe.md), [Hadamard test](docs/manual/algorithms/hadamard-test.md), [Swap test](docs/manual/algorithms/swap-test.md) |
128
+ | Quantum linear systems | [Costa walk](docs/manual/algorithms/costa-walk.md), [CKS](docs/manual/algorithms/cks.md), [VTAA-CKS](docs/manual/algorithms/vtaa-cks.md) |
129
+ | QODE / QPDE | [Schrödingerization](docs/manual/algorithms/schrodingerization.md), [LCHS](docs/manual/algorithms/lchs.md), [Carleman](docs/manual/algorithms/carleman.md) |
130
+ | Variational and optimization | [VQE](docs/manual/algorithms/vqe.md), [QAOA MaxCut](docs/manual/algorithms/qaoa-maxcut.md), [DQI](docs/manual/algorithms/dqi.md) |
131
+ | Quantum walks | [coined walk](docs/manual/algorithms/coined-cycle-walk.md), [Szegedy](docs/manual/algorithms/szegedy-walk.md), [MNRS](docs/manual/algorithms/mnrs-search.md) |
132
+ | Quantum machine learning | [QPCA](docs/manual/algorithms/qpca.md), [QCNN](docs/manual/algorithms/qcnn.md), KP recommendation ([API](docs/api/algorithms/qml/recommendation.rst); manual page pending) |
133
+ | Data loading and input models | [state preparation](docs/manual/algorithms/state-preparation.md), [XOR database](docs/manual/algorithms/xor-database.md), [Select-Swap QROM](docs/manual/algorithms/select-swap.md) |
134
+ | Quantum error correction | [repetition codes](docs/manual/algorithms/repetition-codes.md) |
135
+
136
+ ## Input models and operators
137
+
138
+ Algorithms consume inputs through five composable access-model families:
139
+
140
+ - Operator wrappers and basic composition (`identity`/`product`/`scale`/LCU): [manual](docs/manual/operators.md), [API](docs/api/algorithms/input_model/operators.rst); block-encoding algebra in [block_encoding](docs/api/algorithms/input_model/block_encoding.rst).
141
+ - Oracle paradigms (XorDatabase, StatePreparation, StateOracle, SparseAccess): [API](docs/api/algorithms/input_model/oracles.rst).
142
+ - Quantum data structures QVector/QMatrix: [manual](docs/manual/qdata.md), [API](docs/api/algorithms/input_model/qdata.rst).
143
+ - Density matrices and Gibbs states, spectral and low-rank decompositions: [density](docs/api/algorithms/input_model/density.rst), [spectral](docs/api/algorithms/input_model/spectral.rst), [lowrank](docs/api/algorithms/input_model/lowrank.rst).
144
+
145
+ ## Applications
146
+
147
+ - **QFVM** (quantum fluid solving): [manual](docs/manual/qfvm.md), [API](docs/api/applications/qfvm.rst), input-model review [spec](docs/reference/qfvm-input-models.md).
148
+ - **QHAM** (PDE → HAM → QHAM pipeline): [manual](docs/manual/qham.md), [derivation spec](docs/reference/qham-derivation.md), [API](docs/api/applications/qham/linearization.rst), [tutorial](docs/tutorials/qham.md).
149
+ - **Roe matrix elements**: [roe](docs/api/applications/roe.rst), [roe_formulas](docs/api/applications/roe_formulas.rst).
150
+ - **Case catalog**: 22 reference workloads ([catalog](docs/api/applications/catalog.rst)) and the gallery generator ([gallery](docs/api/applications/gallery.rst), [tutorial](docs/tutorials/gallery.md)).
151
+
152
+ ## Documentation map
153
+
154
+ Pick a reading path by role:
155
+
156
+ - **Getting started**: [first program](docs/tutorials/first-program.md) → [core concepts](docs/manual/concepts.md) → [replacing oracles](docs/tutorials/oracle-binding.md).
157
+ - **Algorithm research**: [algorithm-research tutorial](docs/tutorials/algorithm-research.md) → [algorithm index](docs/manual/algorithms/index.md) → [validation coverage matrix](docs/development/validation-coverage.md); applicability boundaries in [validation and scope](docs/manual/limits.md).
158
+ - **Differential-equation applications**: [tutorial](docs/tutorials/differential-equations.md) → [manual](docs/manual/differential-equations.md) → [QHAM manual](docs/manual/qham.md).
159
+ - **Backend engineering**: [backend manual](docs/manual/backends.md) → [compatibility review](docs/reference/backend-compatibility.md) → [infrastructure API](docs/api/infrastructure/index.rst).
160
+ - **Language and specs**: [RIR spec](docs/reference/rir.md), [generation-layer boundary](docs/reference/language.md), [open IR](docs/reference/open-ir.md), [QRAM memory format](docs/reference/qram-memory.md), [math IR](docs/reference/math-ir.md).
161
+
162
+ ## Install · build · check
163
+
164
+ ```bash
165
+ uv sync --locked --extra dev --extra docs
166
+ uv run python tools/build_docs.py --lang all
167
+ ```
168
+
169
+ This builds both language trees (warnings are errors): English to
170
+ `out/docs/en/html` and Chinese to `out/docs/zh/html`, plus doctest runs. Open
171
+ `out/docs/en/html/index.html` to browse the generated site. Algorithm
172
+ gallery and engineering checks:
173
+
174
+ ```bash
175
+ uv run python examples/algorithm_gallery.py
176
+ uv run python tools/check_project.py --docs
177
+ ```
178
+
179
+ The algorithm gallery generates RIR, OriginIR-ext, and readout notes for 22
180
+ small examples. The full native check requires a separate environment with
181
+ `pysparq` and `uniqc` installed:
182
+
183
+ ```bash
184
+ PYTHONPATH=src /path/to/backend/python examples/algorithm_gallery.py --native
185
+ ```
186
+
187
+ The language core depends only on PyYAML for text serialization. Optional
188
+ backends are imported at their execution entry points; generated artifacts,
189
+ environments, and build files are never committed. See
190
+ [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow and the
191
+ [documentation style guide](docs/development/writing-docs.md); source-tree
192
+ classification and migration notes are in [architecture](docs/manual/architecture.md)
193
+ and [import paths](docs/manual/compatibility.md). Documentation is also
194
+ maintained in Chinese: see [README.zh-CN.md](README.zh-CN.md).
195
+
196
+ Advanced algorithms such as QLS/QODE/QHAM still have pending verification
197
+ items on numerical accuracy, success channels, or convergence (per-item status
198
+ in the [validation coverage matrix](docs/development/validation-coverage.md)).
199
+ A general-purpose QSP-HamSim kernel is still to be provided; the current
200
+ modular multiplication uses finite-size permutation synthesis, and classical
201
+ optimizers for VQE/QAOA are chosen by the application.
oracq-0.1.0/README.md ADDED
@@ -0,0 +1,164 @@
1
+ # oracq
2
+
3
+ **English** · [简体中文](README.zh-CN.md)
4
+
5
+ [![CI](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/python-ci.yml/badge.svg)](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/python-ci.yml)
6
+ [![Docs](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/docs.yml/badge.svg)](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/docs.yml)
7
+ [![PyPI](https://img.shields.io/pypi/v/oracq.svg)](https://pypi.org/project/oracq/)
8
+ [![Python](https://img.shields.io/pypi/pyversions/oracq.svg)](https://pypi.org/project/oracq/)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](LICENSE)
10
+
11
+ oracq is a scientific-computing algorithm implementation framework for quantum
12
+ algorithm researchers. Composable algorithms are written in Python against
13
+ access models and compiled to a register-level intermediate representation
14
+ (RIR) that preserves module structure; oracle placeholders stay unimplemented
15
+ until you compare gate-network, QRAM, and reversible-arithmetic candidates,
16
+ bind them, and proceed to numerical validation and resource analysis.
17
+
18
+ The current package version is **0.1.0** and the RIR format is **0.1**
19
+ ([full specification](docs/reference/rir.md)). Algorithms declare inputs and
20
+ outputs through plain Python protocols; no language-level type-system
21
+ extension is required.
22
+
23
+ ## Core concepts at a glance
24
+
25
+ | Concept | One-liner | Manual / spec | API reference |
26
+ |---|---|---|---|
27
+ | RIR | Register-level IR; module calls and Repeat structures survive to the text form | [RIR 0.1 spec](docs/reference/rir.md) | [ir](docs/api/infrastructure/ir.rst) |
28
+ | Builder | `Builder`/`Operation` three-stage generation of modules and programs | [Core concepts](docs/manual/concepts.md#modules-and-oracle-placeholders) | [builder](docs/api/infrastructure/builder.rst) |
29
+ | Registers and views | bits/uint/qubit interpretations, slicing, reinterpretation; index 0 is the least significant bit | [Core concepts](docs/manual/concepts.md#registers-and-views) | [ir](docs/api/infrastructure/ir.rst) |
30
+ | Open oracles and binding | Declare first, bind later: capability conjunction, candidate comparison, QRAM capture | [Binding tutorial](docs/tutorials/oracle-binding.md) | [linking](docs/api/infrastructure/linking.rst) |
31
+ | Algorithm contracts | Checkable input protocols, capability specifications, and acceptance reports | [Contracts](docs/manual/contracts.md) | [contracts](docs/api/algorithms/input_model/contracts.rst) |
32
+ | Structural validation | Generation-time checks of bit widths, overlaps, and structural constraints | [Core concepts](docs/manual/concepts.md) | [validation](docs/api/infrastructure/validation.rst) |
33
+ | Serialization | RIR defaults to YAML with optional JSON; both text forms agree field by field | [RIR spec](docs/reference/rir.md) | [serialization](docs/api/infrastructure/serialization.rst) |
34
+ | Execution and readout | Register reference executor and host readout | [Backends](docs/manual/backends.md) | [execution](docs/api/infrastructure/execution.rst), [readout](docs/api/infrastructure/readout.rst) |
35
+ | QMem | Pointer-style reads/writes and multidimensional views over QRAM resources | [QMem](docs/manual/qmem.md) | [qmem](docs/api/infrastructure/qmem.rst) |
36
+ | QRAM data files | Loading and writing `*.qram.yaml` memory definitions | [QRAM memory](docs/reference/qram-memory.md) | [qram_schema](docs/api/infrastructure/qram_schema.rst) |
37
+ | Math-function frontend | Python callables compiled into reversible circuits | [Math functions](docs/manual/math-functions.md) | [mathfunc](docs/api/infrastructure/mathfunc.rst) |
38
+ | Resource estimation | Counting models and open analysis for T gates / rotations / QRAM accesses | [Resource estimation](docs/manual/resource-estimation.md) | [estimate](docs/api/infrastructure/estimate.rst) |
39
+ | Backend export | OriginIR-ext, strict netlist, PySparQ, quantikz | [Backends](docs/manual/backends.md) | [backends](docs/api/infrastructure/backends/originir.rst) |
40
+
41
+ ## A minimal program
42
+
43
+ ```python
44
+ from oracq import Bits, Builder, export_originir, simulate
45
+
46
+ b = Builder("bell_pair", {"pair": Bits(2)})
47
+ b.h(b["pair"][0])
48
+ b.xor(b["pair"][0], b["pair"][1])
49
+ program = b.finish().program()
50
+
51
+ print(simulate(program).amplitudes)
52
+ print(export_originir(program).text)
53
+ ```
54
+
55
+ The result has equal amplitudes on `00` and `11`. Module calls and Repeat
56
+ structures are preserved in RIR and in the YAML/JSON text forms; they are not
57
+ expanded during generation.
58
+
59
+ APIs used in this example: [`Builder`](docs/api/infrastructure/builder.rst) ·
60
+ [`Bits`](docs/api/infrastructure/ir.rst) ·
61
+ [`simulate`](docs/api/infrastructure/execution.rst) ·
62
+ [`export_originir`](docs/api/infrastructure/backends/originir.rst).
63
+ For a step-by-step walkthrough see the
64
+ [first register program](docs/tutorials/first-program.md) tutorial.
65
+
66
+ ## Typical workflow
67
+
68
+ | Step | Entry point | Further reading |
69
+ |---|---|---|
70
+ | 1. Declare open oracles | [`declare`](docs/api/algorithms/input_model/oracles.rst), capabilities and specs | [Algorithm contracts](docs/manual/contracts.md) |
71
+ | 2. Build the program | [`Builder`](docs/api/infrastructure/builder.rst) composing module calls | [Tutorial: first program](docs/tutorials/first-program.md) |
72
+ | 3. Validate structure | [`validate`](docs/api/infrastructure/validation.rst) | [Core concepts](docs/manual/concepts.md) |
73
+ | 4. Bind implementations | [`bind`](docs/api/infrastructure/linking.rst); `bind_with_report` compares candidates | [Tutorial: replacing oracles](docs/tutorials/oracle-binding.md), [algorithm-research tutorial](docs/tutorials/algorithm-research.md) |
74
+ | 5. Export / execute / estimate | [`export_originir`](docs/api/infrastructure/backends/originir.rst), [`simulate`](docs/api/infrastructure/execution.rst), [`estimate_resources`](docs/api/infrastructure/estimate.rst) | [Backends](docs/manual/backends.md), [resource estimation](docs/manual/resource-estimation.md) |
75
+
76
+ ## Algorithm library
77
+
78
+ The algorithm library is organized into ten subpackages by purpose; the
79
+ complete catalog with selection guidance is the
80
+ [algorithm index](docs/manual/algorithms/index.md), with one manual page per
81
+ algorithm (interface, implementation notes, validation approach, and known
82
+ gaps). Representatives per category:
83
+
84
+ | Category | Representative algorithm pages |
85
+ |---|---|
86
+ | Query and search | [Grover search](docs/manual/algorithms/grover.md), [amplitude estimation](docs/manual/algorithms/qae.md), [quantum counting](docs/manual/algorithms/quantum-counting.md) |
87
+ | Basic query algorithms | [Deutsch–Jozsa](docs/manual/algorithms/deutsch-jozsa.md), [Simon](docs/manual/algorithms/simon.md), [Bernstein–Vazirani](docs/manual/algorithms/bernstein-vazirani.md) |
88
+ | Fourier and arithmetic | [QFT](docs/manual/algorithms/qft.md), [Fourier addition](docs/manual/algorithms/fourier-addition.md), [order finding](docs/manual/algorithms/order-finding.md) |
89
+ | Hamiltonian evolution | [Trotter](docs/manual/algorithms/trotter.md), [QSP phase synthesis](docs/manual/algorithms/qsp-phase-synthesis.md), [QSVT HamSim](docs/manual/algorithms/qsvt-hamiltonian-simulation.md) |
90
+ | Estimation and testing | [QPE](docs/manual/algorithms/qpe.md), [Hadamard test](docs/manual/algorithms/hadamard-test.md), [Swap test](docs/manual/algorithms/swap-test.md) |
91
+ | Quantum linear systems | [Costa walk](docs/manual/algorithms/costa-walk.md), [CKS](docs/manual/algorithms/cks.md), [VTAA-CKS](docs/manual/algorithms/vtaa-cks.md) |
92
+ | QODE / QPDE | [Schrödingerization](docs/manual/algorithms/schrodingerization.md), [LCHS](docs/manual/algorithms/lchs.md), [Carleman](docs/manual/algorithms/carleman.md) |
93
+ | Variational and optimization | [VQE](docs/manual/algorithms/vqe.md), [QAOA MaxCut](docs/manual/algorithms/qaoa-maxcut.md), [DQI](docs/manual/algorithms/dqi.md) |
94
+ | Quantum walks | [coined walk](docs/manual/algorithms/coined-cycle-walk.md), [Szegedy](docs/manual/algorithms/szegedy-walk.md), [MNRS](docs/manual/algorithms/mnrs-search.md) |
95
+ | Quantum machine learning | [QPCA](docs/manual/algorithms/qpca.md), [QCNN](docs/manual/algorithms/qcnn.md), KP recommendation ([API](docs/api/algorithms/qml/recommendation.rst); manual page pending) |
96
+ | Data loading and input models | [state preparation](docs/manual/algorithms/state-preparation.md), [XOR database](docs/manual/algorithms/xor-database.md), [Select-Swap QROM](docs/manual/algorithms/select-swap.md) |
97
+ | Quantum error correction | [repetition codes](docs/manual/algorithms/repetition-codes.md) |
98
+
99
+ ## Input models and operators
100
+
101
+ Algorithms consume inputs through five composable access-model families:
102
+
103
+ - Operator wrappers and basic composition (`identity`/`product`/`scale`/LCU): [manual](docs/manual/operators.md), [API](docs/api/algorithms/input_model/operators.rst); block-encoding algebra in [block_encoding](docs/api/algorithms/input_model/block_encoding.rst).
104
+ - Oracle paradigms (XorDatabase, StatePreparation, StateOracle, SparseAccess): [API](docs/api/algorithms/input_model/oracles.rst).
105
+ - Quantum data structures QVector/QMatrix: [manual](docs/manual/qdata.md), [API](docs/api/algorithms/input_model/qdata.rst).
106
+ - Density matrices and Gibbs states, spectral and low-rank decompositions: [density](docs/api/algorithms/input_model/density.rst), [spectral](docs/api/algorithms/input_model/spectral.rst), [lowrank](docs/api/algorithms/input_model/lowrank.rst).
107
+
108
+ ## Applications
109
+
110
+ - **QFVM** (quantum fluid solving): [manual](docs/manual/qfvm.md), [API](docs/api/applications/qfvm.rst), input-model review [spec](docs/reference/qfvm-input-models.md).
111
+ - **QHAM** (PDE → HAM → QHAM pipeline): [manual](docs/manual/qham.md), [derivation spec](docs/reference/qham-derivation.md), [API](docs/api/applications/qham/linearization.rst), [tutorial](docs/tutorials/qham.md).
112
+ - **Roe matrix elements**: [roe](docs/api/applications/roe.rst), [roe_formulas](docs/api/applications/roe_formulas.rst).
113
+ - **Case catalog**: 22 reference workloads ([catalog](docs/api/applications/catalog.rst)) and the gallery generator ([gallery](docs/api/applications/gallery.rst), [tutorial](docs/tutorials/gallery.md)).
114
+
115
+ ## Documentation map
116
+
117
+ Pick a reading path by role:
118
+
119
+ - **Getting started**: [first program](docs/tutorials/first-program.md) → [core concepts](docs/manual/concepts.md) → [replacing oracles](docs/tutorials/oracle-binding.md).
120
+ - **Algorithm research**: [algorithm-research tutorial](docs/tutorials/algorithm-research.md) → [algorithm index](docs/manual/algorithms/index.md) → [validation coverage matrix](docs/development/validation-coverage.md); applicability boundaries in [validation and scope](docs/manual/limits.md).
121
+ - **Differential-equation applications**: [tutorial](docs/tutorials/differential-equations.md) → [manual](docs/manual/differential-equations.md) → [QHAM manual](docs/manual/qham.md).
122
+ - **Backend engineering**: [backend manual](docs/manual/backends.md) → [compatibility review](docs/reference/backend-compatibility.md) → [infrastructure API](docs/api/infrastructure/index.rst).
123
+ - **Language and specs**: [RIR spec](docs/reference/rir.md), [generation-layer boundary](docs/reference/language.md), [open IR](docs/reference/open-ir.md), [QRAM memory format](docs/reference/qram-memory.md), [math IR](docs/reference/math-ir.md).
124
+
125
+ ## Install · build · check
126
+
127
+ ```bash
128
+ uv sync --locked --extra dev --extra docs
129
+ uv run python tools/build_docs.py --lang all
130
+ ```
131
+
132
+ This builds both language trees (warnings are errors): English to
133
+ `out/docs/en/html` and Chinese to `out/docs/zh/html`, plus doctest runs. Open
134
+ `out/docs/en/html/index.html` to browse the generated site. Algorithm
135
+ gallery and engineering checks:
136
+
137
+ ```bash
138
+ uv run python examples/algorithm_gallery.py
139
+ uv run python tools/check_project.py --docs
140
+ ```
141
+
142
+ The algorithm gallery generates RIR, OriginIR-ext, and readout notes for 22
143
+ small examples. The full native check requires a separate environment with
144
+ `pysparq` and `uniqc` installed:
145
+
146
+ ```bash
147
+ PYTHONPATH=src /path/to/backend/python examples/algorithm_gallery.py --native
148
+ ```
149
+
150
+ The language core depends only on PyYAML for text serialization. Optional
151
+ backends are imported at their execution entry points; generated artifacts,
152
+ environments, and build files are never committed. See
153
+ [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow and the
154
+ [documentation style guide](docs/development/writing-docs.md); source-tree
155
+ classification and migration notes are in [architecture](docs/manual/architecture.md)
156
+ and [import paths](docs/manual/compatibility.md). Documentation is also
157
+ maintained in Chinese: see [README.zh-CN.md](README.zh-CN.md).
158
+
159
+ Advanced algorithms such as QLS/QODE/QHAM still have pending verification
160
+ items on numerical accuracy, success channels, or convergence (per-item status
161
+ in the [validation coverage matrix](docs/development/validation-coverage.md)).
162
+ A general-purpose QSP-HamSim kernel is still to be provided; the current
163
+ modular multiplication uses finite-size permutation synthesis, and classical
164
+ optimizers for VQE/QAOA are chosen by the application.
@@ -0,0 +1,128 @@
1
+ # oracq
2
+
3
+ [English](README.md) · **简体中文**
4
+
5
+ [![CI](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/python-ci.yml/badge.svg)](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/python-ci.yml)
6
+ [![Docs](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/docs.yml/badge.svg)](https://github.com/IAI-USTC-Quantum/oracq/actions/workflows/docs.yml)
7
+ [![PyPI](https://img.shields.io/pypi/v/oracq.svg)](https://pypi.org/project/oracq/)
8
+ [![Python](https://img.shields.io/pypi/pyversions/oracq.svg)](https://pypi.org/project/oracq/)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](LICENSE)
10
+
11
+ oracq 是面向量子算法研究者的科学计算算法实现框架。用 Python 按访问模型编写可组合算法,生成保留模块结构的寄存器级中间表示(RIR);保存尚未实现的 oracle,比较门网络、QRAM 和可逆算术等实现,完成绑定后进行数值验证和资源分析。
12
+
13
+ 当前包版本为 **0.1.0**,RIR 格式为 **0.1**([规范全文](docs/zh/reference/rir.md))。算法通过普通 Python 协议定义输入和输出,不要求扩展语言类型系统。
14
+
15
+ ## 核心概念速览
16
+
17
+ | 概念 | 一句话 | 手册 / 规范 | API 参考 |
18
+ |---|---|---|---|
19
+ | RIR | 寄存器级中间表示;模块调用与 Repeat 结构保留到文本形式 | [RIR 0.1 规范](docs/zh/reference/rir.md) | [ir](docs/api/infrastructure/ir.rst) |
20
+ | 构造器 | `Builder`/`Operation` 三段式生成模块与程序 | [核心概念](docs/zh/manual/concepts.md#模块与未完成的实现) | [builder](docs/api/infrastructure/builder.rst) |
21
+ | 寄存器与视图 | bits/uint/qubit 解释、切片与重解释,下标 0 是最低位 | [核心概念](docs/zh/manual/concepts.md#寄存器与视图) | [ir](docs/api/infrastructure/ir.rst) |
22
+ | 开放 oracle 与绑定 | 先声明后绑定:能力合取、候选实现比较、QRAM 捕获 | [绑定教程](docs/zh/tutorials/oracle-binding.md) | [linking](docs/api/infrastructure/linking.rst) |
23
+ | 算法契约 | 可检查的输入协议、能力规格与验收报告 | [契约](docs/zh/manual/contracts.md) | [contracts](docs/api/algorithms/input_model/contracts.rst) |
24
+ | 结构验证 | 生成期校验位宽、重叠与结构约束 | [核心概念](docs/zh/manual/concepts.md) | [validation](docs/api/infrastructure/validation.rst) |
25
+ | 序列化 | RIR 默认 YAML,JSON 可选,两种文本逐字段一致 | [RIR 规范](docs/zh/reference/rir.md) | [serialization](docs/api/infrastructure/serialization.rst) |
26
+ | 执行与读出 | 寄存器参考执行器与宿主读出 | [后端](docs/zh/manual/backends.md) | [execution](docs/api/infrastructure/execution.rst)、[readout](docs/api/infrastructure/readout.rst) |
27
+ | QMem | QRAM 资源的指针式读写与多维视图 | [QMem](docs/zh/manual/qmem.md) | [qmem](docs/api/infrastructure/qmem.rst) |
28
+ | QRAM 数据文件 | `*.qram.yaml` 内存定义的加载与写出 | [QRAM 内存](docs/zh/reference/qram-memory.md) | [qram_schema](docs/api/infrastructure/qram_schema.rst) |
29
+ | 数学函数前端 | Python 可调用编译为可逆线路 | [数学函数](docs/zh/manual/math-functions.md) | [mathfunc](docs/api/infrastructure/mathfunc.rst) |
30
+ | 资源估计 | T / 旋转 / QRAM 访问的计数模型与开放分析 | [资源估计](docs/zh/manual/resource-estimation.md) | [estimate](docs/api/infrastructure/estimate.rst) |
31
+ | 后端导出 | OriginIR-ext、严格网表、PySparQ、quantikz | [后端](docs/zh/manual/backends.md) | [backends](docs/api/infrastructure/backends/originir.rst) |
32
+
33
+ ## 一个最小程序
34
+
35
+ ```python
36
+ from oracq import Bits, Builder, export_originir, simulate
37
+
38
+ b = Builder("bell_pair", {"pair": Bits(2)})
39
+ b.h(b["pair"][0])
40
+ b.xor(b["pair"][0], b["pair"][1])
41
+ program = b.finish().program()
42
+
43
+ print(simulate(program).amplitudes)
44
+ print(export_originir(program).text)
45
+ ```
46
+
47
+ 结果在 `00` 与 `11` 上具有相等幅度。模块调用和 Repeat 在 RIR 与 YAML/JSON 文本中保留,不在生成阶段展开。
48
+
49
+ 本例用到的 API:[`Builder`](docs/api/infrastructure/builder.rst) · [`Bits`](docs/api/infrastructure/ir.rst) · [`simulate`](docs/api/infrastructure/execution.rst) · [`export_originir`](docs/api/infrastructure/backends/originir.rst)。逐步讲解见教程[第一个寄存器程序](docs/zh/tutorials/first-program.md)。
50
+
51
+ ## 典型工作流
52
+
53
+ | 步骤 | 入口 | 深入阅读 |
54
+ |---|---|---|
55
+ | 1. 声明开放 oracle | [`declare`](docs/api/algorithms/input_model/oracles.rst)、能力与规格 | [算法契约](docs/zh/manual/contracts.md) |
56
+ | 2. 构造程序 | [`Builder`](docs/api/infrastructure/builder.rst) 组合模块调用 | [教程:第一个程序](docs/zh/tutorials/first-program.md) |
57
+ | 3. 结构验证 | [`validate`](docs/api/infrastructure/validation.rst) | [核心概念](docs/zh/manual/concepts.md) |
58
+ | 4. 绑定实现 | [`bind`](docs/api/infrastructure/linking.rst)、`bind_with_report` 比较候选 | [教程:替换 oracle](docs/zh/tutorials/oracle-binding.md)、[算法研究教程](docs/zh/tutorials/algorithm-research.md) |
59
+ | 5. 导出 / 执行 / 估计 | [`export_originir`](docs/api/infrastructure/backends/originir.rst)、[`simulate`](docs/api/infrastructure/execution.rst)、[`estimate_resources`](docs/api/infrastructure/estimate.rst) | [后端](docs/zh/manual/backends.md)、[资源估计](docs/zh/manual/resource-estimation.md) |
60
+
61
+ ## 算法库
62
+
63
+ 算法库按用途组织为十个子包,完整清单与选型指引见[算法目录](docs/zh/manual/algorithms/index.md),每个算法一页手册(接口、实现要点、验证方案与已知缺口)。各类代表:
64
+
65
+ | 类别 | 代表算法页 |
66
+ |---|---|
67
+ | 查询与搜索 | [Grover 搜索](docs/zh/manual/algorithms/grover.md)、[振幅估计](docs/zh/manual/algorithms/qae.md)、[量子计数](docs/zh/manual/algorithms/quantum-counting.md) |
68
+ | 基础查询算法 | [Deutsch–Jozsa](docs/zh/manual/algorithms/deutsch-jozsa.md)、[Simon](docs/zh/manual/algorithms/simon.md)、[Bernstein–Vazirani](docs/zh/manual/algorithms/bernstein-vazirani.md) |
69
+ | Fourier 与算术 | [QFT](docs/zh/manual/algorithms/qft.md)、[Fourier 加法](docs/zh/manual/algorithms/fourier-addition.md)、[求阶](docs/zh/manual/algorithms/order-finding.md) |
70
+ | Hamiltonian 演化 | [Trotter](docs/zh/manual/algorithms/trotter.md)、[QSP 相位合成](docs/zh/manual/algorithms/qsp-phase-synthesis.md)、[QSVT HamSim](docs/zh/manual/algorithms/qsvt-hamiltonian-simulation.md) |
71
+ | 估计与测试 | [QPE](docs/zh/manual/algorithms/qpe.md)、[Hadamard test](docs/zh/manual/algorithms/hadamard-test.md)、[Swap test](docs/zh/manual/algorithms/swap-test.md) |
72
+ | 量子线性系统 | [Costa 行走](docs/zh/manual/algorithms/costa-walk.md)、[CKS](docs/zh/manual/algorithms/cks.md)、[VTAA-CKS](docs/zh/manual/algorithms/vtaa-cks.md) |
73
+ | QODE / QPDE | [Schrödingerization](docs/zh/manual/algorithms/schrodingerization.md)、[LCHS](docs/zh/manual/algorithms/lchs.md)、[Carleman](docs/zh/manual/algorithms/carleman.md) |
74
+ | 变分与优化 | [VQE](docs/zh/manual/algorithms/vqe.md)、[QAOA MaxCut](docs/zh/manual/algorithms/qaoa-maxcut.md)、[DQI](docs/zh/manual/algorithms/dqi.md) |
75
+ | 量子行走 | [coined walk](docs/zh/manual/algorithms/coined-cycle-walk.md)、[Szegedy](docs/zh/manual/algorithms/szegedy-walk.md)、[MNRS](docs/zh/manual/algorithms/mnrs-search.md) |
76
+ | 量子机器学习 | [QPCA](docs/zh/manual/algorithms/qpca.md)、[QCNN](docs/zh/manual/algorithms/qcnn.md)、KP 推荐系统([API](docs/api/algorithms/qml/recommendation.rst),手册页待补) |
77
+ | 数据加载与输入模型 | [态制备](docs/zh/manual/algorithms/state-preparation.md)、[XOR 数据库](docs/zh/manual/algorithms/xor-database.md)、[Select-Swap QROM](docs/zh/manual/algorithms/select-swap.md) |
78
+ | 量子纠错 | [重复码](docs/zh/manual/algorithms/repetition-codes.md) |
79
+
80
+ ## 输入模型与算子
81
+
82
+ 算法通过五类访问模型消费输入,彼此可组合:
83
+
84
+ - 算子包装与基本组合(`identity`/`product`/`scale`/LCU):[手册](docs/zh/manual/operators.md)、[API](docs/api/algorithms/input_model/operators.rst);块编码代数见 [block_encoding](docs/api/algorithms/input_model/block_encoding.rst)。
85
+ - Oracle 范式(XorDatabase、StatePreparation、StateOracle、SparseAccess):[API](docs/api/algorithms/input_model/oracles.rst)。
86
+ - 量子数据结构 QVector/QMatrix:[手册](docs/zh/manual/qdata.md)、[API](docs/api/algorithms/input_model/qdata.rst)。
87
+ - 密度矩阵与 Gibbs 态、谱与低秩分解:[density](docs/api/algorithms/input_model/density.rst)、[spectral](docs/api/algorithms/input_model/spectral.rst)、[lowrank](docs/api/algorithms/input_model/lowrank.rst)。
88
+
89
+ ## 应用层
90
+
91
+ - **QFVM**(量子流体求解):[手册](docs/zh/manual/qfvm.md)、[API](docs/api/applications/qfvm.rst)、输入模型审阅[规范](docs/zh/reference/qfvm-input-models.md)。
92
+ - **QHAM**(PDE → HAM → QHAM 流程):[手册](docs/zh/manual/qham.md)、[推导规范](docs/zh/reference/qham-derivation.md)、[API](docs/api/applications/qham/linearization.rst)、[教程](docs/zh/tutorials/qham.md)。
93
+ - **Roe 矩阵元**:[roe](docs/api/applications/roe.rst)、[roe_formulas](docs/api/applications/roe_formulas.rst)。
94
+ - **案例目录**:22 个参考工作负载([catalog](docs/api/applications/catalog.rst))与展示生成器([gallery](docs/api/applications/gallery.rst)、[教程](docs/zh/tutorials/gallery.md))。
95
+
96
+ ## 文档地图
97
+
98
+ 按角色选择阅读路径:
99
+
100
+ - **上手**:[第一个程序](docs/zh/tutorials/first-program.md) → [核心概念](docs/zh/manual/concepts.md) → [替换 oracle](docs/zh/tutorials/oracle-binding.md)。
101
+ - **算法研究**:[算法研究教程](docs/zh/tutorials/algorithm-research.md) → [算法目录](docs/zh/manual/algorithms/index.md) → [验证覆盖矩阵](docs/zh/development/validation-coverage.md),适用边界见[验证与适用范围](docs/zh/manual/limits.md)。
102
+ - **微分方程应用**:[教程](docs/zh/tutorials/differential-equations.md) → [手册](docs/zh/manual/differential-equations.md) → [QHAM 手册](docs/zh/manual/qham.md)。
103
+ - **后端工程**:[后端手册](docs/zh/manual/backends.md) → [兼容性审阅](docs/zh/reference/backend-compatibility.md) → [基础设施 API](docs/api/infrastructure/index.rst)。
104
+ - **语言与规范**:[RIR 规范](docs/zh/reference/rir.md)、[生成层边界](docs/zh/reference/language.md)、[开放 IR](docs/zh/reference/open-ir.md)、[QRAM 内存格式](docs/zh/reference/qram-memory.md)、[数学 IR](docs/zh/reference/math-ir.md)。
105
+
106
+ ## 安装 · 构建 · 检查
107
+
108
+ ```bash
109
+ uv sync --locked --extra dev --extra docs
110
+ uv run python tools/build_docs.py --lang all
111
+ ```
112
+
113
+ 构建双语两个语言树(warning 视为错误):英文输出到 `out/docs/en/html`,中文输出到 `out/docs/zh/html`,并执行 doctest。打开 `out/docs/zh/html/index.html` 浏览中文站点。算法展示与工程检查:
114
+
115
+ ```bash
116
+ uv run python examples/algorithm_gallery.py
117
+ uv run python tools/check_project.py --docs
118
+ ```
119
+
120
+ 算法展示目录生成 22 个小实例的 RIR、OriginIR-ext 和读出说明。完整原生检查要求另一个已安装 `pysparq` 与 `uniqc` 的环境:
121
+
122
+ ```bash
123
+ PYTHONPATH=src /path/to/backend/python examples/algorithm_gallery.py --native
124
+ ```
125
+
126
+ 语言核心只依赖 PyYAML 做文本序列化。可选后端在执行入口导入;生成产物、环境和构建文件均不提交。开发流程见 [CONTRIBUTING.zh-CN.md](CONTRIBUTING.zh-CN.md) 与[文档编写规范](docs/zh/development/writing-docs.md);源码分类与迁移说明见[架构](docs/zh/manual/architecture.md)与[导入路径](docs/zh/manual/compatibility.md)。
127
+
128
+ QLSS/QODE/QHAM 等高级算法仍有数值精度、成功通道或收敛性待核验项(逐项状态见[验证覆盖矩阵](docs/zh/development/validation-coverage.md))。通用 QSP-HamSim 内核尚需提供;当前模乘采用有限规模置换合成,VQE/QAOA 的经典优化器由应用选择。