Closed p51lee closed 7 months ago
@meamy Any idea?
Hi there!
This is the output I get with the latest commit
OPENQASM 2.0;
include "qelib1.inc";
gate cx_o q0,q1 {
x q0;
cx q0,q1;
x q0;
}
qreg q[2];
creg c[2];
if (c==1) x q[0];
if (c==1) cx q[0],q[1];
if (c==1) x q[0];
which looks like the intended behaviour for this file. Note that we're constrained by the syntax of openQASM 2.0 to have an explicit if
statement for each gate in cx_o
.
Can you try pulling the latest source from the main branch and try? A little while back we fixed a missing feature which involved some code transformations inside if
blocks, due to the issue above where an if
block can only contain one command. I imagine what's happening is you have an older version of the inliner from before this was fixed.
I'll check out the latest commit. Thanks for the support!
Hello, I'm working with the inliner and it does not inline gates with
if
conditions.To reproduce this issue, inline the following
bug.qasm
:cx_o
gate is not inlined: