bloqade-circuit 0.6.3__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bloqade-circuit might be problematic. Click here for more details.

Files changed (403) hide show
  1. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/PKG-INFO +1 -1
  2. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/pyproject.toml +1 -1
  3. bloqade_circuit-0.6.4/src/bloqade/analysis/measure_id/__init__.py +5 -0
  4. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/measure_id/analysis.py +13 -2
  5. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/measure_id/impls.py +41 -2
  6. bloqade_circuit-0.6.4/src/bloqade/stim/passes/__init__.py +5 -0
  7. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/passes/simplify_ifs.py +10 -1
  8. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/passes/squin_to_stim.py +54 -21
  9. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/__init__.py +1 -0
  10. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/ifs_to_stim.py +5 -6
  11. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/squin_measure.py +2 -61
  12. bloqade_circuit-0.6.4/test/analysis/measure_id/test_measure_id.py +141 -0
  13. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/noise/apply_loss.stim +3 -0
  14. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/addition_assignment_measure.stim +2 -0
  15. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/alias_with_measure_list.stim +3 -0
  16. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/complex_storage_index_order.stim +8 -0
  17. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/nested_for_loop.stim +4 -0
  18. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/nested_list.stim +3 -0
  19. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/record_index_order.stim +7 -0
  20. bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/simple_if_rewrite.stim +8 -0
  21. bloqade_circuit-0.6.4/test/stim/passes/test_squin_meas_to_stim.py +162 -0
  22. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/test_squin_noise_to_stim.py +23 -5
  23. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/test_squin_qubit_to_stim.py +45 -3
  24. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/uv.lock +1 -1
  25. bloqade_circuit-0.6.3/src/bloqade/analysis/measure_id/__init__.py +0 -2
  26. bloqade_circuit-0.6.3/src/bloqade/stim/passes/__init__.py +0 -1
  27. bloqade_circuit-0.6.3/test/analysis/measure_id/test_measure_id.py +0 -31
  28. bloqade_circuit-0.6.3/test/stim/passes/stim_reference_programs/simple_if_rewrite.txt +0 -8
  29. bloqade_circuit-0.6.3/test/stim/passes/test_squin_meas_to_stim.py +0 -49
  30. bloqade_circuit-0.6.3/test/stim/passes/test_squin_to_stim_cases.py +0 -22
  31. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.github/dependabot.yml +0 -0
  32. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.github/workflows/ci.yml +0 -0
  33. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.github/workflows/isort.yml +0 -0
  34. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.github/workflows/lint.yml +0 -0
  35. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.github/workflows/release.yml +0 -0
  36. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.gitignore +0 -0
  37. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/.pre-commit-config.yaml +0 -0
  38. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/LICENSE +0 -0
  39. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/README.md +0 -0
  40. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/_typos.toml +0 -0
  41. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/justfile +0 -0
  42. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/__init__.py +0 -0
  43. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/address/__init__.py +0 -0
  44. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/address/analysis.py +0 -0
  45. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/address/impls.py +0 -0
  46. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/address/lattice.py +0 -0
  47. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/fidelity/__init__.py +0 -0
  48. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/fidelity/analysis.py +0 -0
  49. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/analysis/measure_id/lattice.py +0 -0
  50. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/__init__.py +0 -0
  51. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/lineprog.py +0 -0
  52. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/noise/__init__.py +0 -0
  53. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/noise/_two_zone_utils.py +0 -0
  54. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/noise/conflict_graph.py +0 -0
  55. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/noise/model.py +0 -0
  56. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/noise/transform.py +0 -0
  57. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/cirq_utils/parallelize.py +0 -0
  58. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/device.py +0 -0
  59. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/__init__.py +0 -0
  60. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/base.py +0 -0
  61. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/device.py +0 -0
  62. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/noise/__init__.py +0 -0
  63. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/noise/native.py +0 -0
  64. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/qasm2/__init__.py +0 -0
  65. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/qasm2/core.py +0 -0
  66. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/qasm2/glob.py +0 -0
  67. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/qasm2/parallel.py +0 -0
  68. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/qasm2/uop.py +0 -0
  69. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/reg.py +0 -0
  70. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/__init__.py +0 -0
  71. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/noise/__init__.py +0 -0
  72. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/noise/native.py +0 -0
  73. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/op.py +0 -0
  74. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/qubit.py +0 -0
  75. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/runtime.py +0 -0
  76. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/squin/wire.py +0 -0
  77. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/target.py +0 -0
  78. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/pyqrack/task.py +0 -0
  79. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/__init__.py +0 -0
  80. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/_qasm_loading.py +0 -0
  81. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/_wrappers.py +0 -0
  82. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/__init__.py +0 -0
  83. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/core/__init__.py +0 -0
  84. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/core/_dialect.py +0 -0
  85. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/core/_emit.py +0 -0
  86. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/core/_typeinfer.py +0 -0
  87. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/core/address.py +0 -0
  88. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/core/stmts.py +0 -0
  89. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/expr/__init__.py +0 -0
  90. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/expr/_dialect.py +0 -0
  91. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/expr/_emit.py +0 -0
  92. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/expr/_from_python.py +0 -0
  93. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/expr/_interp.py +0 -0
  94. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/expr/stmts.py +0 -0
  95. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/glob.py +0 -0
  96. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/indexing.py +0 -0
  97. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/inline.py +0 -0
  98. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/noise/__init__.py +0 -0
  99. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/noise/_dialect.py +0 -0
  100. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/noise/fidelity.py +0 -0
  101. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/noise/model.py +0 -0
  102. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/noise/stmts.py +0 -0
  103. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/parallel.py +0 -0
  104. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/uop/__init__.py +0 -0
  105. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/uop/_dialect.py +0 -0
  106. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/uop/_emit.py +0 -0
  107. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/uop/schedule.py +0 -0
  108. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/dialects/uop/stmts.py +0 -0
  109. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/__init__.py +0 -0
  110. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/base.py +0 -0
  111. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/gate.py +0 -0
  112. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/impls/__init__.py +0 -0
  113. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/impls/noise.py +0 -0
  114. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/main.py +0 -0
  115. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/emit/target.py +0 -0
  116. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/glob.py +0 -0
  117. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/groups.py +0 -0
  118. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/noise.py +0 -0
  119. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parallel.py +0 -0
  120. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/__init__.py +0 -0
  121. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/ast.py +0 -0
  122. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/build.py +0 -0
  123. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/lowering.py +0 -0
  124. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/parser.py +0 -0
  125. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/print.py +0 -0
  126. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/qasm2.lark +0 -0
  127. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/visitor.py +0 -0
  128. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/parse/visitor.pyi +0 -0
  129. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/__init__.py +0 -0
  130. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/fold.py +0 -0
  131. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/glob.py +0 -0
  132. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/lift_qubits.py +0 -0
  133. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/noise.py +0 -0
  134. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/parallel.py +0 -0
  135. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/py2qasm.py +0 -0
  136. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/qasm2py.py +0 -0
  137. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/passes/unroll_if.py +0 -0
  138. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/__init__.py +0 -0
  139. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/desugar.py +0 -0
  140. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/glob.py +0 -0
  141. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/insert_qubits.py +0 -0
  142. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/native_gates.py +0 -0
  143. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/noise/__init__.py +0 -0
  144. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/noise/heuristic_noise.py +0 -0
  145. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/noise/remove_noise.py +0 -0
  146. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/parallel_to_glob.py +0 -0
  147. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/parallel_to_uop.py +0 -0
  148. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/register.py +0 -0
  149. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/rewrite/uop_to_parallel.py +0 -0
  150. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qasm2/types.py +0 -0
  151. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qbraid/__init__.py +0 -0
  152. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qbraid/lowering.py +0 -0
  153. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qbraid/schema.py +0 -0
  154. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qbraid/simulation_result.py +0 -0
  155. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/qbraid/target.py +0 -0
  156. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/__init__.py +0 -0
  157. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/passes/__init__.py +0 -0
  158. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/passes/canonicalize_ilist.py +0 -0
  159. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/rules/__init__.py +0 -0
  160. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/rules/flatten_ilist.py +0 -0
  161. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/rules/inline_getitem_ilist.py +0 -0
  162. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/rewrite/rules/split_ifs.py +0 -0
  163. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/__init__.py +0 -0
  164. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/_typeinfer.py +0 -0
  165. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/__init__.py +0 -0
  166. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/address_impl.py +0 -0
  167. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/nsites/__init__.py +0 -0
  168. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/nsites/analysis.py +0 -0
  169. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/nsites/impls.py +0 -0
  170. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/nsites/lattice.py +0 -0
  171. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/analysis/schedule.py +0 -0
  172. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/__init__.py +0 -0
  173. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/emit/emit_circuit.py +0 -0
  174. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/emit/noise.py +0 -0
  175. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/emit/op.py +0 -0
  176. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/emit/qubit.py +0 -0
  177. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/emit/runtime.py +0 -0
  178. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/cirq/lowering.py +0 -0
  179. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/groups.py +0 -0
  180. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/lowering.py +0 -0
  181. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/noise/__init__.py +0 -0
  182. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/noise/_dialect.py +0 -0
  183. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/noise/_wrapper.py +0 -0
  184. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/noise/rewrite.py +0 -0
  185. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/noise/stmts.py +0 -0
  186. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/__init__.py +0 -0
  187. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/_dialect.py +0 -0
  188. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/_wrapper.py +0 -0
  189. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/number.py +0 -0
  190. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/rewrite.py +0 -0
  191. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/stdlib.py +0 -0
  192. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/stmts.py +0 -0
  193. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/traits.py +0 -0
  194. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/op/types.py +0 -0
  195. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/qubit.py +0 -0
  196. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/rewrite/U3_to_clifford.py +0 -0
  197. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/rewrite/__init__.py +0 -0
  198. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/rewrite/canonicalize.py +0 -0
  199. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/rewrite/desugar.py +0 -0
  200. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/rewrite/remove_dangling_qubits.py +0 -0
  201. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/rewrite/wrap_analysis.py +0 -0
  202. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/types.py +0 -0
  203. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/squin/wire.py +0 -0
  204. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/__init__.py +0 -0
  205. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/_wrappers.py +0 -0
  206. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/__init__.py +0 -0
  207. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/__init__.py +0 -0
  208. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/_dialect.py +0 -0
  209. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/emit.py +0 -0
  210. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/interp.py +0 -0
  211. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/lowering.py +0 -0
  212. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/stmts/__init__.py +0 -0
  213. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/stmts/annotate.py +0 -0
  214. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/stmts/const.py +0 -0
  215. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/auxiliary/types.py +0 -0
  216. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/__init__.py +0 -0
  217. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/_dialect.py +0 -0
  218. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/emit_str.py +0 -0
  219. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/stmts/__init__.py +0 -0
  220. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/stmts/measure.py +0 -0
  221. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/stmts/pp_measure.py +0 -0
  222. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/collapse/stmts/reset.py +0 -0
  223. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/__init__.py +0 -0
  224. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/_dialect.py +0 -0
  225. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/emit.py +0 -0
  226. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/stmts/__init__.py +0 -0
  227. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/stmts/base.py +0 -0
  228. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/stmts/clifford_1q.py +0 -0
  229. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/stmts/clifford_2q.py +0 -0
  230. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/stmts/control_2q.py +0 -0
  231. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/gate/stmts/pp.py +0 -0
  232. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/noise/__init__.py +0 -0
  233. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/noise/_dialect.py +0 -0
  234. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/noise/emit.py +0 -0
  235. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/dialects/noise/stmts.py +0 -0
  236. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/emit/__init__.py +0 -0
  237. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/emit/stim_str.py +0 -0
  238. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/groups.py +0 -0
  239. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/parse/__init__.py +0 -0
  240. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/parse/lowering.py +0 -0
  241. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/py_constant_to_stim.py +0 -0
  242. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/qubit_to_stim.py +0 -0
  243. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/squin_noise.py +0 -0
  244. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/util.py +0 -0
  245. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/wire_identity_elimination.py +0 -0
  246. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/rewrite/wire_to_stim.py +0 -0
  247. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/upstream/__init__.py +0 -0
  248. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/stim/upstream/from_squin.py +0 -0
  249. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/task.py +0 -0
  250. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/test_utils.py +0 -0
  251. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/types.py +0 -0
  252. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/__init__.py +0 -0
  253. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/__init__.py +0 -0
  254. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/animate.py +0 -0
  255. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/base.py +0 -0
  256. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/gate_event.py +0 -0
  257. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/runtime/__init__.py +0 -0
  258. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/runtime/aod.py +0 -0
  259. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/runtime/atoms.py +0 -0
  260. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/runtime/ppoly.py +0 -0
  261. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/runtime/qpustate.py +0 -0
  262. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/src/bloqade/visual/animation/runtime/utils.py +0 -0
  263. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/__init__.py +0 -0
  264. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/analysis/address/test_qubit_analysis.py +0 -0
  265. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/analysis/address/test_wire_analysis.py +0 -0
  266. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/analysis/address/util.py +0 -0
  267. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/analysis/fidelity/test_fidelity.py +0 -0
  268. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/cirq_utils/noise/test_noise_models.py +0 -0
  269. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/cirq_utils/noise/test_noisy_ghz.py +0 -0
  270. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/cirq_utils/noise/test_one_zone_correlated_noise.py +0 -0
  271. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/cirq_utils/test_lpsolvers.py +0 -0
  272. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/cirq_utils/test_parallelize.py +0 -0
  273. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/cirq_utils/test_transpile.py +0 -0
  274. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/__init__.py +0 -0
  275. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/runtime/__init__.py +0 -0
  276. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/runtime/noise/__init__.py +0 -0
  277. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/runtime/noise/qasm2/test_loss.py +0 -0
  278. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/runtime/noise/qasm2/test_pauli.py +0 -0
  279. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/runtime/test_dyn_memory.py +0 -0
  280. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/runtime/test_qrack.py +0 -0
  281. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/squin/test_kernel.py +0 -0
  282. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/squin/test_noise.py +0 -0
  283. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/pyqrack/test_target.py +0 -0
  284. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/__init__.py +0 -0
  285. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/analysis/test_dag.py +0 -0
  286. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/emit/test_extended.py +0 -0
  287. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/emit/test_extended_noise.py +0 -0
  288. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/emit/test_qasm2.py +0 -0
  289. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/emit/test_qasm2_emit.py +0 -0
  290. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/__init__.py +0 -0
  291. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/invalid_programs/invalid_if.qasm +0 -0
  292. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/README.md +0 -0
  293. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/global.qasm +0 -0
  294. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/iqft1.qasm +0 -0
  295. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/main.qasm +0 -0
  296. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/noise.qasm +0 -0
  297. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/para.qasm +0 -0
  298. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/process_tomo.qasm +0 -0
  299. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/qelib1.inc +0 -0
  300. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/qft.qasm +0 -0
  301. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/qft2.qasm +0 -0
  302. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/rb.qasm +0 -0
  303. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/rep_code.qasm +0 -0
  304. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/ripple_carry_adder.qasm +0 -0
  305. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/tele.qasm +0 -0
  306. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/programs/valid_if.qasm +0 -0
  307. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/test_ast.py +0 -0
  308. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/parse/test_roundtrip.py +0 -0
  309. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/__init__.py +0 -0
  310. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_global_to_parallel.py +0 -0
  311. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_global_to_uop.py +0 -0
  312. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_heuristic_noise.py +0 -0
  313. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_parallel_to_global.py +0 -0
  314. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_parallel_to_uop.py +0 -0
  315. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_qasm2py.py +0 -0
  316. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_unroll_if.py +0 -0
  317. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/passes/test_uop_to_parallel.py +0 -0
  318. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/test_count.py +0 -0
  319. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/test_inline.py +0 -0
  320. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/test_lowering.py +0 -0
  321. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/test_native.py +0 -0
  322. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qasm2/test_two2one.py +0 -0
  323. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qbraid/__init__.py +0 -0
  324. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qbraid/test_clean_circuit.py +0 -0
  325. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qbraid/test_lowering.py +0 -0
  326. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/qbraid/test_target.py +0 -0
  327. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/sample/__init__.py +0 -0
  328. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/sample/test_noise_model.py +0 -0
  329. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/analysis/test_nsites_analysis.py +0 -0
  330. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/cirq/test_cirq_to_squin.py +0 -0
  331. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/cirq/test_squin_noise_to_cirq.py +0 -0
  332. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/cirq/test_squin_to_cirq.py +0 -0
  333. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/op/test_reset.py +0 -0
  334. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/rewrite/test_U3_to_clifford.py +0 -0
  335. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/rewrite/test_canonicalize.py +0 -0
  336. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/rewrite/test_desugar.py +0 -0
  337. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/rewrite/test_mult_rewrite.py +0 -0
  338. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/test_constprop.py +0 -0
  339. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/test_sugar.py +0 -0
  340. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/test_typeinfer.py +0 -0
  341. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/wire/__init__.py +0 -0
  342. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/squin/wire/test_check.py +0 -0
  343. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/__init__.py +0 -0
  344. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/__init__.py +0 -0
  345. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/__init__.py +0 -0
  346. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/__init__.py +0 -0
  347. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/base.py +0 -0
  348. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_1q.py +0 -0
  349. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_ctrl.py +0 -0
  350. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_detector.py +0 -0
  351. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_meas.py +0 -0
  352. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_noise.py +0 -0
  353. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_obs_inc.py +0 -0
  354. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_ppmeas.py +0 -0
  355. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_qubit_coords.py +0 -0
  356. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/emit/test_stim_spp.py +0 -0
  357. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/test_stim_circuits.py +0 -0
  358. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/dialects/stim/test_stim_const.py +0 -0
  359. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/__init__.py +0 -0
  360. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/base.py +0 -0
  361. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/test_parse.py +0 -0
  362. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/test_parse_clifford.py +0 -0
  363. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/test_parse_control.py +0 -0
  364. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/test_parse_custom.py +0 -0
  365. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/test_parse_noise.py +0 -0
  366. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/parse/test_parse_spp.py +0 -0
  367. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/__init__.py +0 -0
  368. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/apply_depolarize1.stim +0 -0
  369. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/apply_pauli_channel_1.stim +0 -0
  370. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_depolarize1.stim +0 -0
  371. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_depolarize2.stim +0 -0
  372. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_iid_bit_flip_channel.stim +0 -0
  373. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_iid_phase_flip_channel.stim +0 -0
  374. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_iid_y_flip_channel.stim +0 -0
  375. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1.stim +0 -0
  376. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1_many_qubits.stim +0 -0
  377. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1_reuse.stim +0 -0
  378. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_2.stim +0 -0
  379. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_2_reuse_on_4_qubits.stim +0 -0
  380. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/pure_squin_rewrite.txt +0 -0
  381. /bloqade_circuit-0.6.3/test/stim/passes/stim_reference_programs/qubit/for_loop.stim → /bloqade_circuit-0.6.4/test/stim/passes/stim_reference_programs/qubit/for_loop_nontrivial_index.stim +0 -0
  382. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/qubit/qubit.stim +0 -0
  383. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/qubit/qubit_broadcast.stim +0 -0
  384. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/qubit/qubit_loss.stim +0 -0
  385. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/qubit/qubit_reset.stim +0 -0
  386. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/qubit/u3_to_clifford.stim +0 -0
  387. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire.stim +0 -0
  388. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_apply.stim +0 -0
  389. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_apply_control.stim +0 -0
  390. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_broadcast.stim +0 -0
  391. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_broadcast_control.stim +0 -0
  392. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_measure.stim +0 -0
  393. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_multiple_apply.stim +0 -0
  394. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_qubit_loss.stim +0 -0
  395. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/stim_reference_programs/wire/wire_reset.stim +0 -0
  396. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/passes/test_squin_wire_to_stim.py +0 -0
  397. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/test_measure_id_analysis.py +0 -0
  398. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/wrapper/__init__.py +0 -0
  399. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/stim/wrapper/test_wrapper.py +0 -0
  400. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/test_serialization.py +0 -0
  401. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/test_zone_model.py +0 -0
  402. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/visual/__init__.py +0 -0
  403. {bloqade_circuit-0.6.3 → bloqade_circuit-0.6.4}/test/visual/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bloqade-circuit
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: The software development toolkit for neutral atom arrays.
5
5
  Author-email: Roger-luo <rluo@quera.com>, kaihsin <khwu@quera.com>, weinbe58 <pweinberg@quera.com>, johnzl-777 <jlong@quera.com>
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "bloqade-circuit"
3
- version = "0.6.3"
3
+ version = "0.6.4"
4
4
  description = "The software development toolkit for neutral atom arrays."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -0,0 +1,5 @@
