← Atlas

Gates · Multi-controlled gate

Fredkin (CSWAP) gate

A three-qubit controlled-swap gate that conditionally exchanges two target qubits, useful for reversible routing logic and as a component of the SWAP test for state overlap.

Exact & formalUpdated

View frozen graph

q[0]q[1]q[2]Step 1 of 1 · CSWAP · on q[0], q[1], q[2]CSWAP

1 step across 3 wires. Hover a step, or press play to go through them in order.

Expected outcomes

  • control=1: |1,0,1⟩ → |1,1,0⟩100%
  • control=0: targets unchanged100%
  • Steps1
  • Wires3
  • Qubits3
  • Depth1 native / 5 two-qubit gates (Smolin–DiVincenzo)
  • Conserved quantityHamming weight of targets
  • Papers2

References

Exact & formal
  • Basis-state truth table
  • Unitary / matrix equivalence
  • Peer-reviewed paper
Method
Apply CSWAP to all eight computational-basis inputs and confirm the two target bits exchange exactly when the control is |1⟩, and are unchanged when it is |0⟩.
Result
Pass · CSWAP|1,a,b⟩ = |1,b,a⟩ and CSWAP|0,a,b⟩ = |0,a,b⟩ for all four (a,b) pairs.
OpenQASM 3 standard gate set ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
CC BY 4.0-compatible reference metadata
fredkinconditional swapthree qubitconservative logic

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.