bloqade-circuit 0.7.3__py3-none-any.whl → 0.7.4__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.

Potentially problematic release.


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

@@ -1,5 +1,4 @@
1
1
  from .squin_to_stim import (
2
2
  SquinToStimPass as SquinToStimPass,
3
3
  StimSimplifyIfs as StimSimplifyIfs,
4
- AggressiveForLoopUnroll as AggressiveForLoopUnroll,
5
4
  )
@@ -1,23 +1,21 @@
1
1
  from dataclasses import dataclass
2
2
 
3
- from kirin.passes import Fold, HintConst, TypeInfer
3
+ from kirin.passes import Fold, TypeInfer
4
4
  from kirin.rewrite import (
5
5
  Walk,
6
6
  Chain,
7
7
  Fixpoint,
8
8
  CFGCompactify,
9
- InlineGetItem,
10
- InlineGetField,
11
9
  DeadCodeElimination,
12
10
  CommonSubexpressionElimination,
13
11
  )
14
- from kirin.dialects import scf, ilist
12
+ from kirin.dialects import ilist
15
13
  from kirin.ir.method import Method
16
14
  from kirin.passes.abc import Pass
17
15
  from kirin.rewrite.abc import RewriteResult
18
16
  from kirin.passes.inline import InlinePass
19
17
  from kirin.rewrite.alias import InlineAlias
20
- from kirin.dialects.scf.unroll import PickIfElse
18
+ from kirin.passes.aggressive import UnrollScf
21
19
 
22
20
  from bloqade.stim.rewrite import (
23
21
  SquinWireToStim,
@@ -41,37 +39,6 @@ from .simplify_ifs import StimSimplifyIfs
41
39
  from ..rewrite.ifs_to_stim import IfToStim
42
40
 
43
41
 
44
- @dataclass
45
- class AggressiveForLoopUnroll(Pass):
46
- """
47
- Aggressive unrolling of for loops, addresses cases where unroll
48
- does not successfully handle nested loops because of a lack of constprop.
49
-
50
- This should be invoked via fixpoint to let this be repeatedly applied until
51
- no further rewrites are possible.
52
- """
53
-
54
- def unsafe_run(self, mt: Method) -> RewriteResult:
55
- rule = Chain(
56
- InlineGetField(),
57
- InlineGetItem(),
58
- scf.unroll.ForLoop(),
59
- scf.trim.UnusedYield(),
60
- )
61
-
62
- # Intentionally only walk ONCE, let fixpoint happen with the WHOLE pass
63
- # so that HintConst gets run right after, allowing subsequent unrolls to happen
64
- rewrite_result = Walk(rule).rewrite(mt.code)
65
-
66
- rewrite_result = (
67
- HintConst(dialects=mt.dialects, no_raise=self.no_raise)
68
- .unsafe_run(mt)
69
- .join(rewrite_result)
70
- )
71
-
72
- return rewrite_result
73
-
74
-
75
42
  @dataclass
76
43
  class SquinToStimPass(Pass):
77
44
 
@@ -82,8 +49,11 @@ class SquinToStimPass(Pass):
82
49
  dialects=mt.dialects, no_raise=self.no_raise
83
50
  ).unsafe_run(mt)
84
51
 
52
+ rewrite_result = Walk(ilist.rewrite.HintLen()).rewrite(mt.code)
53
+ rewrite_result = Fold(self.dialects).unsafe_run(mt).join(rewrite_result)
54
+
85
55
  rewrite_result = (
86
- AggressiveForLoopUnroll(dialects=mt.dialects, no_raise=self.no_raise)
56
+ UnrollScf(dialects=mt.dialects, no_raise=self.no_raise)
87
57
  .fixpoint(mt)
88
58
  .join(rewrite_result)
89
59
  )
@@ -92,11 +62,7 @@ class SquinToStimPass(Pass):
92
62
  Walk(Fixpoint(CFGCompactify())).rewrite(mt.code).join(rewrite_result)
93
63
  )
94
64
 
95
- rewrite_result = (
96
- Walk(Chain(InlineAlias(), PickIfElse()))
97
- .rewrite(mt.code)
98
- .join(rewrite_result)
99
- )
65
+ rewrite_result = Walk(InlineAlias()).rewrite(mt.code).join(rewrite_result)
100
66
 
101
67
  rewrite_result = (
102
68
  StimSimplifyIfs(mt.dialects, no_raise=self.no_raise)
@@ -111,6 +77,12 @@ class SquinToStimPass(Pass):
111
77
  )
112
78
  rewrite_result = Fold(mt.dialects, no_raise=self.no_raise)(mt)
113
79
 
