We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22934e9 commit 264a9fbCopy full SHA for 264a9fb
test/qasm2/passes/test_unroll_if.py
@@ -45,3 +45,30 @@ def main_unrolled():
45
ast_unrolled = target.emit(main_unrolled)
46
47
qasm2.parse.pprint(ast_unrolled)
48
+
49
50
+def test_nested_kernels():
51
+ @qasm2.main
52
+ def nested(q: qasm2.QReg, c: qasm2.CReg):
53
+ qasm2.h(q[0])
54
55
+ qasm2.measure(q, c)
56
+ if c[0] == 1:
57
+ qasm2.x(q[0])
58
+ qasm2.x(q[1])
59
60
+ return q
61
62
63
+ def main():
64
+ q = qasm2.qreg(2)
65
+ c = qasm2.creg(2)
66
67
+ nested(q, c)
68
69
+ return c
70
71
+ target = QASM2()
72
+ ast = target.emit(main)
73
74
+ qasm2.parse.pprint(ast)
0 commit comments