1
+ from . import impls as impls
2
+ from .analysis import (
3
+ MeasureIDFrame as MeasureIDFrame,
4
+ MeasurementIDAnalysis as MeasurementIDAnalysis,
5
+ )
@@ -1,13 +1,19 @@
1
1
  from typing import TypeVar
2
+ from dataclasses import field, dataclass
2
3
 
3
4
  from kirin import ir, interp
4
- from kirin.analysis import Forward, const
5
+ from kirin.analysis import ForwardExtra, const
5
6
  from kirin.analysis.forward import ForwardFrame
6
7
 
7
8
  from .lattice import MeasureId, NotMeasureId
8
9
 
9
10
 
10
- class MeasurementIDAnalysis(Forward[MeasureId]):
11
+ @dataclass
12
+ class MeasureIDFrame(ForwardFrame[MeasureId]):
13
+ num_measures_at_stmt: dict[ir.Statement, int] = field(default_factory=dict)
14
+
15
+
16
+ class MeasurementIDAnalysis(ForwardExtra[MeasureIDFrame, MeasureId]):
11
17
 
12
18
  keys = ["measure_id"]
13
19
  lattice = MeasureId
@@ -15,6 +21,11 @@ class MeasurementIDAnalysis(Forward[MeasureId]):
15
21
  # then use this to generate the negative values for target rec indices
