File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/bloqade/qasm2/rewrite Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 77from ..dialects .expr .stmts import GateFunction
88
99# TODO: unify with PR #248
10- AllowedThenType = SingleQubitGate | TwoQubitCtrlGate | Measure | GateFunction | Reset
10+ AllowedThenType = SingleQubitGate | TwoQubitCtrlGate | Measure | Reset
1111
1212DontLiftType = AllowedThenType | scf .Yield | func .Return
1313
@@ -22,7 +22,15 @@ def rewrite_Statement(self, node: ir.Statement) -> RewriteResult:
2222 then_stmts = node .then_body .stmts ()
2323
2424 # TODO: should we leave QRegGet in?
25- lift_stmts = [stmt for stmt in then_stmts if not isinstance (stmt , DontLiftType )]
25+ lift_stmts : list [ir .Statement ] = []
26+ for stmt in then_stmts :
27+ if isinstance (stmt , DontLiftType ):
28+ continue
29+
30+ if isinstance (stmt , func .Invoke ) and isinstance (stmt .callee , GateFunction ):
31+ continue
32+
33+ lift_stmts .append (stmt )
2634
2735 for stmt in lift_stmts :
2836 stmt .detach ()
You can’t perform that action at this time.
0 commit comments