Environment
- PyQASM version: 1.0.1
- Python version:
- Operating system:
What happened?
The following code produced an unroll error -
from pyqasm import loads
qasm = """
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[2] c;
def my_gate(qubit q) {
for int i in [0:3] {
h q;
}
}
my_gate(q[1]);
"""
mod = loads(qasm)
mod.unroll()
ERROR:pyqasm: Error at line 10, column 4 in QASM file
>>>>>> h q[1]
.....
Failed to parse QASM: Index 1 out of range for register of size 1 in qubit
However, this works with a call to my_gate(q[0]).
Suggestions (Optional)
The qubit index is not being propagated correctly, should be 0 instead of 1 in the method definition
Environment
What happened?
The following code produced an unroll error -
However, this works with a call to
my_gate(q[0]).Suggestions (Optional)
The qubit index is not being propagated correctly, should be 0 instead of 1 in the method definition