16
22
  measure_count = 0
17
23
 
24
+ def initialize_frame(
25
+ self, code: ir.Statement, *, has_parent_access: bool = False
26
+ ) -> MeasureIDFrame:
27
+ return MeasureIDFrame(code, has_parent_access=has_parent_access)
28
+
18
29
  # Still default to bottom,
19
30
  # but let constants return the softer "NoMeasureId" type from impl
20
31
  def eval_stmt_fallback(
@@ -1,4 +1,5 @@
1
1
  from kirin import types as kirin_types, interp
2
+ from kirin.analysis import const
2
3
  from kirin.dialects import py, scf, func, ilist
3
4
 
4
5
  from bloqade.squin import wire, qubit
@@ -10,7 +11,7 @@ from .lattice import (
10
11
  MeasureIdTuple,
11
12
  InvalidMeasureId,
12
13
  )
13
- from .analysis import MeasurementIDAnalysis
14
+ from .analysis import MeasureIDFrame, MeasurementIDAnalysis
14
15
 
15
16
  ## Can't do wire right now because of
16
17
  ## unresolved RFC on return type
@@ -113,6 +114,15 @@ class PyIndexing(interp.MethodTable):
113
114
  return (InvalidMeasureId(),)
114
115
 
115
116
 
117
+ @py.assign.dialect.register(key="measure_id")
118
+ class PyAssign(interp.MethodTable):
119
+ @interp.impl(py.Alias)
120
+ def alias(
121
+ self, interp: MeasurementIDAnalysis, frame: interp.Frame, stmt: py.assign.Alias
122
+ ):
123
+ return (frame.get(stmt.value),)
124
+
125
+
116
126
  @py.binop.dialect.register(key="measure_id")
117
127
  class PyBinOp(interp.MethodTable):
118
128
  @interp.impl(py.Add)
@@ -152,4 +162,33 @@ class Func(interp.MethodTable):
152
162
  # scf, particularly IfElse
153
163
  @scf.dialect.register(key="measure_id")
154
164
  class Scf(scf.absint.Methods):
155
- pass
165
+
166
+ @interp.impl(scf.IfElse)
167
+ def if_else(
168
+ self,
169
+ interp_: MeasurementIDAnalysis,
170
+ frame: MeasureIDFrame,
171
+ stmt: scf.IfElse,
172
+ ):
173
+
174
+ frame.num_measures_at_stmt[stmt] = interp_.measure_count
175
+
176
+ # rest of the code taken directly from scf.absint.Methods base implementation
177
+
178
+ if isinstance(hint := stmt.cond.hints.get("const"), const.Value):
179
+ if hint.data:
180
+ return self._infer_if_else_cond(interp_, frame, stmt, stmt.then_body)
181
+ else:
182
+ return self._infer_if_else_cond(interp_, frame, stmt, stmt.else_body)
183
+ then_results = self._infer_if_else_cond(interp_, frame, stmt, stmt.then_body)
184
+ else_results = self._infer_if_else_cond(interp_, frame, stmt, stmt.else_body)
185
+
186
+ match (then_results, else_results):
187
+ case (interp.ReturnValue(then_value), interp.ReturnValue(else_value)):
188
+ return interp.ReturnValue(then_value.join(else_value))
189
+ case (interp.ReturnValue(then_value), _):
190
+ return then_results
191
+ case (_, interp.ReturnValue(else_value)):
192
+ return else_results
193
+ case _:
194
+ return interp_.join_results(then_results, else_results)
@@ -0,0 +1,5 @@
1
+ from .squin_to_stim import (
2
+ SquinToStimPass as SquinToStimPass,
3
+ StimSimplifyIfs as StimSimplifyIfs,
4
+ AggressiveForLoopUnroll as AggressiveForLoopUnroll,
5
+ )
@@ -9,6 +9,7 @@ from kirin.rewrite import (
9
9
  ConstantFold,
10
10
  CommonSubexpressionElimination,
11
11
  )
12
+ from kirin.dialects.ilist.passes import ConstList2IList
12
13
 
13
14
  from ..rewrite.ifs_to_stim import StimLiftThenBody, StimSplitIfStmts
14
15
 
@@ -23,8 +24,16 @@ class StimSimplifyIfs(Pass):
23
24
  Walk(StimSplitIfStmts()),
24
25
  ).rewrite(mt.code)
