← 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
Takes3 qubitsWhat joins here

Takes a 3-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 3 qubits can feed it.

4 entries meet this end · 1 entry lines up on shape, composition unverified. Named below.

Returns3 qubitsWhat joins here

Returns a 3-qubit register a next stage can take. This is the end that joins.

2 entries meet this end · 14 entries line up on shape, composition unverified. Named below.

A unitary. The same register goes in and comes out, and this entry states no assumption about what is on it — which is what lets anything of the same width feed it. See all 29 →

Shapes fit before this, composition unverified 1

The widths and types line up. What is not established is everything a width does not carry — the basis convention, the normalisation, the state each was written to start from — so this is not a claim that the two compose.

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.