Open vadym-kl opened 5 years ago
What is the expected output?
I'm not sure what the flat QASM (scaffold.sh -f
) output should be exactly, but the OpenQASM (scaffold.sh -b
) output has a similar problem:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
h q[0];
h q[1];
cx q[1],q[2];
cx q[0],q[1];
h q[0];
measure q[0] -> ;
z q[2];
measure q[1] -> ;
x q[2];
h q[2];
measure q[2] -> ;
The measurement results are not assigned correctly, and z q[2]
and x q[2]
, which should be conditioned on the results, are applied unconditionally. I would expect something like:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
h q[0];
h q[1];
cx q[1],q[2];
cx q[0],q[1];
h q[0];
measure q[0] -> m1;
if (m1 == 1) z q[2];
measure q[1] -> m2;
if (m2 == 1) x q[2];
h q[2];
measure q[2] -> m3;
The code below
Produces the following QASM file :
The QASM was obtained by running
scaffold.sh -f teleport.scaffold
onepiqc/scaffcc
Docker image.