FA-90843 / Quantum circuit simulation / Member archive
Statevector CNOT swaps control and target roles · case 03
A Bell-pair circuit with CNOT(0,1) leaves the state as |+>|0> amplitudes on the wrong basis states whenever the control is not in superposition symmetrically.
Case contract
Input [n, gates]; start in |0...0>, apply gates h,x,y,z,s,sdg,t (["g", q]) and cx,cz,swap (["g", a, b]) with qubit 0 as the least significant bit of the basis index; return the statevector as [re, im] pairs rounded to 6 decimals.
Why this case matters
Statevector simulators underpin circuit unit tests; a gate-kernel slip silently corrupts every downstream amplitude.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: random circuit 12 | [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.5, 0.0], [0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.5, 0.0]] | [[0.5, 0.0], [0.0, 0.0], [0.5, 0.0], [0.0, 0.0], [0.5, 0.0], [0.0, 0.0], [0.5, 0.0], [0.0, 0.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 ↗