I am trying to get my first openqasm3.0 program and I am getting error messages that I cannot interpret.
Here is my program:
cloner1 = """
OPENQASM 3.0;
//include "qelib1.inc";
qubit[5] q;
bit[1] c;
x q[2];
x q[4];
x q[0]; //Set up input
measure q[0] -> c[0];
if (c[0]==1) {
CX q[1],q[2];
CX q[2],q[1];
CX q[1],q[2];
CX q[3],q[4];
CX q[4],q[3];
CX q[3],q[4];
}
measure q[1]->c[0];
measure q[3]->c[0];
"""
qc= QuantumCircuit.from_qasm_str(cloner1)
result = execute(qc, backend=qiskit.BasicAer.get_backend('qasm_simulator'),shots=1024).result()
counts = result.get_counts()
plot_histogram(counts)
THe error message I get is Error near line 4 Column 7 Expected an ID, received '['"
Apparently it doesn't like bit[1] c. But this is just like the code in the arxiv.org article
So I don't know what is wrong. It doesn't seem to be interpreting it as ASM3.0 code.