FA-91303 / Quantum circuit simulation / Member archive
Register expansion accepts index equal to register size · case 03
h q[2] on a two-qubit register maps to the first qubit of the next register (or a phantom qubit).
Case contract
Input a list of OpenQASM-2-like statements: "qreg n[k];", "creg n[k];", gate statements "g a,b;" and "measure a -> b;" where operands are whole registers or "n[i]". Registers are flattened in declaration order per kind (qubits and clbits have separate counters). Whole-register operands broadcast; a single qubit operand is reused across the broadcast. Return [[g, [flat qubits]] or ["measure", q, c]...] or [error, statement index] with errors "unknown-register", "index-out-of-range", "size-mismatch".
Why this case matters
Front-end register flattening decides which physical qubits every later pass touches; offset or broadcast slips silently rewire circuits.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: random program 46 | [["measure", 2, 1], ["cx", [3, 6]], ["cx", [4, 6]], ["cx", [5, 6]]] | ["index-out-of-range", 7] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