I'm trying to write code in QASM 3 and this is the only compiler I found. I'm having problems with slicing classical registers as shown below:
OPENQASM 3;
bit c[8]="01010101";
print(c[0:4]);
gives me:
bash-5.1$ qcor -qpu aer -shots 1 test.qasm -o test
[OPENQASM3 MLIRGen] cannot parse the source.
error: no viable alternative at input 'print(c[0:'
occurred at test:3:9, offending symbol = :
[qcor-exec] fatal error.
Am I doing something wrong?
Using let it seems that it somehow thinks is a qubit array:
OPENQASM 3;
bit c[8]="01010101";
let slice = c[0:4];
print(slice);
gives me:
bash-5.1$ qcor -qpu aer -shots 1 test.qasm -o test
[OPENQASM3 MLIRGen] Error
Could not infer qubit[] size from block argument. No size attribute for variable in symbol table.
[qcor-exec] fatal error.
I don't know if I'm making something wrong or if there's an error in qcor.
I'm trying to write code in QASM 3 and this is the only compiler I found. I'm having problems with slicing classical registers as shown below:
gives me:
Am I doing something wrong?
Using let it seems that it somehow thinks is a qubit array:
gives me:
I don't know if I'm making something wrong or if there's an error in qcor.