Shows that single-qubit U(2) gates plus CNOT are universal and gives explicit decompositions for controlled-U, Toffoli, and Fredkin gates.
arxiv.org/abs/quant-ph/9503016 ↗Toffoli (CCX) gate
The three-qubit doubly-controlled NOT gate that implements reversible classical AND/NAND logic and is universal for classical reversible computation.
Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.
Toffoli is the standard bridge between quantum circuits and classical reversible logic: it is exactly a reversible AND gate, and its decomposition cost (CNOTs and T gates) is a recurring resource-counting benchmark for fault-tolerant compilation.
Circuit & simulation
What this takes and returns
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.
3 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 →
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.
How it works
Definition
The Toffoli gate acts on the computational basis as
flipping the target bit exactly when both controls are . As an permutation matrix it is the identity everywhere except the swap.
Reversible classical logic
is the quantum realization of a reversible AND gate: with the target ancilla initialized to , computes the logical AND while remaining unitary and reversible, unlike a classical AND gate which discards information. Nielsen and Chuang show this makes alone universal for reversible classical computation, and (or plus any basis-changing single-qubit gate) universal for quantum computation.
Decomposition
has no native two-qubit hardware analogue and is not itself Clifford. The standard circuit (Barenco et al. 1995; also Nielsen & Chuang Fig. 4.9) decomposes it into
for a total -count of 7 — the standard resource figure quoted when estimating the fault-tolerant cost of a circuit that uses Toffolis, since gates (not Clifford gates) dominate magic-state distillation cost.
Key identities
- is Hermitian and self-inverse: .
- is symmetric in its two control qubits but not in the target: swapping the two controls leaves the gate unchanged, swapping a control with the target does not.
- Multi-controlled- gates on more qubits () are built recursively from Toffolis and ancilla qubits, making the base case for the whole family used in Grover diffusion operators and reversible arithmetic circuits.
Implementation
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
x q[0];
x q[1];
ccx q[0], q[1], q[2];Quantum vs classical
Classical baseline
Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.
Quantum claim
The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.
How to compare
Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.
Declared gaps
Nobody has reviewed this record for gaps yet.
Literature & references
Standard reference for single- and multi-qubit gate matrices, Euler-angle decomposition, and universal gate sets.
doi.org/10.1017/cbo9780511976667 ↗