You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix nested for-loop handling in squin -> stim pass (#394)
Previously, the following would cause the squin to stim pass to fail:
```python
for i in range(...):
for j in range(...):
qubit.apply(op.cx(), [q[i], q[j])
```
This was because the unroll rule was not successful in fully unrolling
the loops, getting (at most) one unroll before silently giving up. This
behavior was first identified by @liupengy19 and encountered more
recently by @ehua7365 as well.
@kaihsin pointed out to me that the problem might be because of a lack
of constprop occuring between each unroll. This turns out to be the case
and I've implemented a mini-pass that will do the constprop after each
unroll, with the pass itself applied via fixpoint instead of the more
traditional unsafe_run, single application style.
I've also taken the liberty to rename some of the tests to be a bit more
accurate and removed some outdated comments.
---------
Co-authored-by: David Plankensteiner <[email protected]>
0 commit comments