Flips target only when both controls are |1⟩.
The Toffoli gate is a three-qubit gate that extends the CNOT idea: it flips the target qubit only when both control qubits are |1⟩. Classically, this implements a reversible AND gate. But quantumly, it acts on superpositions of all eight three-qubit basis states simultaneously. The Toffoli gate is universal for classical reversible computing, and when combined with Hadamard, it becomes universal for quantum computing.
Toffoli (CCX) is a three-qubit gate acting as |ab,c⟩ → |ab, c ⊕ (a ∧ b)⟩. It is a doubly-controlled X: the target flips if and only if both controls are |1⟩. The gate is its own inverse, unitary, and preserves computational basis states. It can simulate any classical logic circuit reversibly. On quantum states, it applies the controlled-controlled-NOT operation coherently across all branches of a superposition.
Classical AND logic applied to the amplitudes.
Still acts coherently on superpositions — not purely classical despite looking like a classical gate.
Conditional X on target when both controls are |1⟩. Individual Bloch vectors depend on the full three-qubit state.
The Toffoli gate looks classical because its truth table matches AND, but it operates on quantum superpositions. When the controls are in superposition, the result is a coherent quantum state, not a classical mixture.
Toffoli proves that quantum computing includes all of classical computing. Any classical algorithm can be embedded as a reversible quantum circuit using Toffoli gates, and then quantum features like superposition can be layered on top.
What classical logic gate does Toffoli implement reversibly?