What Is a Quantum Circuit? The Wire Model, Basic Gates, and Their Roots in Operator Algebra, Linear Algebra, and Tensors
A quantum circuit diagram looks a lot like an ordinary logic diagram. But behind its wires and gates, three layers of mathematical structure are stacked on top of each other.
The wire model of a quantum circuit
A quantum circuit is drawn the same way a classical logic circuit is -- as a diagram of wires and gates, read left to right. The difference is what the wires carry. A classical wire carries a bit value, 0 or 1; a quantum wire carries the state of a qubit, an element of the 2-dimensional complex vector space C^2. Each wire represents the time evolution of one qubit, and a gate is a transformation acting on that wire (or set of wires).
The idea of a quantum circuit traces back to Richard Feynman's 1982 paper proposing that simulating quantum mechanics might require a computer that itself obeys quantum mechanics, and it was David Deutsch, in 1985, who gave the first formal definition of a "universal quantum computer" as a computational model. We cover the tensor-product structure of multi-qubit systems and other foundational concepts in a separate article; here we focus on what a gate actually is, mathematically.
Basic gates: one qubit and two qubits
The best-known single-qubit gates include the bit-flip Pauli-X, the Hadamard gate (H) that creates superposition, and the phase-rotating S and T gates. The signature two-qubit gate is CNOT (controlled-NOT), which flips a target qubit only when a control qubit is 1 -- the basic gate capable of producing entanglement. The three-qubit Toffoli gate (CCNOT) is universal for classical reversible computation.
An important theorem states that single-qubit rotation gates combined with CNOT alone can (approximately) implement any quantum computation -- a constructive proof given by Barenco and colleagues in 1995. The word "approximately" is unavoidable: there are uncountably many possible unitary transformations, so no finite set of gates (like H, T, and CNOT), applied a finite number of times, can reproduce all of them exactly. But the Solovay-Kitaev theorem guarantees that the number of gates needed to hit a target precision ε grows only polynomially in log(1/ε) -- which is why calling this gate set "universal" is perfectly reasonable in practice.
What a gate really is, take 1: operator algebra (unitary operators)
A basic principle of quantum mechanics says that the time evolution of an isolated quantum system is described by a unitary operator -- a linear operator U satisfying U†U = I. A quantum gate is exactly this: a unitary operator. The set of all gates acting on an n-qubit system forms the group U(2^n) (or SU(2^n), up to an overall phase), and composing gates (wiring circuits in series) corresponds to multiplying operators within that group.
Digging one level deeper: the single-qubit rotation gates R_x(θ), R_y(θ), and R_z(θ) are obtained by exponentiating the Pauli matrices σ_x, σ_y, σ_z -- which are themselves Hermitian operators, corresponding to physical observables -- as U = exp(-iθσ/2). This relationship, where exponentiating a Hermitian generator produces a unitary time evolution, is the physical manifestation of Stone's theorem, which establishes the correspondence between one-parameter unitary groups and their Hermitian generators. It sits at the heart of the operator-algebraic formulation of quantum mechanics.
What a gate really is, take 2: linear algebra (gates as matrices)
At a more concrete level, these unitary operators can simply be treated as unitary matrices (complex square matrices satisfying U†U = I). A single-qubit state is a 2-dimensional column vector; a gate is a 2×2 unitary matrix; and applying a gate to a state is nothing more than a matrix-vector product. Composing gates in series is matrix multiplication; gates placed in parallel on different wires correspond to a tensor product (more on that below).
Measurement fits into this same framework. An observable is represented by a Hermitian matrix (a matrix whose eigenvalues are all real), the outcome of measuring it is one of those eigenvalues, and the probability of getting a particular eigenvalue is the squared magnitude of the state vector's projection onto the corresponding eigenspace (the Born rule). Running a quantum circuit, in this view, is repeatedly multiplying a vector by matrices, then finally "peeking" at the answer via projection onto an eigenspace.
What a gate really is, take 3: tensors and the dual vector space
The state space of a system of n qubits is built as the tensor product (C^2)^⊗n of each qubit's individual state space. When a two-qubit gate is applied to just two specific wires within an n-qubit system, the identity operator I is applied to the remaining (n-2) wires, and the whole operation is represented as the tensor product of the gate matrix with I. This is the precise mathematical meaning of "the gate is drawn only on certain wires" in a circuit diagram.
The standard notation of quantum mechanics, bra-ket notation, embodies a deeper connection within this same structure. A state vector |ψ⟩ (a "ket") is an element of a Hilbert space H, while its counterpart ⟨ψ| (a "bra") is an element of the dual space H* -- the space of all linear functionals on H. The inner product ⟨φ|ψ⟩ is precisely the natural pairing between an element of the dual space (a bra) and an element of the original space (a ket) -- exactly the "natural pairing of dual spaces" from linear algebra. In a Hilbert space, the Riesz representation theorem guarantees that every bra corresponds to a unique ket via the inner product (i.e., a Hilbert space can naturally be identified with its own dual space), which is the mathematical fact that makes bra-ket notation consistent in the first place.
Three viewpoints on the same underlying structure
The operator-algebra view explains what a gate is required to be (the physical constraint of unitarity). The linear-algebra view explains how to actually compute with a gate (matrix arithmetic). And the tensor/dual-space view explains how multiple qubits, inner products, and measurement all compose together. A quantum circuit, for all its apparent simplicity, has these three layers stacked consistently underneath it, and designing a quantum algorithm ultimately means finding a sequence of gates that realizes a target transformation within this structure. For a concrete example of algorithm design, see our article on Grover's algorithm.
Summary
- A quantum circuit's wires carry qubit states (elements of C^2), and gates act on them as unitary operators
- Combinations of basic gates like H and CNOT can efficiently approximate any quantum computation, per the Solovay-Kitaev theorem
- Algebraically, gates are unitary operators; rotation gates arise from exponentiating Hermitian generators (the Pauli matrices), per Stone's theorem
- Linear-algebraically, gates are unitary matrices, and measurement is projection onto the eigenspaces of a Hermitian matrix, governed by the Born rule
- Multi-qubit systems are built via tensor products, and bra-ket notation embodies the natural correspondence between a Hilbert space and its dual (the Riesz representation theorem)
Related article
The no-cloning theorem, tensor products, and density matrices -- the foundational concepts of quantum information theory.
Read: The Basics of Quantum Information