You now own a box of reversible parts — the NOT, the CNOT, the Toffoli — and you know from
A reversible circuit on
Both bans come straight from reversibility. Fan-out is copying: one bit goes in, two
come out, and the map from the circuit's fixed set of
Each gate in the cascade is a small bijection on the
So this circuit sends
Almost all classical synthesis work uses one standard toolkit, the NCT library:
| Gate | Wires | Action | Drawn as |
|---|---|---|---|
| NOT | 1 | a lone ⊕ on the wire | |
| CNOT | 2 | control dot • joined to a target ⊕ | |
| Toffoli | 3 | two dots joined to a target ⊕ |
The library is universal: with enough wires, every reversible function can be built from these three (the Toffoli alone is universal, in fact — it can simulate the other two on fixed inputs). Universality tells you a circuit exists; it says nothing about finding a good one. For that we need to agree what "good" means.
Synthesis papers judge a circuit by four numbers, and they pull against each other:
| Metric | What it counts | Why it matters |
|---|---|---|
| Gate count | the number of gates in the cascade | the crudest size measure — and the easiest to compare |
| Depth | the number of time-steps, where gates on disjoint wires may fire in the same step | latency: how long one pass through the circuit takes |
| Width / ancillas | total wires = data wires + extra ancilla wires | memory: every ancilla is a bit of workspace you must physically provide |
| Quantum cost | a weighted gate count, weighting each gate by how expensive it is on quantum hardware | reversible circuits are the skeleton of quantum ones, and there a Toffoli is far pricier than a CNOT |
One number from the quantum-cost world is worth memorising now, as a teaser for where this course is
heading: in fault-tolerant quantum accounting, a Toffoli costs about 7 T gates,
while NOTs and CNOTs are nearly free. So a circuit with
Because gates on disjoint wires genuinely can fire at the same time. Picture a 6-wire circuit containing a NOT on wire 1, a CNOT on wires 2 and 3, and a Toffoli on wires 4, 5, 6: three gates, but no two share a wire, so all three can happen in a single tick — gate count 3, depth 1. Depth is the circuit-world version of parallel running time, and for physical reversible hardware (or a quantum computer, where every extra tick is extra decoherence) it can matter more than raw gate count. A long thin cascade and a short fat one may compute the same permutation at wildly different speeds.
In an ordinary schematic you split a wire with a dot and think nothing of it. In a reversible circuit
that innocent dot is illegal: it duplicates a bit for free, and no permutation of a
fixed set of wires can do that. The honest version costs real resources — one fresh ancilla wire
prepared as