25
26
 
27
+ # because nested python lists don't have their
28
+ # member lists converted to ILists, ConstantFold
29
+ # can add python lists that can't be hashed, causing
30
+ # issues with CSE. ConstList2IList remedies that problem here.
26
31
  result = (
27
- Fixpoint(Walk(Chain(ConstantFold(), CommonSubexpressionElimination())))
32
+ Chain(
33
+ Fixpoint(Walk(ConstantFold())),
34
+ Walk(ConstList2IList()),
35
+ Walk(CommonSubexpressionElimination()),
36
+ )
28
37
  .rewrite(mt.code)
29
38
  .join(result)
30
39
  )
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass
2
2
 
3
- from kirin.passes import Fold
3
+ from kirin.passes import Fold, HintConst, TypeInfer
4
4
  from kirin.rewrite import (
5
5
  Walk,
6
6
  Chain,
@@ -16,6 +16,7 @@ from kirin.ir.method import Method
16
16
  from kirin.passes.abc import Pass
17
17
  from kirin.rewrite.abc import RewriteResult
18
18
  from kirin.passes.inline import InlinePass
19
+ from kirin.rewrite.alias import InlineAlias
19
20
 
20
21
  from bloqade.stim.rewrite import (
21
22
  SquinWireToStim,
@@ -33,11 +34,43 @@ from bloqade.squin.rewrite import (
33
34
  from bloqade.rewrite.passes import CanonicalizeIList
34
35
  from bloqade.analysis.address import AddressAnalysis
35
36
  from bloqade.analysis.measure_id import MeasurementIDAnalysis
37
+ from bloqade.squin.rewrite.desugar import ApplyDesugarRule
36
38
 
37
39
  from .simplify_ifs import StimSimplifyIfs
38
40
  from ..rewrite.ifs_to_stim import IfToStim
39
41
 
40
42
 
43
+ @dataclass
44
+ class AggressiveForLoopUnroll(Pass):
45
+ """
46
+ Aggressive unrolling of for loops, addresses cases where unroll
47
+ does not successfully handle nested loops because of a lack of constprop.
48
+
49
+ This should be invoked via fixpoint to let this be repeatedly applied until
50
+ no further rewrites are possible.
51
+ """
52
+
53
+ def unsafe_run(self, mt: Method) -> RewriteResult:
54
+ rule = Chain(
55
+ InlineGetField(),
56
+ InlineGetItem(),
57
+ scf.unroll.ForLoop(),
58
+ scf.trim.UnusedYield(),
59
+ )
60
+
61
+ # Intentionally only walk ONCE, let fixpoint happen with the WHOLE pass
62
+ # so that HintConst gets run right after, allowing subsequent unrolls to happen
63
+ rewrite_result = Walk(rule).rewrite(mt.code)
64
+
65
+ rewrite_result = (
66
+ HintConst(dialects=mt.dialects, no_raise=self.no_raise)
67
+ .unsafe_run(mt)
68
+ .join(rewrite_result)
69
+ )
70
+
71
+ return rewrite_result
72
+
73
+
41
74
  @dataclass
42
75
  class SquinToStimPass(Pass):
43
76
 
@@ -48,27 +81,24 @@ class SquinToStimPass(Pass):
48
81
  dialects=mt.dialects, no_raise=self.no_raise
49
82
  ).unsafe_run(mt)
50
83
 
51
- rule = Chain(
52
- InlineGetField(),
53
- InlineGetItem(),
54
- scf.unroll.ForLoop(),
55
- scf.trim.UnusedYield(),
84
+ rewrite_result = (
85
+ AggressiveForLoopUnroll(dialects=mt.dialects, no_raise=self.no_raise)
86
+ .fixpoint(mt)
87
+ .join(rewrite_result)
56
88
  )
57
- rewrite_result = Fixpoint(Walk(rule)).rewrite(mt.code).join(rewrite_result)
58
- # fold_pass = Fold(mt.dialects, no_raise=self.no_raise)
59
- # rewrite_result = fold_pass(mt)
89
+
60
90
  rewrite_result = (
61
91
  Walk(Fixpoint(CFGCompactify())).rewrite(mt.code).join(rewrite_result)
62
92
  )
93
+
94
+ Walk(InlineAlias()).rewrite(mt.code).join(rewrite_result)
95
+
63
96
  rewrite_result = (
64
97
  StimSimplifyIfs(mt.dialects, no_raise=self.no_raise)
65
98
  .unsafe_run(mt)
66
99
  .join(rewrite_result)
67
100
  )
68
101
 
69
- # run typeinfer again after unroll etc. because we now insert
70
- # a lot of new nodes, which might have more precise types
71
- # self.typeinfer.unsafe_run(mt)
72
102
  rewrite_result = (
73
103
  Walk(Chain(ilist.rewrite.ConstList2IList(), ilist.rewrite.Unroll()))
74
104
  .rewrite(mt.code)
@@ -82,6 +112,9 @@ class SquinToStimPass(Pass):
82
112
  .join(rewrite_result)
83
113
  )
84
114
 
115
+ TypeInfer(dialects=mt.dialects, no_raise=self.no_raise).unsafe_run(mt)
116
+ Walk(ApplyDesugarRule()).rewrite(mt.code)
117
+
85
118
  # after this the program should be in a state where it is analyzable
86
119
  # -------------------------------------------------------------------
87
120
 
@@ -99,12 +132,14 @@ class SquinToStimPass(Pass):
99
132
  )
100
133
 
101
134
  # 2. rewrite
135
+ ## Invoke DCE afterwards to eliminate any GetItems
136
+ ## that are no longer being used. This allows for
137
+ ## SquinMeasureToStim to safely eliminate
138
+ ## unused measure statements.
102
139
  rewrite_result = (
103
- Walk(
104
- IfToStim(
105
- measure_analysis=meas_analysis_frame.entries,
106
- measure_count=mia.measure_count,
107
- )
140
+ Chain(
141
+ Walk(IfToStim(measure_frame=meas_analysis_frame)),
142
+ Fixpoint(Walk(DeadCodeElimination())),
108
143
  )
109
144
  .rewrite(mt.code)
110
145
  .join(rewrite_result)
@@ -120,17 +155,15 @@ class SquinToStimPass(Pass):
120
155
  Walk(
121
156
  Chain(
122
157
  SquinQubitToStim(),
158
+ SquinMeasureToStim(),
123
159
  SquinWireToStim(),
124
- SquinMeasureToStim(
125
- measure_id_result=meas_analysis_frame.entries,
126
- total_measure_count=mia.measure_count,
127
- ), # reduce duplicated logic, can split out even more rules later
128
160
  SquinWireIdentityElimination(),
129
161
  )
130
162
  )
131
163
  .rewrite(mt.code)
132
164
  .join(rewrite_result)
133
165
  )
166
+
134
167
  rewrite_result = (
135
168
  CanonicalizeIList(dialects=mt.dialects, no_raise=self.no_raise)
136
169
  .unsafe_run(mt)
@@ -1,3 +1,4 @@
1
+ from .ifs_to_stim import IfToStim as IfToStim
1
2
  from .squin_noise import SquinNoiseToStim as SquinNoiseToStim
2
3
  from .wire_to_stim import SquinWireToStim as SquinWireToStim
3
4
  from .qubit_to_stim import SquinQubitToStim as SquinQubitToStim
@@ -11,9 +11,9 @@ from bloqade.stim.rewrite.util import (
11
11
  SQUIN_STIM_CONTROL_GATE_MAPPING,
12
12
  insert_qubit_idx_from_address,
13
13
  )
14
+ from bloqade.analysis.measure_id import MeasureIDFrame
14
15
  from bloqade.stim.dialects.auxiliary import GetRecord
15
16
  from bloqade.analysis.measure_id.lattice import (
16
- MeasureId,
17
17
  MeasureIdBool,
18
18
  )
19
19
 
@@ -127,8 +127,7 @@ class IfToStim(IfElseSimplification, RewriteRule):
127
127
  Rewrite if statements to stim equivalent statements.
128
128
  """
129
129
 
130
- measure_analysis: dict[ir.SSAValue, MeasureId]
131
- measure_count: int
130
+ measure_frame: MeasureIDFrame
132
131
 
133
132
  def rewrite_Statement(self, node: ir.Statement) -> RewriteResult:
134
133
 
@@ -140,7 +139,7 @@ class IfToStim(IfElseSimplification, RewriteRule):
140
139
 
141
140
  def rewrite_IfElse(self, stmt: scf.IfElse) -> RewriteResult:
142
141
 
143
- if not isinstance(self.measure_analysis[stmt.cond], MeasureIdBool):
142
+ if not isinstance(self.measure_frame.entries[stmt.cond], MeasureIdBool):
144
143
  return RewriteResult()
145
144
 
146
145
  # check that there is only qubit.Apply in the then-body,
@@ -161,12 +160,12 @@ class IfToStim(IfElseSimplification, RewriteRule):
161
160
  return RewriteResult()
162
161
 
163
162
  # get necessary measurement ID type from analysis
164
- measure_id_bool = self.measure_analysis[stmt.cond]
163
+ measure_id_bool = self.measure_frame.entries[stmt.cond]
165
164
  assert isinstance(measure_id_bool, MeasureIdBool)
166
165
 
167
166
  # generate get record statement
168
167
  measure_id_idx_stmt = py.Constant(
169
- (measure_id_bool.idx - 1) - self.measure_count
168
+ (measure_id_bool.idx - 1) - self.measure_frame.num_measures_at_stmt[stmt]
170
169
  )
171
170
  get_record_stmt = GetRecord(id=measure_id_idx_stmt.result) # noqa: F841
172
171
 
@@ -2,47 +2,16 @@
2
2
  from dataclasses import dataclass
3
3
 
4
4
  from kirin import ir
5
- from kirin.dialects import py, ilist
5
+ from kirin.dialects import py
6
6
  from kirin.rewrite.abc import RewriteRule, RewriteResult
7
7
 
8
8
  from bloqade.squin import wire, qubit
9
9
  from bloqade.squin.rewrite import AddressAttribute
10
- from bloqade.stim.dialects import collapse, auxiliary
10
+ from bloqade.stim.dialects import collapse
11
11
  from bloqade.stim.rewrite.util import (
12
12
  is_measure_result_used,
13
13
  insert_qubit_idx_from_address,
14
14
  )
15
- from bloqade.analysis.measure_id.lattice import MeasureId, MeasureIdBool, MeasureIdTuple
16
-
17
-
18
- def replace_get_record(
19
- node: ir.Statement, measure_id_bool: MeasureIdBool, meas_count: int
20
- ):
21
- assert isinstance(measure_id_bool, MeasureIdBool)
22
- target_rec_idx = (measure_id_bool.idx - 1) - meas_count
23
- idx_stmt = py.constant.Constant(target_rec_idx)
24
- idx_stmt.insert_before(node)
25
- get_record_stmt = auxiliary.GetRecord(idx_stmt.result)
26
- node.replace_by(get_record_stmt)
27
-
28
-
29
- def insert_get_record_list(
30
- node: ir.Statement, measure_id_tuple: MeasureIdTuple, meas_count: int
31
- ):
32
- """
33
- Insert GetRecord statements before the given node
34
- """
35
- get_record_ssas = []
36
- for measure_id_bool in measure_id_tuple.data:
37
- assert isinstance(measure_id_bool, MeasureIdBool)
38
- target_rec_idx = (measure_id_bool.idx - 1) - meas_count
39
- idx_stmt = py.constant.Constant(target_rec_idx)
40
- idx_stmt.insert_before(node)
41
- get_record_stmt = auxiliary.GetRecord(idx_stmt.result)
42
- get_record_stmt.insert_before(node)
43
- get_record_ssas.append(get_record_stmt.result)
44
-
45
- node.replace_by(ilist.New(values=get_record_ssas))
46
15
 
47
16
 
48
17
  @dataclass
@@ -51,9 +20,6 @@ class SquinMeasureToStim(RewriteRule):
51
20
  Rewrite squin measure-related statements to stim statements.
52
21
  """
53
22
 
54
- measure_id_result: dict[ir.SSAValue, MeasureId]
55
- total_measure_count: int
56
-
57
23
  def rewrite_Statement(self, node: ir.Statement) -> RewriteResult:
58
24
 
59
25
  match node:
@@ -70,10 +36,6 @@ class SquinMeasureToStim(RewriteRule):
70
36
  if qubit_idx_ssas is None:
71
37
  return RewriteResult()
72
38
 
73
- measure_id = self.measure_id_result[measure_stmt.result]
74
- if not isinstance(measure_id, (MeasureIdBool, MeasureIdTuple)):
75
- return RewriteResult()
76
-
77
39
  prob_noise_stmt = py.constant.Constant(0.0)
78
40
  stim_measure_stmt = collapse.MZ(
79
41
  p=prob_noise_stmt.result,
@@ -84,27 +46,6 @@ class SquinMeasureToStim(RewriteRule):
84
46
 
85
47
  if not is_measure_result_used(measure_stmt):
86
48
  measure_stmt.delete()
87
- return RewriteResult(has_done_something=True)
88
-
89
- # replace dataflow with new stmt!
90
- measure_id = self.measure_id_result[measure_stmt.result]
91
- if isinstance(measure_id, MeasureIdBool):
92
- replace_get_record(
93
- node=measure_stmt,
94
- measure_id_bool=measure_id,
95
- meas_count=self.total_measure_count,
96
- )
97
- elif isinstance(measure_id, MeasureIdTuple):
98
- insert_get_record_list(
99
- node=measure_stmt,
100
- measure_id_tuple=measure_id,
101
- meas_count=self.total_measure_count,
102
- )
103
- else:
104
- # already checked before, so this should not happen
105
- raise ValueError(
106
- f"Unexpected measure ID type: {type(measure_id)} for measure statement {measure_stmt}"
107
- )
108
49
 
109
50
  return RewriteResult(has_done_something=True)
110
51
 
@@ -0,0 +1,141 @@
1
+ from kirin.passes import HintConst
2
+ from kirin.dialects import scf
3
+
4
+ from bloqade.squin import op, qubit, kernel
5
+ from bloqade.analysis.measure_id import MeasurementIDAnalysis
6
+ from bloqade.analysis.measure_id.lattice import (
7
+ NotMeasureId,
8
+ MeasureIdBool,
9
+ MeasureIdTuple,
10
+ )
11
+
12
+
13
+ def results_at(kern, block_id, stmt_id):
14
+ return kern.code.body.blocks[block_id].stmts.at(stmt_id).results # type: ignore
15
+
16
+
17
+ def test_add():
18
+ @kernel
19
+ def test():
20
+
21
+ ql1 = qubit.new(5)
22
+ ql2 = qubit.new(5)
23
+ qubit.broadcast(op.x(), ql1)
24
+ qubit.broadcast(op.x(), ql2)
25
+ ml1 = qubit.measure(ql1)
26
+ ml2 = qubit.measure(ql2)
27
+ return ml1 + ml2
28
+
29
+ frame, _ = MeasurementIDAnalysis(test.dialects).run_analysis(test)
30
+
31
+ measure_id_tuples = [
32
+ value for value in frame.entries.values() if isinstance(value, MeasureIdTuple)
33
+ ]
34
+
35
+ # construct expected MeasureIdTuple
36
+ expected_measure_id_tuple = MeasureIdTuple(
37
+ data=tuple([MeasureIdBool(idx=i) for i in range(1, 11)])
38
+ )
39
+ assert measure_id_tuples[-1] == expected_measure_id_tuple
40
+
41
+
42
+ def test_measure_alias():
43
+
44
+ @kernel
45
+ def test():
46
+ ql = qubit.new(5)
47
+ ml = qubit.measure(ql)
48
+ ml_alias = ml
49
+
50
+ return ml_alias
51
+
52
+ frame, _ = MeasurementIDAnalysis(test.dialects).run_analysis(test)
53
+
54
+ test.print(analysis=frame.entries)
55
+
56
+ # Collect MeasureIdTuples
57
+ measure_id_tuples = [
58
+ value for value in frame.entries.values() if isinstance(value, MeasureIdTuple)
59
+ ]
60
+
61
+ # construct expected MeasureIdTuple
62
+ expected_measure_id_tuple = MeasureIdTuple(
63
+ data=tuple([MeasureIdBool(idx=i) for i in range(1, 6)])
64
+ )
65
+
66
+ assert len(measure_id_tuples) == 2
67
+ assert all(
68
+ measure_id_tuple == expected_measure_id_tuple
69
+ for measure_id_tuple in measure_id_tuples
70
+ )
71
+
72
+
73
+ def test_measure_count_at_if_else():
74
+
75
+ @kernel
76
+ def test():
77
+ q = qubit.new(5)
78
+ qubit.apply(op.x(), q[2])
79
+ ms = qubit.measure(q)
80
+
81
+ if ms[1]:
82
+ qubit.apply(op.x(), q[0])
83
+
84
+ if ms[3]:
85
+ qubit.apply(op.y(), q[1])
86
+
87
+ frame, _ = MeasurementIDAnalysis(test.dialects).run_analysis(test)
88
+
89
+ assert all(
90
+ isinstance(stmt, scf.IfElse) and measures_accumulated == 5
91
+ for stmt, measures_accumulated in frame.num_measures_at_stmt.items()
92
+ )
93
+
94
+
95
+ def test_scf_cond_true():
96
+ @kernel
97
+ def test():
98
+ q = qubit.new(1)
99
+ qubit.apply(op.x(), q[2])
100
+
101
+ ms = None
102
+ cond = True
103
+ if cond:
104
+ ms = qubit.measure(q)
105
+ else:
106
+ ms = qubit.measure(q[0])
107
+
108
+ return ms
109
+
110
+ HintConst(dialects=test.dialects).unsafe_run(test)
111
+ frame, _ = MeasurementIDAnalysis(test.dialects).run_analysis(test)
112
+
113
+ assert [frame.entries[result] for result in results_at(test, 0, 7)] == [
114
+ NotMeasureId(),
115
+ MeasureIdTuple((MeasureIdBool(idx=1),)),
116
+ ]
117
+
118
+
119
+ def test_scf_cond_false():
120
+
121
+ @kernel
122
+ def test():
123
+ q = qubit.new(5)
124
+ qubit.apply(op.x(), q[2])
125
+
126
+ ms = None
127
+ cond = False
128
+ if cond:
129
+ ms = qubit.measure(q)
130
+ else:
131
+ ms = qubit.measure(q[0])
132
+
133
+ return ms
134
+
135
+ HintConst(dialects=test.dialects).unsafe_run(test)
136
+ frame, _ = MeasurementIDAnalysis(test.dialects).run_analysis(test)
137
+
138
+ assert [frame.entries[result] for result in results_at(test, 0, 7)] == [
139
+ NotMeasureId(),
140
+ MeasureIdBool(idx=1),
141
+ ]
@@ -0,0 +1,3 @@
1
+ I_ERROR[loss](0.10000000) 0
2
+ I_ERROR[loss](0.10000000) 1
3
+ I_ERROR[loss](0.10000000) 2
@@ -0,0 +1,8 @@
1
+
2
+ MZ(0.00000000) 0 1 2 3
3
+ CZ rec[-4] 0
4
+ MZ(0.00000000) 0 1 2 3
5
+ CX rec[-4] 1
6
+ MZ(0.00000000) 0 1 2 3
7
+ CY rec[-4] 2
8
+ CZ rec[-1] 3
@@ -0,0 +1,7 @@
1
+
2
+ MZ(0.00000000) 0 1 2 3
3
+ CZ rec[-4] 0
4
+ MZ(0.00000000) 0 1 2 3
5
+ CX rec[-4] 0
6
+ MZ(0.00000000) 0 1 2 3
7
+ CY rec[-12] 1
@@ -0,0 +1,8 @@
1
+
2
+ MZ(0.00000000) 0 1 2 3
3
+ CZ rec[-4] 0
4
+ CX rec[-4] 1 rec[-4] 2 rec[-4] 3
5
+ CZ rec[-4] 0 rec[-4] 1 rec[-4] 2 rec[-4] 3
6
+ CX rec[-3] 0
7
+ CY rec[-3] 1
8
+ MZ(0.00000000) 0 1 2 3