controlledSWAP
The controlled-SWAP gate, often abbreviated as C-SWAP or Fredkin gate, is a fundamental three-qubit quantum gate. It acts as a conditional swap operation. Its function is as follows: if the control qubit is in the state |1⟩, it performs a SWAP operation on the other two qubits. If the control qubit is in the state |0⟩, it leaves the other two qubits unchanged. The controlled-SWAP gate is a universal quantum gate, meaning that any quantum computation can be constructed using only controlled-SWAP gates and single-qubit gates.
Mathematically, the controlled-SWAP gate can be represented by a 3x3 matrix. For qubits A (control), B, and
where |x⟩ and |y⟩ represent any valid state for qubits B and C, respectively.
The controlled-SWAP gate plays a crucial role in various quantum algorithms and protocols. It is instrumental