10 min read
Unitary Matrices
The adjoint, the unitary condition, and why every quantum gate (but not measurement) has to satisfy it.
Suggested before this lesson
Not every matrix is a valid quantum gate. This lesson covers the one condition that decides which matrices are: unitarity. It's the formal version of something the algorithms track will lean on directly, that a quantum gate has to be reversible.
The adjoint (or conjugate transpose, or "dagger") of a matrix , written , is formed by transposing and conjugating every entry:
For a matrix with only real entries, like , , or , conjugating does nothing, so is just the ordinary transpose.
A matrix is unitary if (equivalently too, for square matrices), where is the identity. This single condition says two things at once:
That second point is exactly why quantum gates must be unitary: a state's norm being 1 is what makes its squared amplitudes valid probabilities that sum to 1. A gate that didn't preserve norm would turn a valid state into an invalid one, probabilities that don't add up to 100%. Unitary gates are precisely the linear maps that never let that happen.
( is real and symmetric, so here, meaning is its own inverse, which checks out: applying qc.h(0) twice in a row returns a qubit to where it started.)
Here's the fact Quantum Phase Estimation is eventually built on: every eigenvalue of a unitary matrix satisfies , meaning it can always be written for some real . This follows straight from norm preservation: if for a unit vector , then (unitarity), but also , so . A unitary gate can never scale an eigenvector up or down, only rotate its phase, which is exactly the pattern you already saw for and in the last lesson (, ), just the special real-valued case of a much more general fact.
Measurement. Collapsing a superposition down to a single definite outcome is fundamentally irreversible: it's a many-to-one process, many different pre-measurement states can collapse to the same post-measurement outcome, and a many-to-one map can never have an inverse. This is also exactly the reversibility argument the oracle lesson makes about classical functions: a generic isn't invertible either, which is why an oracle has to be built as an XOR-into-an-ancilla unitary instead of "compute and overwrite the answer directly."
The violet loop traces for every direction . For or it stays a perfect circle: norm preserved, exactly the unitary condition. Switch to the non-unitary matrix from the quiz below and watch the loop distort.
Vector transform
20°
(0.94, 0.34)
(0.34, 0.94)
1.000
The violet loop traces every possible output as sweeps a full circle. A circle in, circle out means preserves length for every direction, exactly the unitary condition; a squashed or stretched loop means it doesn't.