In short

Every quantum gate is a unitary matrix — a matrix U satisfying U^\dagger U = U U^\dagger = I. Equivalently, U preserves the inner product: \langle U\psi | U\varphi \rangle = \langle \psi | \varphi \rangle for any two states. This has two sweeping consequences. First, probabilities always sum to 1 — the normalisation \langle \psi | \psi \rangle = 1 that defines a valid quantum state is preserved by every gate. Second, every gate is reversible: since U^\dagger U = I, the operator U^\dagger is the exact inverse, and it is itself a valid gate. This is why quantum circuits, unlike classical AND and OR, never destroy information during evolution — every step can be undone, right up until you measure.

Imagine a classical digital circuit with an AND gate. Two bits go in; one bit comes out. If the output is 0, you know nothing about the inputs — they could have been (0, 0), (0, 1), or (1, 0). The gate has destroyed information: the two-bit input has been crushed into a one-bit output, and no amount of staring at the output will tell you what went in. Classical circuits throw information away all the time, and the waste shows up as heat — Rolf Landauer proved in 1961 that erasing a bit necessarily dumps a tiny amount of energy into the environment. Every laptop you have ever used is warm for this reason.

Quantum gates cannot do this. Every single-qubit gate, every two-qubit gate, every gate you will ever meet in this track, obeys the same mathematical constraint: the operator has to be unitary. And a unitary operator is, by definition, reversible — it has an inverse, the inverse is also a valid gate, and running the circuit backwards gives you back exactly the state you started with. The only time a quantum computer destroys information is at measurement, and that is a different kind of event (see the next chapter on projective measurement).

This chapter explains where the unitary constraint comes from, what it means geometrically, why it forces every quantum gate to be reversible, and why this reversibility is one of the structural facts that makes quantum computing different from classical computing.

Why "quantum gate" must mean "unitary operator"

The argument starts from the first postulate of quantum mechanics: a pure state is a unit vector in a complex vector space. For a qubit, that vector space is \mathbb{C}^2, and the "unit" condition is \langle \psi | \psi \rangle = 1 — the sum of the squared moduli of the amplitudes equals 1.

Why the unit-vector condition matters: the amplitudes \alpha, \beta in |\psi\rangle = \alpha|0\rangle + \beta|1\rangle are the numbers whose squared moduli give measurement probabilities. |\alpha|^2 + |\beta|^2 = 1 is the same equation as \text{P}(0) + \text{P}(1) = 1 — the statement that something must happen when you measure. Drop this condition and probabilities no longer sum to 1.

Now add the second postulate: quantum evolution is linear. A gate U takes a state |\psi\rangle to a new state U|\psi\rangle, and linearity means U(\alpha|\psi\rangle + \beta|\varphi\rangle) = \alpha U|\psi\rangle + \beta U|\varphi\rangle. A gate is therefore fully specified by what it does to basis vectors — the rest follows from linearity. That is exactly what a matrix encodes.

Stack the two postulates together. The gate U must:

  1. Be a linear map (a matrix).
  2. Take unit vectors to unit vectors — because the output must still be a valid quantum state.

The second condition is where "unitary" comes from. A linear map that preserves norms is, by a standard theorem of linear algebra, norm-preserving, which in complex vector spaces is the same thing as inner-product-preserving, which is the definition of a unitary operator.

Why norm-preserving implies inner-product-preserving (in one sentence): the inner product \langle \psi | \varphi \rangle can be reconstructed from norms of sums (polarisation identity — 4\langle \psi|\varphi\rangle = \|\psi+\varphi\|^2 - \|\psi-\varphi\|^2 + i\|\psi-i\varphi\|^2 - i\|\psi+i\varphi\|^2), so if every norm is preserved, every inner product is too.

So if you want "valid quantum state in, valid quantum state out," linearity plus norm-preservation forces U to be unitary. There is no wiggle room. Any linear map that is not unitary will, on some input state, produce an output whose squared norms do not sum to 1 — and that output is not a quantum state anymore.

