Skip to content

Commit 519f016

Browse files
committed
Fix qasm2 parallel & global rewrites
1 parent 7b2fce1 commit 519f016

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/bloqade/qasm2/emit/target.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ def emit(self, entry: ir.Method) -> ast.MainProgram:
106106
unroll_ifs=self.unroll_ifs,
107107
).fixpoint(entry)
108108

109-
# if not self.allow_global:
110-
# # rewrite global to parallel
111-
# GlobalToParallel(dialects=entry.dialects)(entry)
109+
if not self.allow_global:
110+
# rewrite global to parallel
111+
GlobalToParallel(dialects=entry.dialects)(entry)
112112

113-
# if not self.allow_parallel:
114-
# # rewrite parallel to uop
115-
# ParallelToUOp(dialects=entry.dialects)(entry)
113+
if not self.allow_parallel:
114+
# rewrite parallel to uop
115+
ParallelToUOp(dialects=entry.dialects)(entry)
116116

117117
Py2QASM(entry.dialects)(entry)
118118
target_main = EmitQASM2Main(self.main_target).initialize()

test/qasm2/emit/test_qasm2_emit.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def glob_u():
5454
)
5555

5656

57-
@pytest.mark.xfail(reason="Global and Parallel refactor still ongoing")
5857
def test_global():
5958

6059
@qasm2.extended
@@ -85,7 +84,6 @@ def glob_u():
8584
)
8685

8786

88-
@pytest.mark.xfail(reason="Global and Parallel refactor still ongoing")
8987
def test_global_allow_para():
9088

9189
@qasm2.extended
@@ -118,7 +116,6 @@ def glob_u():
118116
)
119117

120118

121-
@pytest.mark.xfail(reason="Global and Parallel refactor still ongoing")
122119
def test_para():
123120

124121
@qasm2.extended
@@ -145,7 +142,6 @@ def para_u():
145142
)
146143

147144

148-
@pytest.mark.xfail(reason="Global and Parallel refactor still ongoing")
149145
def test_para_allow_para():
150146

151147
@qasm2.extended
@@ -201,7 +197,6 @@ def para_u():
201197
)
202198

203199

204-
@pytest.mark.xfail(reason="Global and Parallel refactor still ongoing")
205200
def test_para_allow_global():
206201

207202
@qasm2.extended

0 commit comments

Comments
 (0)