← Back

The Quantum Circuit: A Recipe Written in Gates

A single quantum gateA single operation that changes the state of one or more qubits. Strung together, gates make up a quantum calculation, like the logic steps inside a normal chip. does one thing. A quantum circuitA sequence of quantum gates applied to qubits, read left to right in time and ending in measurement. The recipe a quantum computer runs. is the whole recipe: the gates, in order, that turn a blank starting state into an answer.

Wires, gates, and time

A quantum circuit is the quantum cousin of the logic diagram inside an ordinary chip. Draw a set of horizontal lines, one per qubitThe basic unit of a quantum computer. Like a 'bit' in a normal computer, but instead of being only 0 or 1 it can be 0, 1, or a blend of both at once.; those are the wires. Place boxes along them; those are the gates. You read the picture left to right, because left to right is time, and it ends in a measurementReading a quantum system, which forces it out of its blend of possibilities into a single definite 0 or 1 and ends its quantum behaviour. that turns the quantum stateThe full description of a quantum system's condition at a moment in time, such as whether a qubit is 0, 1, or a mix. into a classical answer you can read off.12 The one deep difference from a classical circuit is that every gate is a unitary operationA quantum operation that rotates a system's state without losing any information, so it can always be undone exactly. Every quantum gate is one., a reversible rotation of the state, so until that final measurement nothing is ever thrown away.3

A gate is a single step. A circuit is the whole recipe, written in gates.

What makes this more than bookkeeping is that a tiny toolbox goes a very long way. A universal gate setA small collection of gates that can be combined to build any quantum computation. Single-qubit gates plus the CNOT are enough., just the one-qubit gates plus the two-qubit CNOT gateA two-qubit gate that flips a target qubit only when a control qubit is 1. The standard two-qubit building block., can be strung together to approximate any operation on any number of qubits at all.1 So a designer never needs custom hardware for each new algorithm. They write a circuit out of the same few gates, the way any book is built from one alphabet.

A quantum circuit. Three horizontal qubit wires run left to right through a sequence of gate boxes and a CNOT, ending in measurement meters. The number of wires is the width and the number of steps is the depth.
Figure 1: A quantum circuit. Qubit wires run left to right through a sequence of gates and end in measurement; the count of wires is its width, the count of steps its depth.

Width, depth, and the noise budget

Two numbers size a circuit. Its width is how many qubitsThe basic unit of a quantum computer. Like a 'bit' in a normal computer, but instead of being only 0 or 1 it can be 0, 1, or a blend of both at once. it uses; its circuit depthThe number of sequential layers of operations a quantum computer can run before noise destroys the answer. The depth of a calculation, as opposed to its width. is how many steps deep the longest chain of gates runs.3 Depth is the one that hurts. Every gate is slightly wrong, and on real hardware those small errors stack up, so a circuit that runs too deep dissolves into what is effectively random noise before it can finish.3 Today's machines manage only on the order of a thousand gates before that happens.3

Depth is a budget. Spend more gates than the noise allows and the answer turns to gibberish.

There is a second tax on the way to hardware. An abstract circuit has to be compiled into the particular gates a given chip supports, and rearranged to respect its connectivityWhich qubits in a machine can directly interact with each other. More connectivity makes more algorithms possible., which qubit pairs can actually interact directly. Both steps add gates, which adds depth, which spends more of the same budget.3

Why it matters

The circuit is where any quantum speedup has to live. Every quantum algorithm, Shor's factoring and Grover's search among them, is in the end just a circuit.43 That also sets the bar honestly: factoring a 2,000-bit number is estimated to need on the order of a hundred billion gates,4 against a present ceiling near a thousand. The distance between those two numbers is the whole engineering project. A quantum computer is only ever as useful as the circuits it can run to the end.

Sources

  1. Barenco, A., Bennett, C. H., Cleve, R., DiVincenzo, D. P., Margolus, N., Shor, P., Sleator, T., Smolin, J. A. & Weinfurter, H. “Elementary Gates for Quantum Computation.” Physical Review A 52, 3457–3467 (1995). DOI: 10.1103/PhysRevA.52.3457. Preprint: arXiv:quant-ph/9503016.
  2. Mermin, N. D. “From Cbits to Qbits: Teaching Computer Scientists Quantum Mechanics.” American Journal of Physics 71, 23–30 (2003). DOI: 10.1119/1.1522741. Preprint: arXiv:quant-ph/0207118.
  3. Preskill, J. “Quantum Computing in the NISQ Era and Beyond.” Quantum 2, 79 (2018). DOI: 10.22331/q-2018-08-06-79. Preprint: arXiv:1801.00862.
  4. Montanaro, A. “Quantum Algorithms: An Overview.” npj Quantum Information 2, 15023 (2016). DOI: 10.1038/npjqi.2015.23. Preprint: arXiv:1511.04206.