The definition

Unitary operator

A matrix U is unitary if it satisfies

U^\dagger U = U U^\dagger = I,

where U^\dagger (called "U-dagger") is the conjugate transpose — take the transpose of U, then complex-conjugate every entry. Equivalently, U preserves the inner product: for any two states |\psi\rangle, |\varphi\rangle,

\langle U\psi \,|\, U\varphi\rangle = \langle \psi \,|\, \varphi \rangle.

In particular, U preserves norms: \|U\psi\| = \|\psi\|. Geometrically, U is a "generalised rotation" of the complex vector space — it shuffles states around the unit sphere in Hilbert space without stretching, shrinking, or reflecting any length.

A quick notation refresher: the symbol |\psi\rangle — "ket psi" — is a column vector in \mathbb{C}^n. The bra \langle \psi | is the conjugate transpose of that column: a row whose entries are the complex conjugates of the column's entries. The inner product \langle \psi | \varphi \rangle is the row times the column — a single complex number. And U^\dagger extends the same idea to matrices: every entry flips across the diagonal and gets conjugated.

Equivalent characterisations

The three statements below are all equivalent — any one of them can serve as the definition of "unitary":

  1. Algebraic. U^\dagger U = I.
  2. Geometric. U preserves the inner product: \langle U\psi|U\varphi\rangle = \langle \psi|\varphi\rangle for all |\psi\rangle, |\varphi\rangle.
  3. Columns. The columns of U form an orthonormal basis. (And equivalently, the rows do too.)

The third characterisation is the quickest way to check whether a concrete matrix is unitary. Write down the columns; check that each has length 1 and that any two different ones are orthogonal. If yes, the matrix is unitary. You will use this check constantly.

Unitary as a rotation

The word "rotation" is not a metaphor here — it is the honest geometric content of the definition.

In the real 3D world, a rotation is a map that keeps every length the same and preserves angles between vectors. A cube rotated about its centre is still a cube with the same edge lengths; the angles between its faces are unchanged. Rotations are exactly the linear maps that preserve the ordinary Euclidean inner product \vec{a} \cdot \vec{b}.

Now replace "real 3D" with "complex n-dimensional" and "Euclidean dot product" with "Hermitian inner product \langle \psi | \varphi \rangle." The linear maps that preserve this inner product are the unitaries. They are the generalised rotations of a complex vector space.

For a single qubit (n = 2), the state space is the 2-dimensional complex vector space — a space that, after you quotient out the global phase and the normalisation, becomes the familiar 2-sphere you know as the Bloch sphere. On the Bloch sphere, unitaries act as ordinary 3D rotations. Every single-qubit gate — X, Y, Z, H, S, T, R_x(\theta) — is a rotation of the sphere about some axis by some angle. You cannot build a gate on a qubit that is not some kind of rotation of this sphere. Rotations are all there is.

Unitary acts as a rotation of the Bloch sphereA Bloch sphere with an initial state |psi⟩ drawn as an arrow from origin to a point on the surface. A curved arrow shows the unitary U rotating the state to a new point, labelled U|psi⟩. Both arrows have the same length — the gate preserves the norm.|0⟩|1⟩|ψ⟩U|ψ⟩U rotatessame lengthsame norm
A unitary $U$ moves the state vector $|\psi\rangle$ to a new point $U|\psi\rangle$ on the Bloch sphere. The two arrows have the same length — that is what "preserves the norm" means in pictures.

For multi-qubit systems, the same picture still applies; it is just that the "sphere" is now a higher-dimensional surface you cannot draw. The algebra is still U^\dagger U = I, and the action is still a length-preserving rotation of that higher-dimensional surface.

Why unitary implies reversible

This is the single most important consequence of unitarity for computing, and the argument is a two-liner.

From the definition, U^\dagger U = I. Read that equation as: "the matrix U^\dagger, applied to the output of U, gives back the identity." In other words, U^\dagger is the inverse of U:

U^{-1} = U^\dagger.

