Aliased bits can be used in combination with global qubits. Eg -
OPENQASM 3;
include "stdgates.inc";
qubit[4] q;
bit[4] c;
let alias = q[0:2];
h q;
measure q -> c;
if(c[1] == 1){
cx alias[1], q[2];
}
The semantic check currently raises the error -
pyqasm.exceptions.ValidationError: Missing register declaration for q in operation QuantumGate ...
Reason is that while getting the bits of cx alias[1], q[2]; we force alias replacement for all bits. This is an incorrect assumption as q[2] is a not an aliased bit.
Summary of changes
cx alias[1], q[2];
we force alias replacement for all bits. This is an incorrect assumption asq[2]
is a not an aliased bit.