FA-91302 / Quantum circuit simulation / Member archive
Register expansion accepts index equal to register size · case 02
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 59 | ["size-mismatch", 4] | ["index-out-of-range", 4] | 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 ↗