Every unitary has an inverse — and the inverse is not some mysterious object that may or may not exist. It is the conjugate transpose, which you can always compute in a few lines of algebra. Moreover, U^\dagger itself is unitary (you can check: (U^\dagger)^\dagger U^\dagger = U U^\dagger = I), so the inverse is itself a valid quantum gate.

The reversibility consequence. Every quantum gate has an "undo" gate. If you apply U and then apply U^\dagger, you are back where you started. In circuit form:

Reversibility round tripA horizontal wire labelled |psi⟩ on the left, passing through a box labelled U, a wire segment labelled U|psi⟩, then a box labelled U-dagger, then a wire labelled |psi⟩ again on the right. An arrow beneath shows "round trip: state restored".UU†|ψ⟩U|ψ⟩|ψ⟩round trip: state restored exactly
Every quantum gate $U$ has an inverse $U^\dagger$ that is itself a valid gate. Applying both in sequence gives back the original state.

Some specific examples you will meet later:

The point is not to memorise this table; the point is that every entry has an inverse, always, by construction.

Contrast with classical gates

A classical AND gate takes two bits and returns one. That is a map from \{0, 1\}^2 (four possible inputs) to \{0, 1\} (two possible outputs). It is not a bijection — it cannot be inverted. This is a structural, information-theoretic fact, not a technological limitation; no classical AND gate, however cleverly engineered, can be reversed.

Classical AND is irreversible; quantum gate is a bijectionTwo panels side by side. The left panel shows a classical AND gate: four input pairs (0,0), (0,1), (1,0), (1,1) on the left, all arrowing into two outputs 0 and 1 on the right. Three inputs map to 0 and one maps to 1 — a many-to-one function. The right panel shows a quantum gate U as a bijection: each input state maps to exactly one output state, one-to-one, reversibly.Classical AND: many-to-one(0,0)(0,1)(1,0)(1,1)01output 0 ⇒ three possible inputsinformation destroyedQuantum U: bijection|00⟩|01⟩|10⟩|11⟩|ψ₀⟩|ψ₁⟩|ψ₂⟩|ψ₃⟩every input ⇄ unique outputinformation preserved
A classical AND gate is many-to-one: three of its four inputs give output $0$, so from the output you cannot reconstruct the input. A quantum gate is a unitary, which is always a bijection on state space: every input has a unique output and vice versa. Information is preserved.

Classical reversible computing (Fredkin, Toffoli) sidesteps this by building logic from gates that keep extra bits around as bookkeeping — but those extra bits take up real space, and classical machines rarely bother. Quantum mechanics forces this reversibility. There is no "quantum AND gate that throws away a bit." The closest thing is the Toffoli gate, which implements AND on two bits while keeping a third scratch bit to preserve invertibility. When you see a Toffoli in a quantum algorithm, that third wire is there because the universe insists on it.

Schrödinger — where unitaries come from physically

For a gate-level quantum computer, you write down unitaries directly and apply them to qubits. But where do these unitaries come from physically? The answer goes back to the Schrödinger equation — the fundamental law of time evolution in quantum mechanics.

For a closed quantum system with a Hamiltonian H (an operator representing energy, and a Hermitian matrix, H = H^\dagger — not to be confused with the Hadamard gate, also called H), time evolution over an interval t is

|\psi(t)\rangle = U(t)\,|\psi(0)\rangle, \qquad U(t) = e^{-iHt/\hbar}.

The operator U(t) is the unitary evolution operator: a quick check shows U(t)^\dagger U(t) = e^{+iHt/\hbar}\,e^{-iHt/\hbar} = I because H is Hermitian.

Why Hermitian H implies unitary U(t) = e^{-iHt/\hbar}: the exponential of an i-times-Hermitian matrix is always unitary, because (e^{iA})^\dagger = e^{-iA} when A is Hermitian, and e^{iA} e^{-iA} = e^0 = I.

