bloqade-circuit 0.3.0__py3-none-any.whl → 0.4.1__py3-none-any.whl

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 (69) hide show
  1. bloqade/analysis/address/impls.py +3 -16
  2. bloqade/pyqrack/__init__.py +1 -1
  3. bloqade/pyqrack/noise/native.py +8 -8
  4. bloqade/pyqrack/squin/noise/__init__.py +1 -0
  5. bloqade/pyqrack/squin/noise/native.py +72 -0
  6. bloqade/pyqrack/squin/op.py +7 -0
  7. bloqade/pyqrack/squin/qubit.py +0 -29
  8. bloqade/pyqrack/squin/runtime.py +18 -0
  9. bloqade/pyqrack/squin/wire.py +0 -36
  10. bloqade/{noise/native → qasm2/dialects/noise}/__init__.py +1 -7
  11. bloqade/qasm2/dialects/noise/_dialect.py +3 -0
  12. bloqade/{noise → qasm2/dialects/noise}/fidelity.py +2 -2
  13. bloqade/qasm2/dialects/noise/model.py +278 -0
  14. bloqade/qasm2/emit/impls/__init__.py +1 -1
  15. bloqade/qasm2/emit/impls/{noise_native.py → noise.py} +11 -11
  16. bloqade/qasm2/emit/main.py +2 -4
  17. bloqade/qasm2/emit/target.py +3 -3
  18. bloqade/qasm2/groups.py +0 -2
  19. bloqade/{noise/native/_wrappers.py → qasm2/noise.py} +9 -5
  20. bloqade/qasm2/passes/glob.py +12 -8
  21. bloqade/qasm2/passes/noise.py +5 -14
  22. bloqade/qasm2/rewrite/__init__.py +2 -0
  23. bloqade/qasm2/rewrite/noise/__init__.py +0 -0
  24. bloqade/qasm2/rewrite/{heuristic_noise.py → noise/heuristic_noise.py} +31 -53
  25. bloqade/{noise/native/rewrite.py → qasm2/rewrite/noise/remove_noise.py} +2 -2
  26. bloqade/qbraid/lowering.py +8 -8
  27. bloqade/squin/__init__.py +16 -1
  28. bloqade/squin/analysis/nsites/impls.py +0 -9
  29. bloqade/squin/cirq/__init__.py +89 -0
  30. bloqade/squin/cirq/lowering.py +303 -0
  31. bloqade/squin/groups.py +7 -7
  32. bloqade/squin/lowering.py +27 -0
  33. bloqade/squin/noise/__init__.py +3 -1
  34. bloqade/squin/noise/_wrapper.py +7 -3
  35. bloqade/squin/noise/rewrite.py +111 -0
  36. bloqade/squin/noise/stmts.py +21 -16
  37. bloqade/squin/op/__init__.py +1 -0
  38. bloqade/squin/op/_wrapper.py +4 -0
  39. bloqade/squin/op/stmts.py +10 -11
  40. bloqade/squin/op/types.py +2 -0
  41. bloqade/squin/qubit.py +32 -37
  42. bloqade/squin/rewrite/desugar.py +65 -0
  43. bloqade/squin/rewrite/qubit_to_stim.py +0 -23
  44. bloqade/squin/rewrite/squin_measure.py +2 -27
  45. bloqade/squin/rewrite/stim_rewrite_util.py +3 -8
  46. bloqade/squin/rewrite/wire_to_stim.py +0 -21
  47. bloqade/squin/wire.py +4 -9
  48. bloqade/stim/__init__.py +2 -1
  49. bloqade/stim/_wrappers.py +4 -0
  50. bloqade/stim/dialects/auxiliary/__init__.py +1 -0
  51. bloqade/stim/dialects/auxiliary/emit.py +17 -2
  52. bloqade/stim/dialects/auxiliary/stmts/__init__.py +1 -0
  53. bloqade/stim/dialects/auxiliary/stmts/annotate.py +8 -0
  54. bloqade/stim/dialects/collapse/emit_str.py +3 -1
  55. bloqade/stim/dialects/gate/emit.py +9 -2
  56. bloqade/stim/dialects/noise/emit.py +32 -1
  57. bloqade/stim/dialects/noise/stmts.py +29 -0
  58. bloqade/stim/parse/__init__.py +1 -0
  59. bloqade/stim/parse/lowering.py +686 -0
  60. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/METADATA +3 -1
  61. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/RECORD +64 -57
  62. bloqade/noise/__init__.py +0 -2
  63. bloqade/noise/native/_dialect.py +0 -3
  64. bloqade/noise/native/model.py +0 -346
  65. bloqade/qasm2/dialects/noise.py +0 -48
  66. bloqade/squin/rewrite/measure_desugar.py +0 -33
  67. /bloqade/{noise/native → qasm2/dialects/noise}/stmts.py +0 -0
  68. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/WHEEL +0 -0
  69. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,33 +0,0 @@
1
- from kirin import ir, types
2
- from kirin.dialects import ilist
3
- from kirin.rewrite.abc import RewriteRule, RewriteResult
4
-
5
- from bloqade.squin.qubit import QubitType, MeasureAny, MeasureQubit, MeasureQubitList
6
-
7
-
8
- class MeasureDesugarRule(RewriteRule):
9
- """
10
- Desugar measure operations in the circuit.
11
- """
12
-
13
- def rewrite_Statement(self, node: ir.Statement) -> RewriteResult:
14
-
15
- if not isinstance(node, MeasureAny):
16
- return RewriteResult()
17
-
18
- if node.input.type.is_subseteq(QubitType):
19
- node.replace_by(
20
- MeasureQubit(
21
- qubit=node.input,
22
- )
23
- )
24
- return RewriteResult(has_done_something=True)
25
- elif node.input.type.is_subseteq(ilist.IListType[QubitType, types.Any]):
26
- node.replace_by(
27
- MeasureQubitList(
28
- qubits=node.input,
29
- )
30
- )
31
- return RewriteResult(has_done_something=True)
32
-
33
- return RewriteResult()
File without changes