Closed GiggleLiu closed 4 years ago
Now the following example works perfectly, isn't this amazing @Roger-luo @wangleiphy
julia> src1 = """
OPENQASM 2.0;
gate cu1(theta) a,b
{
U(0,0,theta/2) a;
CX a,b;
U(0,0,-theta/2) b;
}
qreg q[3];
qreg a[2];
creg c[3];
creg syn[2];
cu1(pi/2) q[0],q[1];
"""
"OPENQASM 2.0;\n\ngate cu1(theta) a,b\n{\n U(0,0,theta/2) a;\n CX a,b;\n U(0,0,-theta/2) b;\n}\n\nqreg q[3];\nqreg a[2];\ncreg c[3];\ncreg syn[2];\ncu1(pi/2) q[0],q[1];\n"
julia> circ = @eval $(trans(parse_qasm(lex(src1))))
nqubits: 5
chain
├─ put on (1)
│ └─ chain
│ ├─ rot(Z gate, 0.7853981633974483)
│ ├─ rot(Y gate, 0)
│ └─ rot(Z gate, 0)
├─ control(1)
│ └─ (2,) X gate
└─ put on (2)
└─ chain
├─ rot(Z gate, -0.7853981633974483)
├─ rot(Y gate, 0)
└─ rot(Z gate, 0)
can you fix the CI? @GiggleLiu the PR looks good in general. I'd like to merge it and register the package first.
Changes
MEASURE
,RESET
andBarrier
Notes
MEASURE
should be a view of classical register, likeview(c, [2,3])
, is this possible?