nwqlib 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.
Files changed (510) hide show
  1. nwqlib-1.0.0/.python-version +1 -0
  2. nwqlib-1.0.0/CONTRIBUTING.md +13 -0
  3. nwqlib-1.0.0/LICENSE +24 -0
  4. nwqlib-1.0.0/MANIFEST.in +5 -0
  5. nwqlib-1.0.0/PKG-INFO +169 -0
  6. nwqlib-1.0.0/README.md +104 -0
  7. nwqlib-1.0.0/docs/CODE_TOUR.md +256 -0
  8. nwqlib-1.0.0/docs/ENGINEERING_CONSTANTS.md +671 -0
  9. nwqlib-1.0.0/docs/ENVIRONMENT_LOCK.txt +181 -0
  10. nwqlib-1.0.0/docs/FRAMEWORK.md +346 -0
  11. nwqlib-1.0.0/docs/MAINTENANCE.md +207 -0
  12. nwqlib-1.0.0/docs/ROADMAP.md +246 -0
  13. nwqlib-1.0.0/docs/aer.md +85 -0
  14. nwqlib-1.0.0/docs/algorithm_protocol.md +115 -0
  15. nwqlib-1.0.0/docs/algorithms/expectation.md +176 -0
  16. nwqlib-1.0.0/docs/algorithms/gcim.md +134 -0
  17. nwqlib-1.0.0/docs/algorithms/lanczos.md +107 -0
  18. nwqlib-1.0.0/docs/algorithms/lchs.md +212 -0
  19. nwqlib-1.0.0/docs/algorithms/qhd.md +878 -0
  20. nwqlib-1.0.0/docs/algorithms/qls.md +209 -0
  21. nwqlib-1.0.0/docs/algorithms/qpe.md +163 -0
  22. nwqlib-1.0.0/docs/api/algorithms/expectation.md +17 -0
  23. nwqlib-1.0.0/docs/api/algorithms/gcim.md +19 -0
  24. nwqlib-1.0.0/docs/api/algorithms/lanczos.md +15 -0
  25. nwqlib-1.0.0/docs/api/algorithms/lchs.md +13 -0
  26. nwqlib-1.0.0/docs/api/algorithms/qhd.md +119 -0
  27. nwqlib-1.0.0/docs/api/algorithms/qls.md +13 -0
  28. nwqlib-1.0.0/docs/api/algorithms/qpe.md +25 -0
  29. nwqlib-1.0.0/docs/api/evidence.md +29 -0
  30. nwqlib-1.0.0/docs/api/index.md +13 -0
  31. nwqlib-1.0.0/docs/api/subroutines/block_encoding.md +47 -0
  32. nwqlib-1.0.0/docs/api/subroutines/fermionic_pool.md +39 -0
  33. nwqlib-1.0.0/docs/api/subroutines/hamiltonian_evolution.md +21 -0
  34. nwqlib-1.0.0/docs/api/subroutines/lcu.md +31 -0
  35. nwqlib-1.0.0/docs/api/subroutines/pauli_decomposition.md +14 -0
  36. nwqlib-1.0.0/docs/api/subroutines/qpe.md +18 -0
  37. nwqlib-1.0.0/docs/api/subroutines/qsp.md +44 -0
  38. nwqlib-1.0.0/docs/api/subroutines/state_preparation.md +36 -0
  39. nwqlib-1.0.0/docs/api/subroutines/trotterization.md +5 -0
  40. nwqlib-1.0.0/docs/api/workflow.md +124 -0
  41. nwqlib-1.0.0/docs/backends.md +66 -0
  42. nwqlib-1.0.0/docs/blocks.md +172 -0
  43. nwqlib-1.0.0/docs/cli.md +56 -0
  44. nwqlib-1.0.0/docs/contract-specimen/README.md +78 -0
  45. nwqlib-1.0.0/docs/contract-specimen/claims.json +75 -0
  46. nwqlib-1.0.0/docs/contract-specimen/records.schema.json +119 -0
  47. nwqlib-1.0.0/docs/contract-specimen/specimen.json +1232 -0
  48. nwqlib-1.0.0/docs/dependency_issues.md +118 -0
  49. nwqlib-1.0.0/docs/development/design_rationale.md +101 -0
  50. nwqlib-1.0.0/docs/development/execution.md +71 -0
  51. nwqlib-1.0.0/docs/development/input_contracts.md +55 -0
  52. nwqlib-1.0.0/docs/development/reports.md +19 -0
  53. nwqlib-1.0.0/docs/error_evidence.md +85 -0
  54. nwqlib-1.0.0/docs/examples.md +75 -0
  55. nwqlib-1.0.0/docs/fault-tolerant-resources.md +127 -0
  56. nwqlib-1.0.0/docs/ibm.md +30 -0
  57. nwqlib-1.0.0/docs/index.md +52 -0
  58. nwqlib-1.0.0/docs/inputs.md +95 -0
  59. nwqlib-1.0.0/docs/ionq.md +37 -0
  60. nwqlib-1.0.0/docs/ir.md +153 -0
  61. nwqlib-1.0.0/docs/mathematics.md +2174 -0
  62. nwqlib-1.0.0/docs/nexus.md +88 -0
  63. nwqlib-1.0.0/docs/nwqsim.md +82 -0
  64. nwqlib-1.0.0/docs/own_circuit.md +228 -0
  65. nwqlib-1.0.0/docs/prepared_execution.md +76 -0
  66. nwqlib-1.0.0/docs/profiles.md +95 -0
  67. nwqlib-1.0.0/docs/qasm-streaming.md +76 -0
  68. nwqlib-1.0.0/docs/quickstart.md +81 -0
  69. nwqlib-1.0.0/docs/records/README.md +57 -0
  70. nwqlib-1.0.0/docs/references.md +369 -0
  71. nwqlib-1.0.0/docs/release_notes.md +27 -0
  72. nwqlib-1.0.0/docs/resources.md +138 -0
  73. nwqlib-1.0.0/docs/run_archives.md +130 -0
  74. nwqlib-1.0.0/docs/saved_evidence.md +39 -0
  75. nwqlib-1.0.0/docs/scientist.md +75 -0
  76. nwqlib-1.0.0/docs/scripts/check_adapt_records.py +118 -0
  77. nwqlib-1.0.0/docs/scripts/check_algorithm_protocol.py +164 -0
  78. nwqlib-1.0.0/docs/scripts/check_core_records.py +376 -0
  79. nwqlib-1.0.0/docs/scripts/check_df_records.py +144 -0
  80. nwqlib-1.0.0/docs/scripts/check_lchs_records.py +76 -0
  81. nwqlib-1.0.0/docs/scripts/check_ordered_operator_records.py +84 -0
  82. nwqlib-1.0.0/docs/scripts/check_prepared_records.py +161 -0
  83. nwqlib-1.0.0/docs/scripts/check_profile_records.py +210 -0
  84. nwqlib-1.0.0/docs/scripts/check_qasm_records.py +99 -0
  85. nwqlib-1.0.0/docs/scripts/check_qhd_records.py +254 -0
  86. nwqlib-1.0.0/docs/scripts/check_qls_records.py +105 -0
  87. nwqlib-1.0.0/docs/scripts/check_qpe_records.py +126 -0
  88. nwqlib-1.0.0/docs/scripts/check_scientist_records.py +227 -0
  89. nwqlib-1.0.0/docs/scripts/contract_specimen.py +386 -0
  90. nwqlib-1.0.0/docs/scripts/golden_snapshot.py +299 -0
  91. nwqlib-1.0.0/docs/scripts/mutation_probes.py +3430 -0
  92. nwqlib-1.0.0/docs/scripts/policy_lint.py +505 -0
  93. nwqlib-1.0.0/docs/scripts/qsp_phase_solver_sweep.py +141 -0
  94. nwqlib-1.0.0/docs/search.md +49 -0
  95. nwqlib-1.0.0/docs/slurm.md +100 -0
  96. nwqlib-1.0.0/docs/verification.md +127 -0
  97. nwqlib-1.0.0/docs/why_nwqlib.md +76 -0
  98. nwqlib-1.0.0/examples/README.md +28 -0
  99. nwqlib-1.0.0/examples/gcim_lanczos_qpe_eigenvalue_intro.ipynb +1181 -0
  100. nwqlib-1.0.0/examples/generators/build_notebooks.py +165 -0
  101. nwqlib-1.0.0/examples/generators/gcim_lanczos_qpe_eigenvalue_intro.py +682 -0
  102. nwqlib-1.0.0/examples/generators/lchs_linear_dynamics_intro.py +649 -0
  103. nwqlib-1.0.0/examples/generators/lchs_scientific.py +700 -0
  104. nwqlib-1.0.0/examples/generators/qhd_optimization_intro.py +848 -0
  105. nwqlib-1.0.0/examples/generators/qhd_scientific.py +1122 -0
  106. nwqlib-1.0.0/examples/generators/qls_linear_system_intro.py +585 -0
  107. nwqlib-1.0.0/examples/generators/qls_scientific.py +628 -0
  108. nwqlib-1.0.0/examples/generators/resource_estimation_at_scale.py +1620 -0
  109. nwqlib-1.0.0/examples/lchs_linear_dynamics_intro.ipynb +1204 -0
  110. nwqlib-1.0.0/examples/lchs_scientific.ipynb +1197 -0
  111. nwqlib-1.0.0/examples/qhd_optimization_intro.ipynb +1476 -0
  112. nwqlib-1.0.0/examples/qhd_scientific.ipynb +1825 -0
  113. nwqlib-1.0.0/examples/qls_linear_system_intro.ipynb +1139 -0
  114. nwqlib-1.0.0/examples/qls_scientific.ipynb +1035 -0
  115. nwqlib-1.0.0/examples/resource_estimation_at_scale.ipynb +2505 -0
  116. nwqlib-1.0.0/mkdocs.yml +155 -0
  117. nwqlib-1.0.0/pyproject.toml +133 -0
  118. nwqlib-1.0.0/setup.cfg +4 -0
  119. nwqlib-1.0.0/src/nwqlib/__init__.py +63 -0
  120. nwqlib-1.0.0/src/nwqlib/__main__.py +5 -0
  121. nwqlib-1.0.0/src/nwqlib/_choice_archive.py +768 -0
  122. nwqlib-1.0.0/src/nwqlib/_counts.py +168 -0
  123. nwqlib-1.0.0/src/nwqlib/_limits.py +11 -0
  124. nwqlib-1.0.0/src/nwqlib/_linalg_laws.py +243 -0
  125. nwqlib-1.0.0/src/nwqlib/_numerics.py +288 -0
  126. nwqlib-1.0.0/src/nwqlib/_optional.py +13 -0
  127. nwqlib-1.0.0/src/nwqlib/_phase_product.py +119 -0
  128. nwqlib-1.0.0/src/nwqlib/_preparation_laws.py +93 -0
  129. nwqlib-1.0.0/src/nwqlib/_prepared_execution.py +5346 -0
  130. nwqlib-1.0.0/src/nwqlib/_projected_eigensolver.py +442 -0
  131. nwqlib-1.0.0/src/nwqlib/_qpy_archive.py +270 -0
  132. nwqlib-1.0.0/src/nwqlib/_quantum_readout.py +1071 -0
  133. nwqlib-1.0.0/src/nwqlib/_remote_preparation.py +200 -0
  134. nwqlib-1.0.0/src/nwqlib/_run_archive.py +1035 -0
  135. nwqlib-1.0.0/src/nwqlib/_run_journal.py +575 -0
  136. nwqlib-1.0.0/src/nwqlib/_sqlite_bytes.py +8 -0
  137. nwqlib-1.0.0/src/nwqlib/_validation.py +477 -0
  138. nwqlib-1.0.0/src/nwqlib/algorithms/__init__.py +68 -0
  139. nwqlib-1.0.0/src/nwqlib/algorithms/_eigen_inputs.py +494 -0
  140. nwqlib-1.0.0/src/nwqlib/algorithms/_eigen_support.py +178 -0
  141. nwqlib-1.0.0/src/nwqlib/algorithms/authoring.py +175 -0
  142. nwqlib-1.0.0/src/nwqlib/algorithms/expectation.py +2938 -0
  143. nwqlib-1.0.0/src/nwqlib/algorithms/expectation_metadata.py +37 -0
  144. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/__init__.py +39 -0
  145. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt.py +1315 -0
  146. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt_acquisition.py +2547 -0
  147. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt_actions.py +264 -0
  148. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt_archive.py +349 -0
  149. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt_inputs.py +1049 -0
  150. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt_records.py +643 -0
  151. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/adapt_verification.py +749 -0
  152. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/chemistry.py +793 -0
  153. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/fixed_basis.py +2447 -0
  154. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/optimization.py +452 -0
  155. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/pair_reducer.py +336 -0
  156. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/pencil.py +229 -0
  157. nwqlib-1.0.0/src/nwqlib/algorithms/gcim/sector.py +132 -0
  158. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/__init__.py +12 -0
  159. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/archive.py +78 -0
  160. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/method.py +1217 -0
  161. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/numerical.py +908 -0
  162. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/readout.py +490 -0
  163. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/records.py +339 -0
  164. nwqlib-1.0.0/src/nwqlib/algorithms/lanczos/workflow.py +285 -0
  165. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/__init__.py +27 -0
  166. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/analysis.py +330 -0
  167. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/archive.py +274 -0
  168. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/compiled_selection.py +766 -0
  169. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/host.py +689 -0
  170. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/host_pf.py +424 -0
  171. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/inhomogeneous_theory.py +240 -0
  172. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/method.py +318 -0
  173. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/native.py +715 -0
  174. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/parameters.py +552 -0
  175. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/periodic.py +476 -0
  176. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/primary_records.py +415 -0
  177. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/provider_config.py +80 -0
  178. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/providers.py +1649 -0
  179. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/quantum.py +403 -0
  180. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/quantum_resources.py +516 -0
  181. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/references.py +188 -0
  182. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/refinement.py +344 -0
  183. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/select_synthesis.py +531 -0
  184. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/selected_grid.py +586 -0
  185. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/selection.py +182 -0
  186. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/solution_error_budget.py +583 -0
  187. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/source_selection.py +135 -0
  188. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/time_independent_common.py +39 -0
  189. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/time_independent_terms.py +2694 -0
  190. nwqlib-1.0.0/src/nwqlib/algorithms/lchs/verification.py +396 -0
  191. nwqlib-1.0.0/src/nwqlib/algorithms/protocol.py +152 -0
  192. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/__init__.py +44 -0
  193. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/_durable.py +535 -0
  194. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/_outer.py +453 -0
  195. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/archive.py +255 -0
  196. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/binary.py +1729 -0
  197. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/circuit_errors.py +677 -0
  198. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/compiler.py +699 -0
  199. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/constrained.py +3654 -0
  200. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/constrained_records.py +1483 -0
  201. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/decoding.py +262 -0
  202. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/evolution_bounds.py +696 -0
  203. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/grid.py +286 -0
  204. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/initial_state.py +914 -0
  205. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/kinetic.py +170 -0
  206. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/method.py +4577 -0
  207. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/native.py +285 -0
  208. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/objective.py +184 -0
  209. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/potential.py +281 -0
  210. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/records.py +1318 -0
  211. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/refinement.py +2908 -0
  212. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/refinement_records.py +1238 -0
  213. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/resources.py +1627 -0
  214. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/schedules.py +792 -0
  215. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/split_step.py +807 -0
  216. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/theory.py +733 -0
  217. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/validation.py +209 -0
  218. nwqlib-1.0.0/src/nwqlib/algorithms/qhd/verification.py +553 -0
  219. nwqlib-1.0.0/src/nwqlib/algorithms/qls/__init__.py +18 -0
  220. nwqlib-1.0.0/src/nwqlib/algorithms/qls/archive.py +303 -0
  221. nwqlib-1.0.0/src/nwqlib/algorithms/qls/constants.py +49 -0
  222. nwqlib-1.0.0/src/nwqlib/algorithms/qls/host_planning.py +986 -0
  223. nwqlib-1.0.0/src/nwqlib/algorithms/qls/method.py +862 -0
  224. nwqlib-1.0.0/src/nwqlib/algorithms/qls/norm_search.py +443 -0
  225. nwqlib-1.0.0/src/nwqlib/algorithms/qls/numerical.py +264 -0
  226. nwqlib-1.0.0/src/nwqlib/algorithms/qls/periodic.py +123 -0
  227. nwqlib-1.0.0/src/nwqlib/algorithms/qls/primary_records.py +763 -0
  228. nwqlib-1.0.0/src/nwqlib/algorithms/qls/quantum.py +2019 -0
  229. nwqlib-1.0.0/src/nwqlib/algorithms/qls/verification.py +628 -0
  230. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/__init__.py +13 -0
  231. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/archive.py +174 -0
  232. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/controller.py +334 -0
  233. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/method.py +2165 -0
  234. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/numerical.py +919 -0
  235. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/powers.py +1449 -0
  236. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/records.py +1623 -0
  237. nwqlib-1.0.0/src/nwqlib/algorithms/qpe/verification.py +346 -0
  238. nwqlib-1.0.0/src/nwqlib/algorithms/registry.py +187 -0
  239. nwqlib-1.0.0/src/nwqlib/amplitudes.py +257 -0
  240. nwqlib-1.0.0/src/nwqlib/artifacts.py +680 -0
  241. nwqlib-1.0.0/src/nwqlib/backends/__init__.py +59 -0
  242. nwqlib-1.0.0/src/nwqlib/backends/_auxiliary_process.py +167 -0
  243. nwqlib-1.0.0/src/nwqlib/backends/_native/nwqsim_runner.cpp +828 -0
  244. nwqlib-1.0.0/src/nwqlib/backends/_qpy_buffer.py +17 -0
  245. nwqlib-1.0.0/src/nwqlib/backends/assessment.py +2057 -0
  246. nwqlib-1.0.0/src/nwqlib/backends/capabilities.py +203 -0
  247. nwqlib-1.0.0/src/nwqlib/backends/connection.py +506 -0
  248. nwqlib-1.0.0/src/nwqlib/backends/host.py +11 -0
  249. nwqlib-1.0.0/src/nwqlib/backends/ibm_runtime.py +743 -0
  250. nwqlib-1.0.0/src/nwqlib/backends/inspection.py +235 -0
  251. nwqlib-1.0.0/src/nwqlib/backends/ionq.py +578 -0
  252. nwqlib-1.0.0/src/nwqlib/backends/nexus.py +635 -0
  253. nwqlib-1.0.0/src/nwqlib/backends/nwqec.py +469 -0
  254. nwqlib-1.0.0/src/nwqlib/backends/nwqsim.py +1166 -0
  255. nwqlib-1.0.0/src/nwqlib/backends/profiles.py +300 -0
  256. nwqlib-1.0.0/src/nwqlib/backends/qiskit_aer.py +1074 -0
  257. nwqlib-1.0.0/src/nwqlib/backends/qre.py +354 -0
  258. nwqlib-1.0.0/src/nwqlib/backends/resources.py +119 -0
  259. nwqlib-1.0.0/src/nwqlib/backends/results.py +90 -0
  260. nwqlib-1.0.0/src/nwqlib/backends/slurm.py +660 -0
  261. nwqlib-1.0.0/src/nwqlib/backends/targets.py +26 -0
  262. nwqlib-1.0.0/src/nwqlib/backends/telemetry.py +407 -0
  263. nwqlib-1.0.0/src/nwqlib/blocks/__init__.py +18 -0
  264. nwqlib-1.0.0/src/nwqlib/blocks/_archive.py +156 -0
  265. nwqlib-1.0.0/src/nwqlib/blocks/_qiskit_intake.py +321 -0
  266. nwqlib-1.0.0/src/nwqlib/blocks/encoding.py +215 -0
  267. nwqlib-1.0.0/src/nwqlib/blocks/kernels.py +131 -0
  268. nwqlib-1.0.0/src/nwqlib/blocks/lowering.py +407 -0
  269. nwqlib-1.0.0/src/nwqlib/blocks/records.py +354 -0
  270. nwqlib-1.0.0/src/nwqlib/blocks/selection.py +759 -0
  271. nwqlib-1.0.0/src/nwqlib/cli.py +142 -0
  272. nwqlib-1.0.0/src/nwqlib/core/__init__.py +11 -0
  273. nwqlib-1.0.0/src/nwqlib/core/analysis.py +356 -0
  274. nwqlib-1.0.0/src/nwqlib/core/planning.py +1588 -0
  275. nwqlib-1.0.0/src/nwqlib/core/records.py +553 -0
  276. nwqlib-1.0.0/src/nwqlib/evidence/__init__.py +54 -0
  277. nwqlib-1.0.0/src/nwqlib/evidence/_work.py +145 -0
  278. nwqlib-1.0.0/src/nwqlib/evidence/binary.py +563 -0
  279. nwqlib-1.0.0/src/nwqlib/evidence/energy_shift.py +601 -0
  280. nwqlib-1.0.0/src/nwqlib/evidence/error_model.py +886 -0
  281. nwqlib-1.0.0/src/nwqlib/evidence/records.py +125 -0
  282. nwqlib-1.0.0/src/nwqlib/evidence/scalar_bound.py +198 -0
  283. nwqlib-1.0.0/src/nwqlib/evidence/sector.py +118 -0
  284. nwqlib-1.0.0/src/nwqlib/evidence/statistics.py +226 -0
  285. nwqlib-1.0.0/src/nwqlib/evidence/verification.py +226 -0
  286. nwqlib-1.0.0/src/nwqlib/execution.py +1921 -0
  287. nwqlib-1.0.0/src/nwqlib/io/__init__.py +10 -0
  288. nwqlib-1.0.0/src/nwqlib/io/materialization.py +103 -0
  289. nwqlib-1.0.0/src/nwqlib/io/qasm.py +88 -0
  290. nwqlib-1.0.0/src/nwqlib/io/streaming.py +504 -0
  291. nwqlib-1.0.0/src/nwqlib/ir/__init__.py +19 -0
  292. nwqlib-1.0.0/src/nwqlib/ir/expressions.py +182 -0
  293. nwqlib-1.0.0/src/nwqlib/ir/records.py +434 -0
  294. nwqlib-1.0.0/src/nwqlib/ir/selection.py +111 -0
  295. nwqlib-1.0.0/src/nwqlib/ir/validation.py +972 -0
  296. nwqlib-1.0.0/src/nwqlib/operators/__init__.py +32 -0
  297. nwqlib-1.0.0/src/nwqlib/operators/_factorized.py +219 -0
  298. nwqlib-1.0.0/src/nwqlib/operators/_fermion.py +305 -0
  299. nwqlib-1.0.0/src/nwqlib/operators/_pauli.py +697 -0
  300. nwqlib-1.0.0/src/nwqlib/operators/access.py +114 -0
  301. nwqlib-1.0.0/src/nwqlib/operators/df.py +412 -0
  302. nwqlib-1.0.0/src/nwqlib/operators/inputs.py +698 -0
  303. nwqlib-1.0.0/src/nwqlib/operators/refinement.py +375 -0
  304. nwqlib-1.0.0/src/nwqlib/problems/__init__.py +29 -0
  305. nwqlib-1.0.0/src/nwqlib/problems/inputs.py +524 -0
  306. nwqlib-1.0.0/src/nwqlib/problems/records.py +780 -0
  307. nwqlib-1.0.0/src/nwqlib/problems/scalars.py +127 -0
  308. nwqlib-1.0.0/src/nwqlib/py.typed +1 -0
  309. nwqlib-1.0.0/src/nwqlib/reporting/__init__.py +5 -0
  310. nwqlib-1.0.0/src/nwqlib/reporting/records.py +21 -0
  311. nwqlib-1.0.0/src/nwqlib/resources/__init__.py +17 -0
  312. nwqlib-1.0.0/src/nwqlib/resources/fold.py +1065 -0
  313. nwqlib-1.0.0/src/nwqlib/resources/records.py +416 -0
  314. nwqlib-1.0.0/src/nwqlib/saved_evidence.py +418 -0
  315. nwqlib-1.0.0/src/nwqlib/scientist.py +637 -0
  316. nwqlib-1.0.0/src/nwqlib/search.py +705 -0
  317. nwqlib-1.0.0/src/nwqlib/serialization.py +54 -0
  318. nwqlib-1.0.0/src/nwqlib/subroutines/__init__.py +1 -0
  319. nwqlib-1.0.0/src/nwqlib/subroutines/_dense_synthesis.py +1422 -0
  320. nwqlib-1.0.0/src/nwqlib/subroutines/_matrix_checks.py +30 -0
  321. nwqlib-1.0.0/src/nwqlib/subroutines/_mcx_counts.py +36 -0
  322. nwqlib-1.0.0/src/nwqlib/subroutines/_multiplexors.py +827 -0
  323. nwqlib-1.0.0/src/nwqlib/subroutines/_power_of_two.py +25 -0
  324. nwqlib-1.0.0/src/nwqlib/subroutines/_registry_utils.py +70 -0
  325. nwqlib-1.0.0/src/nwqlib/subroutines/_semantic.py +124 -0
  326. nwqlib-1.0.0/src/nwqlib/subroutines/_serialization.py +37 -0
  327. nwqlib-1.0.0/src/nwqlib/subroutines/block_encoding/__init__.py +34 -0
  328. nwqlib-1.0.0/src/nwqlib/subroutines/block_encoding/banded.py +313 -0
  329. nwqlib-1.0.0/src/nwqlib/subroutines/block_encoding/core.py +1682 -0
  330. nwqlib-1.0.0/src/nwqlib/subroutines/block_encoding/registry.py +65 -0
  331. nwqlib-1.0.0/src/nwqlib/subroutines/dense_matrices.py +52 -0
  332. nwqlib-1.0.0/src/nwqlib/subroutines/fermionic_circuits.py +869 -0
  333. nwqlib-1.0.0/src/nwqlib/subroutines/fermionic_pool.py +1232 -0
  334. nwqlib-1.0.0/src/nwqlib/subroutines/hamiltonian_evolution/__init__.py +29 -0
  335. nwqlib-1.0.0/src/nwqlib/subroutines/hamiltonian_evolution/pauli_evolution.py +442 -0
  336. nwqlib-1.0.0/src/nwqlib/subroutines/hamiltonian_evolution/pauli_ir.py +89 -0
  337. nwqlib-1.0.0/src/nwqlib/subroutines/hamiltonian_evolution/pauli_labels.py +112 -0
  338. nwqlib-1.0.0/src/nwqlib/subroutines/hamiltonian_evolution/sparse_pauli_product.py +81 -0
  339. nwqlib-1.0.0/src/nwqlib/subroutines/lcu/__init__.py +26 -0
  340. nwqlib-1.0.0/src/nwqlib/subroutines/lcu/core.py +687 -0
  341. nwqlib-1.0.0/src/nwqlib/subroutines/lcu/data.py +106 -0
  342. nwqlib-1.0.0/src/nwqlib/subroutines/lcu/registry.py +41 -0
  343. nwqlib-1.0.0/src/nwqlib/subroutines/pauli_decomposition.py +241 -0
  344. nwqlib-1.0.0/src/nwqlib/subroutines/qiskit_compat.py +630 -0
  345. nwqlib-1.0.0/src/nwqlib/subroutines/qpe/__init__.py +15 -0
  346. nwqlib-1.0.0/src/nwqlib/subroutines/qpe/coherent.py +189 -0
  347. nwqlib-1.0.0/src/nwqlib/subroutines/qsp/__init__.py +42 -0
  348. nwqlib-1.0.0/src/nwqlib/subroutines/qsp/evolution.py +1566 -0
  349. nwqlib-1.0.0/src/nwqlib/subroutines/qsp/inverse.py +354 -0
  350. nwqlib-1.0.0/src/nwqlib/subroutines/qsp/phases.py +743 -0
  351. nwqlib-1.0.0/src/nwqlib/subroutines/qsp/shortcut.py +220 -0
  352. nwqlib-1.0.0/src/nwqlib/subroutines/state_preparation/__init__.py +41 -0
  353. nwqlib-1.0.0/src/nwqlib/subroutines/state_preparation/direct.py +163 -0
  354. nwqlib-1.0.0/src/nwqlib/subroutines/state_preparation/mps.py +451 -0
  355. nwqlib-1.0.0/src/nwqlib/subroutines/state_preparation/mps_circuit.py +450 -0
  356. nwqlib-1.0.0/src/nwqlib/subroutines/trotterization/__init__.py +32 -0
  357. nwqlib-1.0.0/src/nwqlib/subroutines/trotterization/error_budget.py +1967 -0
  358. nwqlib-1.0.0/src/nwqlib/subroutines/xacc.py +118 -0
  359. nwqlib-1.0.0/src/nwqlib.egg-info/PKG-INFO +169 -0
  360. nwqlib-1.0.0/src/nwqlib.egg-info/SOURCES.txt +508 -0
  361. nwqlib-1.0.0/src/nwqlib.egg-info/dependency_links.txt +1 -0
  362. nwqlib-1.0.0/src/nwqlib.egg-info/entry_points.txt +2 -0
  363. nwqlib-1.0.0/src/nwqlib.egg-info/requires.txt +64 -0
  364. nwqlib-1.0.0/src/nwqlib.egg-info/top_level.txt +1 -0
  365. nwqlib-1.0.0/tests/_fermionic_references.py +190 -0
  366. nwqlib-1.0.0/tests/_h2_sto3g_reference.py +60 -0
  367. nwqlib-1.0.0/tests/_hadamard_method.py +433 -0
  368. nwqlib-1.0.0/tests/_hadamard_method_metadata.py +32 -0
  369. nwqlib-1.0.0/tests/_lchs_suzuki_reference.py +151 -0
  370. nwqlib-1.0.0/tests/_pf_branch_comparison.py +182 -0
  371. nwqlib-1.0.0/tests/_profile_fixtures.py +269 -0
  372. nwqlib-1.0.0/tests/_qsp_references.py +141 -0
  373. nwqlib-1.0.0/tests/author_method_fixture.py +25 -0
  374. nwqlib-1.0.0/tests/conftest.py +154 -0
  375. nwqlib-1.0.0/tests/data/qls_native_selected.json +113 -0
  376. nwqlib-1.0.0/tests/test_absolute_structure_predicates.py +51 -0
  377. nwqlib-1.0.0/tests/test_adapt_admission.py +323 -0
  378. nwqlib-1.0.0/tests/test_adapt_gcim.py +178 -0
  379. nwqlib-1.0.0/tests/test_adapt_gcim_efficiency_contract.py +353 -0
  380. nwqlib-1.0.0/tests/test_adapt_h2_anchors.py +55 -0
  381. nwqlib-1.0.0/tests/test_adapt_native_cache.py +234 -0
  382. nwqlib-1.0.0/tests/test_adapt_preserved_science.py +121 -0
  383. nwqlib-1.0.0/tests/test_adapt_primary.py +553 -0
  384. nwqlib-1.0.0/tests/test_adapt_shift_science.py +219 -0
  385. nwqlib-1.0.0/tests/test_adapt_verification.py +273 -0
  386. nwqlib-1.0.0/tests/test_algorithm_protocol.py +180 -0
  387. nwqlib-1.0.0/tests/test_amplitude_masses.py +235 -0
  388. nwqlib-1.0.0/tests/test_archive_boundaries.py +128 -0
  389. nwqlib-1.0.0/tests/test_backend_baseline.py +705 -0
  390. nwqlib-1.0.0/tests/test_block_encoding.py +1217 -0
  391. nwqlib-1.0.0/tests/test_code_review_fixes.py +602 -0
  392. nwqlib-1.0.0/tests/test_contract_specimen.py +221 -0
  393. nwqlib-1.0.0/tests/test_controller_frontiers.py +404 -0
  394. nwqlib-1.0.0/tests/test_core_records.py +624 -0
  395. nwqlib-1.0.0/tests/test_dense_control_route.py +297 -0
  396. nwqlib-1.0.0/tests/test_dense_synthesis.py +542 -0
  397. nwqlib-1.0.0/tests/test_df.py +50 -0
  398. nwqlib-1.0.0/tests/test_encoding_selection.py +308 -0
  399. nwqlib-1.0.0/tests/test_error_model.py +453 -0
  400. nwqlib-1.0.0/tests/test_examples.py +424 -0
  401. nwqlib-1.0.0/tests/test_expectation_current.py +633 -0
  402. nwqlib-1.0.0/tests/test_expectation_inference.py +811 -0
  403. nwqlib-1.0.0/tests/test_factorized_operators.py +129 -0
  404. nwqlib-1.0.0/tests/test_fermionic_pool.py +952 -0
  405. nwqlib-1.0.0/tests/test_foundation_imports.py +116 -0
  406. nwqlib-1.0.0/tests/test_gcim_adapt_inputs.py +145 -0
  407. nwqlib-1.0.0/tests/test_gcim_chemistry.py +658 -0
  408. nwqlib-1.0.0/tests/test_gcim_native_chain.py +150 -0
  409. nwqlib-1.0.0/tests/test_gcim_native_preparations.py +111 -0
  410. nwqlib-1.0.0/tests/test_gcim_pencil.py +241 -0
  411. nwqlib-1.0.0/tests/test_gcim_production.py +1115 -0
  412. nwqlib-1.0.0/tests/test_hamiltonian_evolution.py +159 -0
  413. nwqlib-1.0.0/tests/test_ibm_backend.py +906 -0
  414. nwqlib-1.0.0/tests/test_input_access.py +385 -0
  415. nwqlib-1.0.0/tests/test_ionq_backend.py +785 -0
  416. nwqlib-1.0.0/tests/test_ir.py +652 -0
  417. nwqlib-1.0.0/tests/test_lanczos.py +500 -0
  418. nwqlib-1.0.0/tests/test_lanczos_circuits.py +218 -0
  419. nwqlib-1.0.0/tests/test_lchs_compiled_select.py +734 -0
  420. nwqlib-1.0.0/tests/test_lchs_default.py +72 -0
  421. nwqlib-1.0.0/tests/test_lchs_initial.py +199 -0
  422. nwqlib-1.0.0/tests/test_lchs_low_somma.py +159 -0
  423. nwqlib-1.0.0/tests/test_lchs_numerics.py +710 -0
  424. nwqlib-1.0.0/tests/test_lchs_periodic.py +322 -0
  425. nwqlib-1.0.0/tests/test_lchs_primary.py +1012 -0
  426. nwqlib-1.0.0/tests/test_lchs_providers.py +891 -0
  427. nwqlib-1.0.0/tests/test_lchs_qsp_source.py +67 -0
  428. nwqlib-1.0.0/tests/test_lchs_resource_structural_law.py +913 -0
  429. nwqlib-1.0.0/tests/test_lchs_select_synthesis.py +639 -0
  430. nwqlib-1.0.0/tests/test_lchs_solution_error_budget.py +276 -0
  431. nwqlib-1.0.0/tests/test_lchs_structured_select.py +404 -0
  432. nwqlib-1.0.0/tests/test_lchs_verification.py +731 -0
  433. nwqlib-1.0.0/tests/test_lcu_subroutines.py +391 -0
  434. nwqlib-1.0.0/tests/test_mcx_counts.py +19 -0
  435. nwqlib-1.0.0/tests/test_metadata_identity.py +460 -0
  436. nwqlib-1.0.0/tests/test_mps_state_preparation.py +586 -0
  437. nwqlib-1.0.0/tests/test_multiplexors.py +481 -0
  438. nwqlib-1.0.0/tests/test_nexus_backend.py +541 -0
  439. nwqlib-1.0.0/tests/test_nexus_sdk.py +201 -0
  440. nwqlib-1.0.0/tests/test_nexus_workflow.py +305 -0
  441. nwqlib-1.0.0/tests/test_nwqec_compilation.py +392 -0
  442. nwqlib-1.0.0/tests/test_nwqsim_backend.py +539 -0
  443. nwqlib-1.0.0/tests/test_nwqsim_targets.py +954 -0
  444. nwqlib-1.0.0/tests/test_observation_schedule.py +2003 -0
  445. nwqlib-1.0.0/tests/test_operator_refinement.py +96 -0
  446. nwqlib-1.0.0/tests/test_plan_estimate.py +206 -0
  447. nwqlib-1.0.0/tests/test_prepared_contracts.py +613 -0
  448. nwqlib-1.0.0/tests/test_prepared_execution.py +842 -0
  449. nwqlib-1.0.0/tests/test_prepared_resources.py +266 -0
  450. nwqlib-1.0.0/tests/test_profile_assessment.py +766 -0
  451. nwqlib-1.0.0/tests/test_profile_telemetry.py +235 -0
  452. nwqlib-1.0.0/tests/test_projected_eigensolver.py +138 -0
  453. nwqlib-1.0.0/tests/test_provider_optional_errors.py +49 -0
  454. nwqlib-1.0.0/tests/test_public_cli.py +169 -0
  455. nwqlib-1.0.0/tests/test_qasm_streaming.py +547 -0
  456. nwqlib-1.0.0/tests/test_qhd_augmented_lagrangian.py +2040 -0
  457. nwqlib-1.0.0/tests/test_qhd_binary.py +833 -0
  458. nwqlib-1.0.0/tests/test_qhd_campaigns.py +54 -0
  459. nwqlib-1.0.0/tests/test_qhd_corrections.py +322 -0
  460. nwqlib-1.0.0/tests/test_qhd_efficiency_contract.py +120 -0
  461. nwqlib-1.0.0/tests/test_qhd_periodic.py +320 -0
  462. nwqlib-1.0.0/tests/test_qhd_readout.py +762 -0
  463. nwqlib-1.0.0/tests/test_qhd_refinement.py +1340 -0
  464. nwqlib-1.0.0/tests/test_qhd_resources.py +1586 -0
  465. nwqlib-1.0.0/tests/test_qhd_resume.py +903 -0
  466. nwqlib-1.0.0/tests/test_qhd_schedules.py +346 -0
  467. nwqlib-1.0.0/tests/test_qhd_split_step.py +807 -0
  468. nwqlib-1.0.0/tests/test_qhd_workflow.py +2444 -0
  469. nwqlib-1.0.0/tests/test_qls_native.py +231 -0
  470. nwqlib-1.0.0/tests/test_qls_periodic.py +249 -0
  471. nwqlib-1.0.0/tests/test_qls_primary.py +836 -0
  472. nwqlib-1.0.0/tests/test_qls_quantum.py +1505 -0
  473. nwqlib-1.0.0/tests/test_qls_workflow.py +435 -0
  474. nwqlib-1.0.0/tests/test_qpe_campaigns.py +87 -0
  475. nwqlib-1.0.0/tests/test_qpe_correction.py +846 -0
  476. nwqlib-1.0.0/tests/test_qpe_domain_evidence.py +193 -0
  477. nwqlib-1.0.0/tests/test_qpe_efficiency_contract.py +926 -0
  478. nwqlib-1.0.0/tests/test_qpe_selected.py +767 -0
  479. nwqlib-1.0.0/tests/test_qpe_subroutines.py +97 -0
  480. nwqlib-1.0.0/tests/test_qpe_workflow.py +395 -0
  481. nwqlib-1.0.0/tests/test_qpy_archive.py +202 -0
  482. nwqlib-1.0.0/tests/test_qre_projection.py +183 -0
  483. nwqlib-1.0.0/tests/test_qsp_evolution.py +1324 -0
  484. nwqlib-1.0.0/tests/test_quantum_readout.py +343 -0
  485. nwqlib-1.0.0/tests/test_remote_preparation.py +128 -0
  486. nwqlib-1.0.0/tests/test_report_domains.py +291 -0
  487. nwqlib-1.0.0/tests/test_report_extension.py +474 -0
  488. nwqlib-1.0.0/tests/test_resource_estimation_tiers.py +165 -0
  489. nwqlib-1.0.0/tests/test_resource_fold.py +844 -0
  490. nwqlib-1.0.0/tests/test_run_archive.py +527 -0
  491. nwqlib-1.0.0/tests/test_run_journal.py +717 -0
  492. nwqlib-1.0.0/tests/test_run_lifecycle.py +1163 -0
  493. nwqlib-1.0.0/tests/test_run_provenance.py +199 -0
  494. nwqlib-1.0.0/tests/test_saved_cli.py +125 -0
  495. nwqlib-1.0.0/tests/test_saved_evidence.py +395 -0
  496. nwqlib-1.0.0/tests/test_scientist.py +319 -0
  497. nwqlib-1.0.0/tests/test_scientist_eigen.py +819 -0
  498. nwqlib-1.0.0/tests/test_scientist_lchs.py +486 -0
  499. nwqlib-1.0.0/tests/test_search.py +370 -0
  500. nwqlib-1.0.0/tests/test_selected_runtime.py +207 -0
  501. nwqlib-1.0.0/tests/test_semantic_blocks.py +759 -0
  502. nwqlib-1.0.0/tests/test_shared_contracts.py +141 -0
  503. nwqlib-1.0.0/tests/test_slurm.py +265 -0
  504. nwqlib-1.0.0/tests/test_slurm_integration.py +527 -0
  505. nwqlib-1.0.0/tests/test_static_runtime.py +268 -0
  506. nwqlib-1.0.0/tests/test_synthesis_admission.py +560 -0
  507. nwqlib-1.0.0/tests/test_trotter_efficiency_contract.py +156 -0
  508. nwqlib-1.0.0/tests/test_trotterization.py +942 -0
  509. nwqlib-1.0.0/tests/test_verification_catalogue.py +406 -0
  510. nwqlib-1.0.0/tests/test_xacc.py +163 -0
