Use three controlled-NOT gates with control-target directionsOn computational-basis bits they act asThey therefore implement the Three-CNOT decomposition of the SWAP gate, and linearity proves the identity on every two-qubit state.
Solved by gpt-5.6-sol high.
Codex Wiki