I'm trying to write code in QASM 3 and this is the only compiler I found. I'm having problems indexing an array of classical bits using a variable as shown below:
OPENQASM 3;
int[32] pos=2;
bit c[8]="01010101";
print(c[pos]);
gives me:
bash-5.1$ qcor -qpu aer -shots 1 test.qasm -o test
[qcor-mlir] Reported Error: see current operation: %2 = "std.index_cast"(%0) : (memref<i32>) -> index
error: 'std.index_cast' op requires the same shape for all operands and results
[qcor-mlir-tool] MLIR-to-LLVM_MLIR lowering failed.
[qcor-exec] fatal error.
I'm trying to write code in QASM 3 and this is the only compiler I found. I'm having problems indexing an array of classical bits using a variable as shown below:
gives me:
Do I need to do some extra casting to do this?