Skip to content

Commit 2fbfff5

Browse files
committed
make dialect key for noise.native more precise
1 parent bbeca77 commit 2fbfff5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from kirin import ir
22

3-
dialect = ir.Dialect("native")
3+
dialect = ir.Dialect("noise.native")

test/qasm2/emit/test_extended_noise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def main():
4949

5050
target = qasm2.emit.QASM2(allow_noise=True, allow_parallel=True)
5151
out = target.emit_str(main)
52-
expected = """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
52+
expected = """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
5353
include "qelib1.inc";
5454
qreg qreg[4];
5555
CX qreg[0], qreg[1];

test/qasm2/emit/test_qasm2_emit.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def glob_u():
2020
qasm2_str = target.emit_str(glob_u)
2121
assert (
2222
qasm2_str
23-
== """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.uop,scf};
23+
== """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.uop,scf};
2424
include "qelib1.inc";
2525
qreg qreg[3];
2626
qreg qreg1[3];
@@ -46,7 +46,7 @@ def glob_u():
4646
print(qasm2_str)
4747
assert (
4848
qasm2_str
49-
== """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
49+
== """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
5050
include "qelib1.inc";
5151
qreg qreg[3];
5252
qreg qreg1[3];
@@ -102,7 +102,7 @@ def glob_u():
102102

103103
assert (
104104
qasm2_str
105-
== """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
105+
== """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
106106
include "qelib1.inc";
107107
qreg qreg[3];
108108
qreg qreg1[3];
@@ -160,7 +160,7 @@ def para_u():
160160
qasm2_str = target.emit_str(para_u)
161161
assert (
162162
qasm2_str
163-
== """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
163+
== """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
164164
include "qelib1.inc";
165165
qreg qreg[3];
166166
parallel.U(0.1, 0.2, 0.3) {
@@ -188,7 +188,7 @@ def para_u():
188188
qasm2_str = target.emit_str(para_u)
189189
assert (
190190
qasm2_str
191-
== """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
191+
== """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.parallel,qasm2.uop,scf};
192192
include "qelib1.inc";
193193
qreg qreg[3];
194194
parallel.U(0.1, 0.2, 0.3) {
@@ -217,7 +217,7 @@ def para_u():
217217
print(qasm2_str)
218218
assert (
219219
qasm2_str
220-
== """KIRIN {func,lowering.call,lowering.func,native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.uop,scf};
220+
== """KIRIN {func,lowering.call,lowering.func,noise.native,py.ilist,qasm2.core,qasm2.expr,qasm2.glob,qasm2.indexing,qasm2.uop,scf};
221221
include "qelib1.inc";
222222
qreg qreg[3];
223223
U(0.1, 0.2, 0.3) qreg[1];

0 commit comments

Comments
 (0)