80
+ rewrite_result = (
81
+ UnrollScf(mt.dialects, no_raise=self.no_raise)
82
+ .fixpoint(mt)
83
+ .join(rewrite_result)
84
+ )
85
+
114
86
  rewrite_result = (
115
87
  CanonicalizeIList(dialects=mt.dialects, no_raise=self.no_raise)
116
88
  .unsafe_run(mt)
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bloqade-circuit
3
- Version: 0.7.3
3
+ Version: 0.7.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
7
7
  Requires-Python: >=3.10
8
- Requires-Dist: kirin-toolchain~=0.17.17
8
+ Requires-Dist: kirin-toolchain~=0.17.23
9
9
  Requires-Dist: numpy>=1.22.0
10
10
  Requires-Dist: pandas>=2.2.3
11
11
  Requires-Dist: pydantic<2.11.0,>=1.3.0
@@ -207,9 +207,9 @@ bloqade/stim/emit/__init__.py,sha256=N2dPQY7OyqPwHAStDeOgYg2yfxqxMOz-N7pD5Z4JwlI
207
207
  bloqade/stim/emit/stim_str.py,sha256=JyEBoIhLQASogZcUWHI9tMD4JoXYrEqUr2qaZ30gZdc,1491
208
208
  bloqade/stim/parse/__init__.py,sha256=l2DjReB2KkgrDjP_4nP6RnoziiOewoSeZfTno1sVYTw,59
209
209
  bloqade/stim/parse/lowering.py,sha256=L-IcR_exlxsTVv4SQ0bhzIF4_L82P-GEdK6qRd6B86Y,23723
210
- bloqade/stim/passes/__init__.py,sha256=aysjOZyn0IrJQCQBEqiz8pwZ5u5t2s9TmEzA9Y9KG9w,167
210
+ bloqade/stim/passes/__init__.py,sha256=hemzgyl_pwZi34secp1GqStAW0d09CEeKvLD0fXhbb8,111
211
211
  bloqade/stim/passes/simplify_ifs.py,sha256=zicqggWu_yzfrf2a7uUCt-ZenbYSEnFsyGxDfKw72qQ,1084
212
- bloqade/stim/passes/squin_to_stim.py,sha256=cDn4W9TEsCZQT5YhEMEId87LtLv4iqwaurwgTqtE1qQ,6421
212
+ bloqade/stim/passes/squin_to_stim.py,sha256=mqCspofBJ60YUU5dl7AdxmctmHygk1yeRr4ucgD9TbU,5620
213
213
  bloqade/stim/rewrite/__init__.py,sha256=zL5G73JEsXkehN7gCtUgGnmC2BJ3vKihOd1ohVwM68E,480
214
214
  bloqade/stim/rewrite/ifs_to_stim.py,sha256=A3SndoGinZHLul17zXWyQrK_1Hy5I4qvuOskLIeDRMU,6942
215
215
  bloqade/stim/rewrite/py_constant_to_stim.py,sha256=PV8bHvn759-d_0JW4akaGSORW_oxigrlUBhAC51PJAU,1354
@@ -232,7 +232,7 @@ bloqade/visual/animation/runtime/atoms.py,sha256=EmjxhujLiHHPS_HtH_B-7TiqeHgvW5u
232
232
  bloqade/visual/animation/runtime/ppoly.py,sha256=JB9IP53N1w6adBJEue6J5Nmj818Id9JvrlgrmiQTU1I,1385
233
233
  bloqade/visual/animation/runtime/qpustate.py,sha256=rlmxQeJSvaohXrTpXQL5y-NJcpvfW33xPaYM1slv7cc,4270
234
234
  bloqade/visual/animation/runtime/utils.py,sha256=ju9IzOWX-vKwfpqUjlUKu3Ssr_UFPFFq-tzH_Nqyo_c,1212
235
- bloqade_circuit-0.7.3.dist-info/METADATA,sha256=Bg7Nphnd5xlF_jANV1TK2wzCOlTGT0eHgXQfu8KIdPc,3850
236
- bloqade_circuit-0.7.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
237
- bloqade_circuit-0.7.3.dist-info/licenses/LICENSE,sha256=S5GIJwR6QCixPA9wryYb44ZEek0Nz4rt_zLUqP05UbU,13160
238
- bloqade_circuit-0.7.3.dist-info/RECORD,,
235
+ bloqade_circuit-0.7.4.dist-info/METADATA,sha256=pvbmLzuKl7jWDD9tjP6Z5VckwUv4sqUb00ArREsgXwo,3850
236
+ bloqade_circuit-0.7.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
237
+ bloqade_circuit-0.7.4.dist-info/licenses/LICENSE,sha256=S5GIJwR6QCixPA9wryYb44ZEek0Nz4rt_zLUqP05UbU,13160
238
+ bloqade_circuit-0.7.4.dist-info/RECORD,,