π€ AI text below π€
The OpenQASM frontend accepts only a single index in a subscript. Any range is rejected at the ::
h q[0:2]; // error: expected ']', got ':'
parseDesignator parses [, then one expression, then expects ], so this affects every subscript position, including gate operands, measure, and declarations. Constant and dynamic bounds fail alike, and the optional step form q[a:b:c] fails too.
Slices are needed for gates that act on part of a register, for example the multi-controlled ctrl(n-1) @ z q[0:n-2], flag in Grover's algorithm.
π€ AI text below π€
The OpenQASM frontend accepts only a single index in a subscript. Any range is rejected at the
::parseDesignatorparses[, then one expression, then expects], so this affects every subscript position, including gate operands,measure, and declarations. Constant and dynamic bounds fail alike, and the optional step formq[a:b:c]fails too.Slices are needed for gates that act on part of a register, for example the multi-controlled
ctrl(n-1) @ z q[0:n-2], flagin Grover's algorithm.