Real quantum hardware implements gates by tuning the Hamiltonian of the system for a precisely controlled amount of time. A single laser pulse on a trapped ion, a microwave pulse on a superconducting qubit, a magnetic field applied to a nuclear spin — each of these turns on a specific H for a specific t, and the result is a specific unitary U(t) = e^{-iHt/\hbar} applied to the qubits. The gate you wrote down on paper as a 2 \times 2 matrix exists on the machine as "run Hamiltonian H for time t."

This is the deep connection between quantum gates and quantum physics. Unitaries are not a mathematical convenience imposed by theorists; they are the literal time evolution of closed physical systems. Part 15 of this track — Hamiltonian simulation — is about going the other way, using quantum gates to simulate arbitrary Hamiltonians. The two directions are the same coin.

Composition of unitaries is unitary

Quantum circuits compose many gates. If U and V are both unitary, is the product UV (first apply V, then U) also unitary? The answer is yes, and the check is one line of algebra:

(UV)^\dagger (UV) = V^\dagger U^\dagger U V = V^\dagger \cdot I \cdot V = V^\dagger V = I.

Why (UV)^\dagger = V^\dagger U^\dagger: taking the dagger of a product reverses the order of the factors, just like taking the transpose of a matrix product. This is the same rule you know from linear algebra: (AB)^T = B^T A^T.

So any finite composition of unitaries is unitary. An entire quantum circuit — thousands of gates, any number of qubits — is still, at the end of the day, one big unitary acting on the full state space. The reversibility is inherited: the inverse of the whole circuit is the product of the inverses, in reverse order: (U_n \cdots U_2 U_1)^\dagger = U_1^\dagger U_2^\dagger \cdots U_n^\dagger. Run the gates backwards, each replaced by its dagger, and you undo the entire computation exactly.

Worked examples

Example 1: Verify the Hadamard gate is unitary

The Hadamard gate is

H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.

Verify H^\dagger H = I by direct computation.

Step 1. Compute H^\dagger. Take the transpose (swap rows and columns) and complex-conjugate every entry. Every entry of H is real, so the conjugate step does nothing. The transpose swaps the two off-diagonal entries, which in this case happens to give back the same matrix because the entries are symmetric: H_{12} = H_{21} = 1/\sqrt{2}.

H^\dagger = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = H.

Why H^\dagger = H: the Hadamard is Hermitian — equal to its own conjugate transpose. That is a special property of this particular gate, not a general feature of unitaries. Most unitaries are not Hermitian; their daggers are genuinely different matrices.

Step 2. Compute H^\dagger H.

H^\dagger H = H \cdot H = \frac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.

Why the 1/2 out front: each factor of H carries a 1/\sqrt{2} normalisation, and (1/\sqrt{2})(1/\sqrt{2}) = 1/2.

Step 3. Multiply the two matrices entry by entry. Each entry of the product is the dot product of a row of the left factor with a column of the right factor.

\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \begin{pmatrix} 1\cdot 1 + 1 \cdot 1 & 1 \cdot 1 + 1 \cdot (-1) \\ 1 \cdot 1 + (-1) \cdot 1 & 1 \cdot 1 + (-1) \cdot (-1) \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}.

Why only the diagonal survives: the off-diagonal entries mix a +1 with a -1 which cancel; the diagonal entries mix like signs which add to 2.

Step 4. Multiply by the 1/2 hanging out front.

H^\dagger H = \frac{1}{2}\begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I. \qquad \checkmark

Result. H is unitary. Moreover, H^\dagger = H, which means H is both unitary and Hermitian — it is its own inverse. This is why applying a Hadamard twice returns the original state.

Shortcut using the column test. An alternative way to verify: the columns of H are \tfrac{1}{\sqrt{2}}(1, 1)^T and \tfrac{1}{\sqrt{2}}(1, -1)^T. Their norms are \sqrt{(1/\sqrt{2})^2 + (1/\sqrt{2})^2} = 1 each. Their inner product is \tfrac{1}{2}(1\cdot 1 + 1 \cdot (-1)) = 0. Two unit vectors, orthogonal — the columns form an orthonormal basis, so H is unitary.

