toffoli-gate
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| toffoli-gate [June 10, 2026 at 23:05] โ created - external edit 127.0.0.1 | toffoli-gate [Unknown date] (current) โ removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # Toffoli gate | ||
| - | **Toffoli gate** (CCNOT, or doubly-controlled NOT) is a three-qubit gate that flips the target qubit if and only if both control qubits are $\lvert 1\rangle$. It was introduced by Tommaso Toffoli in 1980 and is the key building block for reversible classical computation inside a quantum circuit. | ||
| - | |||
| - | The gate implements the reversible Boolean operation $\lvert a, b, c\rangle \mapsto \lvert a, b, c \oplus (a \wedge b)\rangle$, where $\oplus$ is XOR and $\wedge$ is AND. Its matrix is the $8 \times 8$ identity with the last two rows swapped (basis ordered $\lvert 000\rangle$ through $\lvert 111\rangle$): | ||
| - | |||
| - | $$\text{CCNOT} = \begin{pmatrix} | ||
| - | 1& | ||
| - | 0& | ||
| - | 0& | ||
| - | 0& | ||
| - | 0& | ||
| - | 0& | ||
| - | 0& | ||
| - | 0& | ||
| - | \end{pmatrix}$$ | ||
| - | |||
| - | ## Classical universality | ||
| - | |||
| - | The Toffoli gate alone is classically universal โ any Boolean function can be computed reversibly using only Toffoli gates. Setting $c = 0$ gives AND: $\lvert a, b, 0\rangle \to \lvert a, b, a \wedge b\rangle$. Setting $a = b = 1$ gives NOT: $\lvert 1, 1, c\rangle \to \lvert 1, 1, \lnot c\rangle$. AND and NOT are a complete classical gate set. | ||
| - | |||
| - | ## Circuit decomposition | ||
| - | |||
| - | The Toffoli gate can be decomposed into six [[cnot-gate|CNOT gates]] and several single-qubit gates. It is its own inverse: $\text{CCNOT}^2 = I$. Toffoli gates appear in reversible arithmetic circuits (adders, multipliers) embedded inside quantum algorithms, and in quantum error correction as controlled-controlled operations. | ||
| - | |||
| - | ## List of code implementations | ||
| - | |||
| - | - [[toffoli-gate-qiskit|Toffoli gate (Qiskit)]] | ||
| - | - [[toffoli-gate-custatevec|Toffoli gate (cuStateVec)]] | ||
| - | - [[toffoli-gate-cudaq|Toffoli gate (CUDA-Q)]] | ||
toffoli-gate.1781132733.txt.gz ยท Last modified: by 127.0.0.1
