Open p51lee opened 7 months ago
The same issue occurs with the c3sqrtx
gate.
Oops. I'll take a look.
With #1300 the behaviour changed so that all boxes are decomposed before conversion to QASM. This makes the resulting QASM correct, though more verbose:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
u3(0.5*pi,0.0*pi,1.0*pi) q[2];
u3(0.0*pi,0.0*pi,0.25*pi) q[2];
cx q[1],q[2];
u3(0.0*pi,0.0*pi,1.75*pi) q[2];
cx q[0],q[2];
u3(0.0*pi,0.0*pi,0.25*pi) q[2];
cx q[1],q[2];
u3(0.0*pi,0.0*pi,1.75*pi) q[2];
u3(0.5*pi,0.0*pi,1.0*pi) q[2];
Maybe decomposing all boxes was the wrong idea for that fix. Will have a think if there is a better way.
This issue has been automatically marked as stale.
Overview
Exporting a qasm code that includes an
rccx
gate usingcircuit_to_qasm_str
function results in a syntax error.Example and reproduction steps
Consider the following Python code:
Observed
The resulting QASM code contains an unclosed parenthesis:
As defined in qelib1.inc, the last line should be
rccx q[0],q[1],q[2];
.