Example 2: A non-unitary operator shrinks the state

Consider a hypothetical operator

M = \begin{pmatrix} 1 & 0 \\ 0 & 1/2 \end{pmatrix}.

Is M unitary? Apply it to |1\rangle and see what happens.

Step 1. Compute M|1\rangle.

M|1\rangle = \begin{pmatrix} 1 & 0 \\ 0 & 1/2 \end{pmatrix}\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 1/2 \end{pmatrix}.

Why: the second column of M is (0, 1/2)^T, which is exactly what M does to |1\rangle = (0, 1)^T.

Step 2. Check the norm of the output.

\|M|1\rangle\|^2 = \left|0\right|^2 + \left|\tfrac{1}{2}\right|^2 = \tfrac{1}{4}.

Why: the squared norm of a vector is the sum of the squared moduli of its entries. Here only the second entry is nonzero, and its squared modulus is 1/4.

Step 3. Interpret. The input |1\rangle had squared norm 1. The output has squared norm 1/4. The "total probability" has shrunk from 1 to 1/4. The output is not a valid quantum state — the probabilities of measuring 0 and 1 no longer sum to 1.

Step 4. Confirm by the dagger check. Compute M^\dagger M:

M^\dagger M = \begin{pmatrix} 1 & 0 \\ 0 & 1/2 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & 1/2 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1/4 \end{pmatrix} \ne I.

Why: the (2,2) entry of the product is (1/2)(1/2) = 1/4, which is not 1. A unitary operator must give back the identity here; this one does not.

Result. M is not unitary, and it cannot be a valid closed-system quantum gate. Physically, an operator like this could represent a loss process — for example, a qubit coupled to a noisy environment that has a 3/4 chance of being "absorbed" when in state |1\rangle. Such operators appear in the formalism of quantum channels (the general open-system framework), where they are called Kraus operators and are not required to be unitary individually. They are important, but they live outside the world of pure gates.

Common confusions

Going deeper

If you only need the operational content — every gate is unitary, unitaries are norm-preserving and reversible, and compositions of unitaries are unitary — you are done. The rest of this section goes deeper: the group-theoretic structure of unitaries, the Solovay-Kitaev theorem that makes approximate compilation possible, the non-unitary operations that escape this framework, and why reversibility is essential for quantum interference.

The group structure of unitaries

The set of all n \times n unitary matrices, with matrix multiplication as the group operation, forms a group called the unitary group U(n). Three easy checks: the identity I is unitary (so the group has an identity element); every unitary has an inverse, namely its dagger, which is also unitary (closure under inverses); and the product of two unitaries is unitary (closure under the operation). These three properties make U(n) a group.

More than that: U(n) is a Lie group, meaning it has a smooth manifold structure. You can move continuously through unitaries the same way you move continuously through rotations in 3D space. Nearby unitaries are obtained from a given one by infinitesimally small perturbations, and those perturbations are generated by Hermitian matrices — the same Hermitians that appear as Hamiltonians. This is not a coincidence: the "infinitesimal generator" of U(t) = e^{-iHt/\hbar} is -iH/\hbar, and the Hermiticity of H is precisely what makes the exponential unitary.

For a single qubit, U(2) is 4-dimensional (4 real parameters) as a manifold. Modding out a global phase gives SU(2), which is 3-dimensional — the three parameters you recognise as "axis of rotation" (2 parameters for direction) plus "angle of rotation." SU(2) is a double cover of the 3D rotation group SO(3), which is why a 2\pi rotation on the Bloch sphere picks up a minus sign in the underlying Hilbert space (the famous spin-1/2 signature).

The Solovay-Kitaev theorem — approximating any unitary

A quantum computer has a finite gate set — say \{H, T, \text{CNOT}\}, the universal gate set most commonly used in practice. But there are infinitely many unitaries. How can finitely many gates, applied in finite combinations, reach every possible unitary?

