From the reversibility page: a quantum gate is valid if and only if its outputs are orthonormal (no overlap + no scaling). The formal one-line test for this is:
$$U^\dagger U = I$$
But what is \(U^\dagger\)? And how do you actually compute this? Two steps.
The dagger \(U^\dagger\) (read "U-dagger") does two things to a matrix:
$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}^T = \begin{pmatrix} a & c \\ b & d \end{pmatrix}$$
Row 1 becomes column 1, row 2 becomes column 2. The diagonal stays put. The off-diagonal entries swap.
$$\text{If } z = a + bi, \quad \text{then } z^* = a - bi$$
Every \(i\) becomes \(-i\). Real numbers don't change. That's it.
$$U^\dagger = (U^T)^* = \text{transpose, then conjugate every entry}$$
(Order doesn't matter — conjugate then transpose gives the same result.)
The Pauli Y gate is:
$$Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}$$
Transpose (swap off-diagonal):
$$Y^T = \begin{pmatrix} 0 & i \\ -i & 0 \end{pmatrix}$$
Conjugate (flip sign of \(i\)):
$$Y^\dagger = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}$$
The dagger gave us back the same matrix. That's not always the case — it's a special property. (Matrices where \(U^\dagger = U\) are called Hermitian. All Pauli matrices are Hermitian.)
$$X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
Transpose: swap 1 and 1 → same.
Conjugate: no \(i\)'s → same.
$$X^\dagger = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = X$$
Real symmetric → dagger = itself.
$$Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$
Transpose: diagonal → same.
Conjugate: no \(i\)'s → same.
$$Z^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = Z$$
Real diagonal → dagger = itself.
$$H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$$
Transpose: swap (1,2) and (2,1) — both are \(\frac{1}{\sqrt{2}}\) → same.
Conjugate: no \(i\)'s → same.
$$H^\dagger = H$$
Real symmetric → dagger = itself.
$$S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}$$
Transpose: diagonal → same.
Conjugate: \(i \to -i\).
$$S^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix} \neq S$$
Has complex entries → dagger is different!
If the matrix is real and symmetric (like X, Z, H) — dagger does nothing. Transpose swaps entries that are already equal, conjugate has no \(i\)'s to flip.
If the matrix has complex entries (like Y, S, T) — dagger gives you something different. The conjugate flips the \(i\)'s.
Now we can state the full test. A matrix \(U\) is unitary (= valid quantum gate) if and only if:
$$U^\dagger U = I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$$
This single equation checks both orthonormality conditions at once:
The columns of \(U\) are the gate's outputs: column 1 = \(|\text{out}_0\rangle\), column 2 = \(|\text{out}_1\rangle\).
When you compute \(U^\dagger U\), each entry is a braket between columns:
$$U^\dagger U = \begin{pmatrix} \langle\text{out}_0|\text{out}_0\rangle & \langle\text{out}_0|\text{out}_1\rangle \\ \langle\text{out}_1|\text{out}_0\rangle & \langle\text{out}_1|\text{out}_1\rangle \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$$
Identity matrix = columns are orthonormal. That's literally what \(I\) means.
$$X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad X^\dagger = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
Multiply \(X^\dagger X\):
$$X^\dagger X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
Top-left: row 1 · col 1 = \(0 \cdot 0 + 1 \cdot 1 = 1\) ← \(\langle\text{out}_0|\text{out}_0\rangle\) = normalized ✓
Top-right: row 1 · col 2 = \(0 \cdot 1 + 1 \cdot 0 = 0\) ← \(\langle\text{out}_0|\text{out}_1\rangle\) = orthogonal ✓
Bottom-left: row 2 · col 1 = \(1 \cdot 0 + 0 \cdot 1 = 0\) ← \(\langle\text{out}_1|\text{out}_0\rangle\) = orthogonal ✓
Bottom-right: row 2 · col 2 = \(1 \cdot 1 + 0 \cdot 0 = 1\) ← \(\langle\text{out}_1|\text{out}_1\rangle\) = normalized ✓
$$X^\dagger X = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I \quad\checkmark$$
This one has complex entries — the dagger actually changes the matrix.
$$S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}, \quad S^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}$$
$$S^\dagger S = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}$$
Top-left: \(1 \cdot 1 + 0 \cdot 0 = 1\) ✓
Top-right: \(1 \cdot 0 + 0 \cdot i = 0\) ✓
Bottom-left: \(0 \cdot 1 + (-i) \cdot 0 = 0\) ✓
Bottom-right: \(0 \cdot 0 + (-i)(i) = -i^2 = -(-1) = 1\) ✓
$$S^\dagger S = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I \quad\checkmark$$
The \(-i \cdot i = 1\) step is the key — complex conjugates multiply to give a real positive number. That's exactly why the dagger uses conjugation.
What if we scale X by 2? Outputs would be orthogonal but not normalized.
$$2X = \begin{pmatrix} 0 & 2 \\ 2 & 0 \end{pmatrix}, \quad (2X)^\dagger = \begin{pmatrix} 0 & 2 \\ 2 & 0 \end{pmatrix}$$
$$(2X)^\dagger (2X) = \begin{pmatrix} 0 & 2 \\ 2 & 0 \end{pmatrix} \begin{pmatrix} 0 & 2 \\ 2 & 0 \end{pmatrix} = \begin{pmatrix} 4 & 0 \\ 0 & 4 \end{pmatrix} \neq I$$
Off-diagonal = 0 → orthogonal ✓ (no pileup)
Diagonal = 4 → not normalized ✗ (outputs are too long — they'd scale up amplitudes)
This is the "direction is fine but magnitude is wrong" case from our earlier discussion.
You might wonder: why conjugate? Why not just transpose?
Because the inner product of complex vectors uses conjugation. For two vectors \(|a\rangle = \binom{a_1}{a_2}\) and \(|b\rangle = \binom{b_1}{b_2}\):
$$\langle a|b\rangle = a_1^* b_1 + a_2^* b_2$$
The left vector gets conjugated. That's not a choice — it's what makes inner products work correctly for complex numbers. (Without conjugation, \(\langle a|a\rangle\) could be zero or negative for nonzero vectors, which would break the idea of "length.")
The dagger is designed so that matrix multiplication \(U^\dagger U\) computes exactly the inner products between columns. Transpose lines up the rows and columns. Conjugation handles the complex part. Together they give you the braket.
← Why this matters: orthonormal outputs prevent amplitude pileup on superpositions.
If \(U^\dagger U = I\), then \(U^\dagger = U^{-1}\). The dagger is the undo button. Apply a gate, then apply its dagger, and you're back where you started. This is quantum reversibility in one equation.