FA-91048 / Quantum circuit simulation / Member archive
Direction fixer treats couplers as undirected · case 03
A CNOT against the native direction is emitted unchanged and would be rejected by the device.
Case contract
Input [edges, ops]; edges are directed native CNOT pairs [c, t]. Each ["cx", c, t] is kept if [c, t] is native, else rewritten as h c, h t, cx t c, h c, h t if [t, c] is native, else the result is ["unroutable", op index]; c == t gives ["invalid", op index]. Other ops pass through. A final stack pass cancels an ["h", q] against an identical immediately preceding ["h", q].
Why this case matters
Direction fixing is a mandatory transpiler pass for devices with directed couplers; errors either break hardware constraints or bloat circuits.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: random coupling 47 | [["cx", 2, 0], ["cx", 0, 1], ["cx", 2, 1]] | [["h", 2], ["h", 0], ["cx", 0, 2], ["h", 2], ["h", 1], ["cx", 1, 0], ["h", 0], ["h", 1], ["cx", 2, 1]] | 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 ↗