Part I · Chapter 4

Unitary & Hermitian Operators

Read ~20 min Prerequisites Ch. 1–3 Tools live matrix property checker Live

Three earlier chapters have all been quietly pointing at this one. Ch. 1 told you a gate matrix has to satisfy "one extra rule" beyond being any old 2×2 matrix. Ch. 2 gave you the dagger (†) notation for a vector's conjugate transpose. Ch. 4 generalizes † to matrices and uses it to state, precisely, the two rules that separate "a matrix that could be a real quantum gate" from "a matrix that's just numbers in a grid," and the rule that separates "something you could actually measure" from "something you can't."

The conjugate transpose of a matrix

You already met this for vectors in Ch. 2: the bra ⟨ψ| is the ket |ψ⟩ transposed into a row, with every entry conjugated. The exact same operation on a matrix is written M† ("M dagger"): transpose it, then conjugate every entry.

$$M=\begin{bmatrix}a&b\\c&d\end{bmatrix} \quad\Rightarrow\quad M^\dagger=\begin{bmatrix}a^*&c^*\\b^*&d^*\end{bmatrix}$$

Unitary: the rule every quantum gate obeys

A matrix U is unitary if U†U = I. Here's why that specific condition is the right one: Ch. 3 required every valid qubit state to satisfy ⟨ψ|ψ⟩ = 1, and a gate has to take valid states to valid states. If U preserves every state's norm — ⟨Uψ|Uψ⟩ = ⟨ψ|ψ⟩ for every ψ — then writing that out as ψ†U†Uψ = ψ†ψ forces U†U = I directly. Unitarity isn't an arbitrary rule bolted onto quantum mechanics; it's just "doesn't break normalization," translated into one matrix equation.

This is exactly the "extra rule" Ch. 1 mentioned: the Shear preset in Fig. 1.2 fails it (Shear†·Shear ≠ I), which is precisely why no real quantum gate looks like a shear.

Hermitian: the rule every observable obeys

A matrix M is Hermitian if it equals its own dagger: M = M†. Concretely, that forces the diagonal entries to be real (a number that equals its own conjugate has to be real) and the two off-diagonal entries to be complex conjugates of each other.

Hermitian matrices have one property that makes them indispensable in quantum mechanics, and it's the reason this chapter exists right after Ch. 1's eigenvalue section: every eigenvalue of a Hermitian matrix is guaranteed to be a real number. Since a measurement outcome (Ch. 7) is defined as an eigenvalue of the observable being measured, and a measured quantity has to be a real number, observables are required to be represented by Hermitian matrices — there's no other option that would even make sense.

Fig. 4.1 — edit any entry, or pick a presetchecks unitarity, Hermiticity, eigenvalues
+i
+i
+i
+i
Unitary: — Hermitian: —

M†

M†M (check against I)

Try "S": unitary (S†S = I) but not Hermitian, and its eigenvalues are 1 and i — one real, one genuinely complex, which is exactly why S can be a gate but could never represent a measurable quantity. Then try "Hermitian, not unitary": passes the Hermitian check and gives two real eigenvalues, but fails M†M = I outright.
Fig. 4.2 — code, runs in your browser
np.linalg.eigvals does in one call exactly what Fig. 4.1's widget does under the hood with the explicit quadratic formula.

Both at once: Pauli matrices

Try I, X, Y, and Z in Fig. 4.1 — every one of them is both unitary and Hermitian simultaneously, with real eigenvalues of exactly +1 and −1. That's not a coincidence: it's exactly why the Pauli matrices do double duty throughout this book, as gates (Ch. 3, where unitary is the requirement) and as observables (Ch. 7, where Hermitian is the requirement). Most matrices are one, the other, neither, or — like the Pauli matrices — happily both.

Check your understanding

What two conditions does M = [[a,b],[c,d]] have to satisfy to be Hermitian?

a and d (the diagonal entries) must be real, and c must equal b* (the complex conjugate of b) — equivalently, b must equal c*.

Check your understanding

Why is unitarity exactly the right condition for a quantum gate, rather than some other rule?

Because a gate must take every normalized state to another normalized state. Requiring ⟨Uψ|Uψ⟩ = ⟨ψ|ψ⟩ for all ψ is algebraically identical to requiring U†U = I — unitarity is just "preserves normalization" written as a matrix equation.

Check your understanding

The S gate is unitary but not Hermitian. Could S represent a measurable physical quantity?

No. Observables must be Hermitian because measurement outcomes are eigenvalues, and outcomes have to be real numbers. S has eigenvalues 1 and i — since i isn't real, S can't represent anything you could actually measure, even though it's a perfectly valid gate.

Check your understanding

[[1,0],[0,2]] is Hermitian but not unitary. What does failing the unitary check tell you it could never be?

A quantum gate. Applying it to a normalized state wouldn't generally give back a normalized state (its eigenvalues 1 and 2 aren't both magnitude 1), so it can't be a valid unitary operation — even though it's a perfectly good Hermitian observable.

Check your understanding

Why are the Pauli matrices (I, X, Y, Z) special among the gates you've seen so far?

They're both unitary and Hermitian simultaneously, with real eigenvalues ±1 — which is exactly why they serve double duty in the book, as gates in Ch. 3 and as observables in Ch. 7.

Review queue

Scroll back to a chapter's quiz cards to review them once they're due — a full cross-chapter queue view is a planned upgrade.