FA-91312 / Quantum circuit simulation / Member archive
Register expansion resolves measure targets among quantum registers · case 02
measure q[0] -> c[0] reports "unknown-register" for the creg c.
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 0 | ["unknown-register", 3] | [["h", [0]], ["measure", 1, 0]] | 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 ↗