Skip to main content

Plain-Language Intuition

Mode: Simple / School
The Toffoli gate is the quantum version of AND: it flips a target qubit only when both control qubits are 1. With it you can build any classical logic circuit, reversibly. Real quantum hardware cannot perform a three-qubit gate directly. It has to be assembled from one- and two-qubit gates. The standard recipe uses 6 CNOTs, 2 Hadamards and 7 T-type gates. It works like a combination lock made of small phase turns. The T gates each turn the phase by an eighth of a circle, and the CNOTs arrange things so that the turns cancel for every input except 11, where they add up to a full flip. Try the superposition input: the target becomes 1 only in the branch where both controls are 1.

Gate Synthesis

Toffoli Gate from Clifford+T: quick reference

Builds the three-qubit Toffoli (AND) gate exactly from Hadamard, T and CNOT gates, the way fault-tolerant hardware does.

Topic
Gate Synthesis
Level
Intermediate
Circuit size
3 Qubits
Key result
Universal classical logic from 6 CNOTs and 7 T gates

Concepts covered: Toffoli Gate, Clifford+T Decomposition, Reversible Logic, T-count

How Toffoli Gate from Clifford+T works, step by step

  1. Prepare the Control Qubits. Put both controls (Q0, Q1) in superposition so all four input combinations are tested at once.
  2. T-Ladder on the Target. Between two Hadamards on the target, CNOTs from the controls alternate with small T rotations. They cancel unless both controls are 1.
  3. Phase Fix-Up on the Controls. A last CNOT pair with T gates on the two controls removes a leftover phase so the gate is exact.
  4. Measure the Truth Table. The target (leftmost bit) is 1 only when both controls are 1: the AND of the two inputs.

Frequently asked questions

What is Toffoli Gate from Clifford+T?

Builds the three-qubit Toffoli (AND) gate exactly from Hadamard, T and CNOT gates, the way fault-tolerant hardware does. It is a intermediate-level topic in gate synthesis.

How many qubits does the Toffoli Gate (CCNOT) circuit use?

The QuanBit tutorial uses a 3 qubits circuit. Key result: Universal classical logic from 6 CNOTs and 7 T gates.

Can I simulate Toffoli Gate (CCNOT) online for free?

Yes. The interactive Toffoli Gate (CCNOT) tutorial at https://www.quanbit.tech/learn/toffoli runs free in the browser with nothing to install. You can step through the circuit gate by gate, watch the probabilities, statevector and Bloch spheres update, build the circuit yourself and take a short quiz.