Current state |q₀q₁q₂⟩ Other basis states
drag to pan · scroll to zoom · click a node

Toffoli Gate (CCNOT) Circuit & Hypercube Simulator

The Toffoli gate — also called CCNOT, the doubly-controlled NOT — is the workhorse of reversible and universal quantum computation. This 2D simulator draws the real 3-wire quantum circuit (two control dots and a ⊕ target symbol, with a pulse that travels down the wires on every application) directly above a pannable, zoomable graph of all 8 three-qubit basis states |000⟩ through |111⟩ laid out as the classic flattened 3-cube: an inner square for q₀=0, an outer square for q₀=1, and spoke edges between them, so every edge in the picture is a genuine one-bit flip. Toggle the two control bits and the target bit by hand, or click any vertex to jump straight to that register value, then apply the real Toffoli permutation and watch the highlighted vertex jump to its paired corner and back — the target flips only when both controls are 1. Live readouts track the current state index, how many times the gate has been applied, and whether the gate would flip the target from the current register, while a randomize button seeds a fresh starting state so the graph is never empty on load.