@@ -0,0 +1 @@
1
+ 3.12.14
@@ -0,0 +1,13 @@
1
+ # Contributing
2
+
3
+ NWQLib provides quantum algorithm workflows with explicitly selected native SDK extras. Before changing algorithm behavior, read [docs/FRAMEWORK.md](docs/FRAMEWORK.md) for the package contract, execution modes, backend capability policy, reporting standards, and testing expectations. The package root lazily exposes scientist and finite-search operations; import additional public classes and functions from their owning subpackage. Keep changes scoped to one focused capability or fix. Avoid new dependencies unless the framework requires them, and record user-facing behavior through typed records, validation results, reports, and focused tests. Before submitting changes, run the checks in [docs/MAINTENANCE.md](docs/MAINTENANCE.md). A Method that submits your own circuit and returns its counts needs a `descriptor` and two hooks, `plan` and `analyze`, shown in [docs/own_circuit.md](docs/own_circuit.md).
4
+
5
+ ## Environment Lock
6
+
7
+ `docs/ENVIRONMENT_LOCK.txt` records the interpreter version and exact package versions used for validation. When resuming work, verify the selected interpreter, imported source location and dependency versions before using their results as evidence. Resumption does not automatically recreate or change an environment. Follow [docs/MAINTENANCE.md](docs/MAINTENANCE.md) for the selected environment and checks appropriate to an authorized dependency change.
8
+
9
+ Public dataclass docstrings use an `Args:` or `Attributes:` section that names every field exactly once. Literal-valued fields list their accepted spellings. Scientific quantities state non-obvious units, normalization, and shape.
10
+
11
+ Example notebooks are generated from their percent-format sources in `examples/generators/`. Edit the source, regenerate the notebook, and run the freshness check rather than maintaining two independent copies of example logic.
12
+
13
+ Generated figures identify their reproducible input or are marked as illustrative. Captions state whether plotted resources describe a full algorithm circuit, an oracle, or a subroutine, and synthesis comparisons name the method, state family, seed, and approximation parameters. Mathematical quantities must satisfy their actual domains before evidence is assessed. A justified roundoff adjustment requires an explicit scale-aware policy, retention of the raw value and disclosure of the adjustment. Signed statistical estimators retain their distinct meaning; formatting must not silently turn them into bounded physical quantities. See [Mathematical Definitions Before Evidence](docs/FRAMEWORK.md#mathematical-definitions-before-evidence).
nwqlib-1.0.0/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2026, Battelle Memorial Institute
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,5 @@
1
+ include LICENSE
2
+ include .python-version mkdocs.yml CONTRIBUTING.md
3
+ recursive-include docs *.md *.txt *.py *.json
4
+ recursive-include examples *.md *.py *.ipynb
5
+ recursive-include tests *.py *.json
nwqlib-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: nwqlib
3
+ Version: 1.0.0
4
+ Summary: Evidence-aware quantum algorithms and scientific workflows.
5
+ Author: NWQLib developers
6
+ License-Expression: BSD-2-Clause
7
+ Project-URL: Homepage, https://github.com/pnnl/NWQLib
8
+ Project-URL: Documentation, https://pnnl.github.io/NWQLib/
9
+ Project-URL: Repository, https://github.com/pnnl/NWQLib
10
+ Requires-Python: >=3.12
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: numpy>=2.5.2
14
+ Requires-Dist: scipy>=1.18.1
15
+ Requires-Dist: sympy>=1.14.0
16
+ Requires-Dist: pydantic<3,>=2.13.5
17
+ Provides-Extra: qiskit
18
+ Requires-Dist: qiskit>=2.5.2; extra == "qiskit"
19
+ Provides-Extra: aer
20
+ Requires-Dist: qiskit>=2.5.2; extra == "aer"
21
+ Requires-Dist: qiskit-aer>=0.17.2; extra == "aer"
22
+ Provides-Extra: nwqec
23
+ Requires-Dist: qiskit>=2.5.2; extra == "nwqec"
24
+ Requires-Dist: nwqec==0.1.2; extra == "nwqec"
25
+ Provides-Extra: qre
26
+ Requires-Dist: qdk[qre]==1.32.3; extra == "qre"
27
+ Provides-Extra: dev
28
+ Requires-Dist: jsonschema>=4.26.0; extra == "dev"
29
+ Requires-Dist: pytest>=7.0; extra == "dev"
30
+ Requires-Dist: pytest-xdist>=3.0; extra == "dev"
31
+ Requires-Dist: ruff>=0.1; extra == "dev"
32
+ Provides-Extra: qasm
33
+ Requires-Dist: qiskit>=2.5.2; extra == "qasm"
34
+ Requires-Dist: openqasm3[parser]>=1.0.1; extra == "qasm"
35
+ Requires-Dist: qiskit-qasm3-import>=0.6.0; extra == "qasm"
36
+ Provides-Extra: notebook
37
+ Requires-Dist: jupyter>=1.0; extra == "notebook"
38
+ Requires-Dist: ipykernel>=6.0; extra == "notebook"
39
+ Requires-Dist: nbclient>=0.10; extra == "notebook"
40
+ Requires-Dist: matplotlib>=3.7; extra == "notebook"
41
+ Provides-Extra: docs
42
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
43
+ Requires-Dist: mkdocstrings[python]>=0.25; extra == "docs"
44
+ Provides-Extra: tensor
45
+ Requires-Dist: qiskit>=2.5.2; extra == "tensor"
46
+ Provides-Extra: chemistry
47
+ Requires-Dist: qiskit>=2.5.2; extra == "chemistry"
48
+ Requires-Dist: openfermion>=1.5; extra == "chemistry"
49
+ Requires-Dist: pyscf>=2.6; extra == "chemistry"
50
+ Provides-Extra: ibm
51
+ Requires-Dist: qiskit>=2.5.2; extra == "ibm"
52
+ Requires-Dist: qiskit-ibm-runtime>=0.49.0; extra == "ibm"
53
+ Provides-Extra: ionq
54
+ Requires-Dist: qiskit>=2.5.2; extra == "ionq"
55
+ Requires-Dist: qiskit-ionq>=1.1.1; extra == "ionq"
56
+ Requires-Dist: requests>=2.34.2; extra == "ionq"
57
+ Requires-Dist: urllib3>=2.8.0; extra == "ionq"
58
+ Provides-Extra: nexus
59
+ Requires-Dist: qiskit>=2.5.2; extra == "nexus"
60
+ Requires-Dist: qnexus>=0.49.0; extra == "nexus"
61
+ Requires-Dist: pytket>=2.18.1; extra == "nexus"
62
+ Requires-Dist: pytket-qiskit>=0.78.0; extra == "nexus"
63
+ Requires-Dist: selene-core>=0.3.2; extra == "nexus"
64
+ Dynamic: license-file
65
+
66
+ # NWQLib: Northwest Quantum Library
67
+
68
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.23074265.svg)](https://doi.org/10.5281/zenodo.23074265)
69
+
70
+ **Documentation: <https://pnnl.github.io/NWQLib/>**
71
+
72
+ NWQLib applies quantum algorithms to scientific problems. A workflow connects your inputs and requested output to a selected method, execution and a report of the result, evidence and resources. Native circuit execution uses Qiskit and an explicitly selected backend.
73
+
74
+ IR# PNNL-SA-227989
75
+
76
+ ## Start here
77
+
78
+ **The [example notebooks](examples/) solve complete scientific problems from input to result, error and circuit cost, and the [examples guide](docs/examples.md) points you to the one that matches your problem. The [mathematics page](docs/mathematics.md) states the bounds, resource laws and error budgets that NWQLib uses, each with its proof or source and the code that implements it.**
79
+
80
+ From a source checkout, install the package with the local Aer executor:
81
+
82
+ ```bash
83
+ python -m pip install -e ".[aer]"
84
+ ```
85
+
86
+ To solve `du/dt = -A u` with a small physical input:
87
+
88
+ ```python
89
+ from nwqlib import LinearDynamics, solve
90
+ from nwqlib.algorithms import LCHS
91
+
92
+ problem = LinearDynamics(
93
+ A=[[0.4, 0.15], [0.05, 0.25]],
94
+ initial_state=[1.0, 0.0],
95
+ time=0.1,
96
+ )
97
+ result = solve(problem, method=LCHS())
98
+ print(result.solution)
99
+ ```
100
+
101
+ The default returns the physical solution approximation using nine total qubits. The [quickstart](docs/quickstart.md) compares it with an independent reference and shows how to change the approximation. The base install, `python -m pip install -e .`, supports metadata, admitted inputs, default LCHS planning and supported classical methods. Other planning paths follow their Method's input/conversion requirements; native preparation and execution require the selected backend extra. Method guides describe these boundaries.
102
+
103
+ The notebooks in `examples/` apply NWQLib to molecular ground-state energy, a linear system, linear dynamics and optimization, and one estimates the resources of a linear system, heat flow, two spin chains, a GCiM trial basis and a QHD optimization step at up to 100 qubits. The [examples guide](docs/examples.md) describes the work each notebook performs.
104
+
105
+ ## Choose a task
106
+
107
+ | Task | Read |
108
+ | --- | --- |
109
+ | Learn the Python workflow | [Quickstart](docs/quickstart.md), [examples](docs/examples.md) |
110
+ | Compare NWQLib with other quantum packages | [Why NWQLib](docs/why_nwqlib.md) |
111
+ | Discover methods or use the command line | [CLI guide](docs/cli.md) |
112
+ | Compare methods and inspect results | [Scientist workflow](docs/scientist.md) |
113
+ | Supply operators and states | [Input access](docs/inputs.md) |
114
+ | Estimate resources and assess a device | [Resource estimates](docs/resources.md), [device profiles](docs/profiles.md) |
115
+ | Run locally or submit to a provider | [Prepared execution](docs/prepared_execution.md), [backends](docs/backends.md) |
116
+ | Save results or continue a workflow | [Saved evidence](docs/saved_evidence.md), [run archives](docs/run_archives.md) |
117
+ | Look up a signature | [API reference](docs/api/index.md) |
118
+ | Check known defects in Qiskit and other dependencies, and how NWQLib handles them | [Dependency issues](docs/dependency_issues.md) |
119
+ | Extend or maintain NWQLib | [Run your own circuit](docs/own_circuit.md), [Contributing](CONTRIBUTING.md), [code tour](docs/CODE_TOUR.md), [maintenance](docs/MAINTENANCE.md) |
120
+ | Trace code to its paper, equation and reason | [Code tour](docs/CODE_TOUR.md#find-the-source-and-reason-for-a-line-of-code), [references](docs/references.md) |
121
+ | Find the bound, resource law or error budget behind a result, its proof or source, and its code | [Mathematics](docs/mathematics.md) |
122
+
123
+ ## Algorithms
124
+
125
+ | Scientific task | Methods |
126
+ | --- | --- |
127
+ | Normalized expectation of a finite real Pauli sum | [Expectation](docs/algorithms/expectation.md) |
128
+ | Energy estimates from moments or a selected subspace | [Chebyshev Lanczos](docs/algorithms/lanczos.md), [fixed and adaptive GCiM](docs/algorithms/gcim.md) |
129
+ | Phase or energy estimation | [QPE: QCELS, RWPE, SPE and RFE](docs/algorithms/qpe.md) |
130
+ | Time-independent linear dynamics | [LCHS](docs/algorithms/lchs.md) |
131
+ | Linear systems | [QLS: QSVT inverse polynomial (`qsvt_inverse`, the default) and the Dalzell kernel shortcut (`shortcut_native_svp`, `shortcut_dilation`)](docs/algorithms/qls.md) |
132
+ | Box-constrained optimization | [QHD](docs/algorithms/qhd.md) |
133
+ | Optimization over a box with equality or inequality constraints | [QHD augmented Lagrangian](docs/algorithms/qhd.md#constrained-problems) |
134
+
135
+ Methods report the quantity actually obtained and any unresolved accuracy conditions. A projected energy, local statistical interval or completed simulation does not by itself establish the full requested scientific claim. The [roadmap](docs/ROADMAP.md) records current limitations and open work. Reusable state preparation, block encoding, LCU, QSP/QSVT and evolution primitives have their own [API references](docs/api/index.md).
136
+
137
+ ## Backend support
138
+
139
+ Aer supports local execution. NWQ-Sim CPU execution and process-exit continuation have been exercised on macOS and Linux with the qualified build described in the [backend guide](docs/backends.md). IBM Runtime, IonQ and Nexus have offline SDK and injected-result qualification. Live provider accounts, queues and QPUs remain unqualified. Slurm and GPU/site support have their documented offline qualification boundaries.
140
+
141
+ The [Nexus guide](docs/nexus.md#costs-timeout-and-qualification) documents its pandas dependency exception and missing per-request timeout. See [Slurm](docs/slurm.md) for explicit site configuration. Each method/backend/readout combination must satisfy its own capability checks.
142
+
143
+ ## Authors and Developers
144
+
145
+ For questions, bug reports or collaboration, contact Muqing Zheng (muqing.zheng@pnnl.gov).
146
+
147
+ Affiliations are those at the time of contribution.
148
+
149
+ - Muqing Zheng, Pacific Northwest National Laboratory
150
+ - Chenxu Liu, Pacific Northwest National Laboratory
151
+ - Zhixin Song, Pacific Northwest National Laboratory and Georgia Institute of Technology
152
+ - Zeguan Wu, Pacific Northwest National Laboratory and University of Pittsburgh
153
+ - Xiangyu Li, Pacific Northwest National Laboratory
154
+ - Mingze Li, Pacific Northwest National Laboratory
155
+ - Nicholas P. Bauman, Pacific Northwest National Laboratory
156
+ - Samuel A. Stein, Pacific Northwest National Laboratory
157
+ - Johannes Mülmenstädt, Pacific Northwest National Laboratory
158
+ - Yousu Chen, Pacific Northwest National Laboratory
159
+ - Nathan Wiebe, Pacific Northwest National Laboratory and University of Toronto
160
+ - Ang Li, Pacific Northwest National Laboratory and University of Washington
161
+ - Karol Kowalski, Pacific Northwest National Laboratory
162
+
163
+ ## Acknowledgements
164
+
165
+ This work was supported by Pacific Northwest National Laboratory's Quantum Algorithms and Architecture for Domain Science (QuAADS) Laboratory Directed Research and Development (LDRD) Initiative. This material is based upon work supported by the U.S. Department of Energy, Office of Science, National Quantum Information Science Research Centers, Quantum Science Center (QSC). The Pacific Northwest National Laboratory is operated by Battelle for the U.S. Department of Energy under Contract DE-AC05-76RL01830.
166
+
167
+ [Algorithm and subroutine references](docs/references.md).
168
+
169
+ NWQLib is released under the BSD 2-Clause License; see `LICENSE`.
nwqlib-1.0.0/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # NWQLib: Northwest Quantum Library
2
+
3
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.23074265.svg)](https://doi.org/10.5281/zenodo.23074265)
4
+
5
+ **Documentation: <https://pnnl.github.io/NWQLib/>**
6
+
7
+ NWQLib applies quantum algorithms to scientific problems. A workflow connects your inputs and requested output to a selected method, execution and a report of the result, evidence and resources. Native circuit execution uses Qiskit and an explicitly selected backend.
8
+
9
+ IR# PNNL-SA-227989
10
+
11
+ ## Start here
12
+
13
+ **The [example notebooks](examples/) solve complete scientific problems from input to result, error and circuit cost, and the [examples guide](docs/examples.md) points you to the one that matches your problem. The [mathematics page](docs/mathematics.md) states the bounds, resource laws and error budgets that NWQLib uses, each with its proof or source and the code that implements it.**
14
+
15
+ From a source checkout, install the package with the local Aer executor:
16
+
17
+ ```bash
18
+ python -m pip install -e ".[aer]"
19
+ ```
20
+
21
+ To solve `du/dt = -A u` with a small physical input:
22
+
23
+ ```python
24
+ from nwqlib import LinearDynamics, solve
25
+ from nwqlib.algorithms import LCHS
26
+
27
+ problem = LinearDynamics(
28
+ A=[[0.4, 0.15], [0.05, 0.25]],
29
+ initial_state=[1.0, 0.0],
30
+ time=0.1,
31
+ )
32
+ result = solve(problem, method=LCHS())
33
+ print(result.solution)
34
+ ```
35
+
36
+ The default returns the physical solution approximation using nine total qubits. The [quickstart](docs/quickstart.md) compares it with an independent reference and shows how to change the approximation. The base install, `python -m pip install -e .`, supports metadata, admitted inputs, default LCHS planning and supported classical methods. Other planning paths follow their Method's input/conversion requirements; native preparation and execution require the selected backend extra. Method guides describe these boundaries.
37
+
38
+ The notebooks in `examples/` apply NWQLib to molecular ground-state energy, a linear system, linear dynamics and optimization, and one estimates the resources of a linear system, heat flow, two spin chains, a GCiM trial basis and a QHD optimization step at up to 100 qubits. The [examples guide](docs/examples.md) describes the work each notebook performs.
39
+
40
+ ## Choose a task
41
+
42
+ | Task | Read |
43
+ | --- | --- |
44
+ | Learn the Python workflow | [Quickstart](docs/quickstart.md), [examples](docs/examples.md) |
45
+ | Compare NWQLib with other quantum packages | [Why NWQLib](docs/why_nwqlib.md) |
46
+ | Discover methods or use the command line | [CLI guide](docs/cli.md) |
47
+ | Compare methods and inspect results | [Scientist workflow](docs/scientist.md) |
48
+ | Supply operators and states | [Input access](docs/inputs.md) |
49
+ | Estimate resources and assess a device | [Resource estimates](docs/resources.md), [device profiles](docs/profiles.md) |
50
+ | Run locally or submit to a provider | [Prepared execution](docs/prepared_execution.md), [backends](docs/backends.md) |
51
+ | Save results or continue a workflow | [Saved evidence](docs/saved_evidence.md), [run archives](docs/run_archives.md) |
52
+ | Look up a signature | [API reference](docs/api/index.md) |
53
+ | Check known defects in Qiskit and other dependencies, and how NWQLib handles them | [Dependency issues](docs/dependency_issues.md) |
54
+ | Extend or maintain NWQLib | [Run your own circuit](docs/own_circuit.md), [Contributing](CONTRIBUTING.md), [code tour](docs/CODE_TOUR.md), [maintenance](docs/MAINTENANCE.md) |
55
+ | Trace code to its paper, equation and reason | [Code tour](docs/CODE_TOUR.md#find-the-source-and-reason-for-a-line-of-code), [references](docs/references.md) |
56
+ | Find the bound, resource law or error budget behind a result, its proof or source, and its code | [Mathematics](docs/mathematics.md) |
57
+
58
+ ## Algorithms
59
+
60
+ | Scientific task | Methods |
61
+ | --- | --- |
62
+ | Normalized expectation of a finite real Pauli sum | [Expectation](docs/algorithms/expectation.md) |
63
+ | Energy estimates from moments or a selected subspace | [Chebyshev Lanczos](docs/algorithms/lanczos.md), [fixed and adaptive GCiM](docs/algorithms/gcim.md) |
64
+ | Phase or energy estimation | [QPE: QCELS, RWPE, SPE and RFE](docs/algorithms/qpe.md) |
65
+ | Time-independent linear dynamics | [LCHS](docs/algorithms/lchs.md) |
66
+ | Linear systems | [QLS: QSVT inverse polynomial (`qsvt_inverse`, the default) and the Dalzell kernel shortcut (`shortcut_native_svp`, `shortcut_dilation`)](docs/algorithms/qls.md) |
67
+ | Box-constrained optimization | [QHD](docs/algorithms/qhd.md) |
68
+ | Optimization over a box with equality or inequality constraints | [QHD augmented Lagrangian](docs/algorithms/qhd.md#constrained-problems) |
69
+
70
+ Methods report the quantity actually obtained and any unresolved accuracy conditions. A projected energy, local statistical interval or completed simulation does not by itself establish the full requested scientific claim. The [roadmap](docs/ROADMAP.md) records current limitations and open work. Reusable state preparation, block encoding, LCU, QSP/QSVT and evolution primitives have their own [API references](docs/api/index.md).
71
+
72
+ ## Backend support
73
+
74
+ Aer supports local execution. NWQ-Sim CPU execution and process-exit continuation have been exercised on macOS and Linux with the qualified build described in the [backend guide](docs/backends.md). IBM Runtime, IonQ and Nexus have offline SDK and injected-result qualification. Live provider accounts, queues and QPUs remain unqualified. Slurm and GPU/site support have their documented offline qualification boundaries.
75
+
76
+ The [Nexus guide](docs/nexus.md#costs-timeout-and-qualification) documents its pandas dependency exception and missing per-request timeout. See [Slurm](docs/slurm.md) for explicit site configuration. Each method/backend/readout combination must satisfy its own capability checks.
77
+
78
+ ## Authors and Developers
79
+
80
+ For questions, bug reports or collaboration, contact Muqing Zheng (muqing.zheng@pnnl.gov).
81
+
82
+ Affiliations are those at the time of contribution.
83
+
84
+ - Muqing Zheng, Pacific Northwest National Laboratory
85
+ - Chenxu Liu, Pacific Northwest National Laboratory
86
+ - Zhixin Song, Pacific Northwest National Laboratory and Georgia Institute of Technology
87
+ - Zeguan Wu, Pacific Northwest National Laboratory and University of Pittsburgh
88
+ - Xiangyu Li, Pacific Northwest National Laboratory
89
+ - Mingze Li, Pacific Northwest National Laboratory
90
+ - Nicholas P. Bauman, Pacific Northwest National Laboratory
91
+ - Samuel A. Stein, Pacific Northwest National Laboratory
92
+ - Johannes Mülmenstädt, Pacific Northwest National Laboratory
93
+ - Yousu Chen, Pacific Northwest National Laboratory
94
+ - Nathan Wiebe, Pacific Northwest National Laboratory and University of Toronto
95
+ - Ang Li, Pacific Northwest National Laboratory and University of Washington
96
+ - Karol Kowalski, Pacific Northwest National Laboratory
97
+
98
+ ## Acknowledgements
99
+
100
+ This work was supported by Pacific Northwest National Laboratory's Quantum Algorithms and Architecture for Domain Science (QuAADS) Laboratory Directed Research and Development (LDRD) Initiative. This material is based upon work supported by the U.S. Department of Energy, Office of Science, National Quantum Information Science Research Centers, Quantum Science Center (QSC). The Pacific Northwest National Laboratory is operated by Battelle for the U.S. Department of Energy under Contract DE-AC05-76RL01830.
101
+
102
+ [Algorithm and subroutine references](docs/references.md).
103
+
104
+ NWQLib is released under the BSD 2-Clause License; see `LICENSE`.