The answer is that they do not reach every unitary exactly — but they can approximate every unitary to arbitrary precision. The Solovay-Kitaev theorem makes this precise: for any fixed universal gate set, any target single-qubit unitary U, and any precision \varepsilon > 0, there is a sequence of at most O(\log^c(1/\varepsilon)) gates from the set that approximates U within \varepsilon. The exponent c is a small number (best known is about 3.97).

This is one of the foundational theorems of quantum computing. It says that the "discrete gate set" model is not a limitation — you can always compile any clean mathematical unitary into a bounded-length gate sequence. Real-world quantum compilers (Qiskit transpile, Cirq's compile stack) are doing exactly this work behind the scenes.

Non-unitary operations — channels and Kraus operators

Unitaries describe closed-system gate evolution. Real quantum hardware has noise, and the noise is not unitary. How do you model noise?

The answer is the quantum channel formalism. A quantum channel is a linear map \mathcal{E} on density matrices that is completely positive and trace-preserving (CPTP). Every channel has a representation

\mathcal{E}(\rho) = \sum_k K_k \rho K_k^\dagger, \qquad \sum_k K_k^\dagger K_k = I,

where the K_k are called Kraus operators. A unitary gate is the special case of a channel with one Kraus operator, K_1 = U, satisfying U^\dagger U = I. But channels can have many Kraus operators — representing partial rotations, mixture of several possible actions, dephasing, relaxation, and so on.

Measurement is a channel too, but with classical output: the "outcome m" part of the channel has Kraus operator K_m = |m\rangle\langle m| (a projector), and the channel's job is to pick one at random according to the Born rule.

This is the framework that takes over when unitarity is not enough. You will meet it properly in Part 13 (density matrices and channels). For now, just know: unitarity is the clean, closed-system version; channels are the general version; and every channel can be realised as a unitary on a larger system (Stinespring dilation) at the cost of tracking ancilla qubits that represent the environment.

Why reversibility matters for quantum computing

The philosophical answer is "because physics is reversible." The practical answer is interference.

Every quantum algorithm that beats its classical counterpart does so by arranging amplitudes to interfere — constructively on the right answer, destructively on the wrong ones. Interference requires that amplitudes survive unspoiled from gate to gate. If any gate silently discarded amplitude (as a non-unitary operation would), the interference pattern would be blurred or destroyed, and the algorithm's advantage would evaporate.

This is a direct line to Feynman's 1982 argument for quantum computing. Feynman pointed out that classical computers cannot efficiently simulate quantum systems, because the state vector of n qubits is exponentially large. The reason a quantum computer can simulate a quantum system efficiently is that its natural dynamics — unitary evolution — is the same kind of dynamics the target system obeys. Throw away reversibility, and the quantum computer is no longer speaking the same mathematical language as the system it is trying to simulate.

From a hardware perspective, reversibility is also what makes quantum error correction possible. Errors show up as unwanted unitary (or near-unitary) perturbations of the computational state. If those perturbations were irreversible — if they destroyed information before the error-correction circuit could intervene — error correction could not recover the state. Reversibility gives the code time to act.

Where this leads next

References

  1. Nielsen and Chuang, Quantum Computation and Quantum Information (2010), §2.1.6 and §2.2.2 — the definitive treatment of unitary evolution and postulate 2. Cambridge University Press.
  2. John Preskill, Lecture Notes on Quantum Computation, Ch. 2 (unitary dynamics and the Schrödinger equation) — theory.caltech.edu/~preskill/ph229.
  3. Wikipedia, Unitary operator — the linear-algebra definition, equivalent characterisations, and group-theoretic structure.
  4. Wikipedia, Schrödinger equation — the physical origin of U(t) = e^{-iHt/\hbar}.
  5. Qiskit Textbook, Representing Qubit States and Gates — hands-on examples of unitary gates with live simulators.
  6. Christopher M. Dawson and Michael A. Nielsen, The Solovay-Kitaev algorithm (2005) — constructive approximation of any unitary by a discrete gate set. arXiv:quant-ph/0505030.