Lesson 4: Linear Algebra III: Operators, Eigenvalues, Unitarity and Tensor Products¶
4.1 Learning Outcomes¶
By the end of this hour a student will be able to:
- Represent a linear operator as a matrix and compute its adjoint \(A^\dagger\).
- Define and recognise Hermitian, unitary and normal operators, and state why each matters physically.
- Find eigenvalues and eigenvectors and write a spectral decomposition.
- Compute the trace and use its cyclic property.
- Form tensor products of vectors and of matrices, and explain why \(\dim(\mathcal{H}_A\otimes\mathcal{H}_B) = d_A d_B\).
4.2 Linear Operators¶
Definition (Linear operator). \(A : V \to W\) is linear if \(A\big(a|\psi\rangle + b|\phi\rangle\big) = aA|\psi\rangle + bA|\phi\rangle\) for all \(a,b\in\mathbb{C}\).
Once a basis is fixed, every linear operator on an \(n\)-dimensional space is an \(n\times n\) matrix with entries
The expression \(\langle e_i|A|e_j\rangle\) is called a matrix element; \(\langle\psi|A|\psi\rangle\) is the expectation value of \(A\) in state \(|\psi\rangle\).
Operator from outer products. Any operator can be written
The adjoint¶
Definition (Adjoint / Hermitian conjugate). \(A^\dagger\) is the unique operator satisfying
Concretely, \(A^\dagger = \overline{A}^{\,T} = (A^*)^T\): transpose and conjugate.
Rules.
Reversal rule. Daggering a product reverses the order. This is the source of many sign and ordering errors in circuit derivations.
4.3 Three Classes of Operators¶
Hermitian (self-adjoint) operators — observables¶
Definition. \(A\) is Hermitian iff \(A^\dagger = A\), i.e. \(A_{ij} = A_{ji}^*\).
Consequences:
- Diagonal entries are real (since \(A_{ii} = A_{ii}^*\)).
- All eigenvalues are real.
- Eigenvectors for distinct eigenvalues are orthogonal.
- \(\langle\psi|A|\psi\rangle\) is real for every \(|\psi\rangle\).
Theorem (Real eigenvalues). If \(A^\dagger = A\) and \(A|\psi\rangle = \lambda|\psi\rangle\) with \(|\psi\rangle \ne 0\), then \(\lambda \in \mathbb{R}\).
Proof. \(\langle\psi|A|\psi\rangle = \lambda\langle\psi|\psi\rangle\). Taking the complex conjugate and using Hermiticity, \(\langle\psi|A|\psi\rangle^* = \langle\psi|A^\dagger|\psi\rangle = \langle\psi|A|\psi\rangle\), so \(\langle\psi|A|\psi\rangle\) is real. Since \(\langle\psi|\psi\rangle > 0\) is real, \(\lambda\) must be real. \(\blacksquare\)
Physical role. Every measurable quantity (observable) is represented by a Hermitian operator; its eigenvalues are the possible measurement outcomes.
Unitary operators — evolution and gates¶
Definition. \(U\) is unitary iff \(U^\dagger U = U U^\dagger = I\), equivalently \(U^{-1} = U^\dagger\).
Theorem (Unitaries preserve inner products). For unitary \(U\),
In particular norms are preserved, so a normalised state stays normalised.
Other facts: eigenvalues of a unitary have modulus 1 (they are \(e^{i\theta}\)); columns of \(U\) form an orthonormal basis; \(|\det U| = 1\).
Physical role. Closed-system evolution and every quantum gate is unitary. This is why quantum computation is reversible — \(U^\dagger\) undoes \(U\).
The Pauli matrices¶
These are the most important matrices in the course. They are simultaneously Hermitian and unitary — a rare and useful combination which implies \(X^2 = Y^2 = Z^2 = I\).
Algebra.
where \([A,B] = AB-BA\) is the commutator and \(\{A,B\} = AB+BA\) the anticommutator.
\(\{I,X,Y,Z\}\) is a basis for all \(2\times2\) complex matrices: any \(M\) can be written \(M = aI + bX + cY + dZ\).
4.4 Eigenvalues, Eigenvectors and Spectral Decomposition¶
Definition. \(\lambda\) is an eigenvalue of \(A\) with eigenvector \(|v\rangle \ne 0\) if \(A|v\rangle = \lambda|v\rangle\).
Procedure.
- Solve the characteristic equation \(\det(A - \lambda I) = 0\) for \(\lambda\).
- For each \(\lambda\), solve \((A-\lambda I)|v\rangle = 0\).
- Normalise each eigenvector.
Theorem (Spectral decomposition). If \(A\) is normal (\(AA^\dagger = A^\dagger A\)) — in particular if \(A\) is Hermitian or unitary — then \(A\) is diagonalisable in an orthonormal eigenbasis:
Functions of operators. With a spectral decomposition, functions are defined eigenvalue-wise:
Most important instance: for a Hermitian \(H\) with \(H^2 = I\) (like any Pauli),
Proof. Expand \(e^{i\theta H} = \sum_k \frac{(i\theta H)^k}{k!}\) and split into even/odd \(k\). Even powers give \(H^{2m} = I\) and the cosine series; odd powers give \(H^{2m+1} = H\) and \(i\) times the sine series. \(\blacksquare\)
Trace¶
Definition. \(\mathrm{Tr}(A) = \sum_i A_{ii} = \sum_i \langle e_i|A|e_i\rangle\).
Properties.
- Linear: \(\mathrm{Tr}(aA+bB) = a\,\mathrm{Tr}A + b\,\mathrm{Tr}B\).
- Cyclic: \(\mathrm{Tr}(ABC) = \mathrm{Tr}(BCA) = \mathrm{Tr}(CAB)\).
- Basis-independent; equals the sum of eigenvalues.
- \(\mathrm{Tr}\big(|\phi\rangle\langle\psi|\big) = \langle\psi|\phi\rangle\).
- \(\langle\psi|A|\psi\rangle = \mathrm{Tr}\big(A|\psi\rangle\langle\psi|\big)\).
4.5 The Tensor Product¶
This is how quantum mechanics combines systems, and it is the reason state space grows exponentially.
Definition (Tensor product of spaces). If \(\mathcal{H}_A\) has basis \(\{|i\rangle_A\}\) (\(d_A\) elements) and \(\mathcal{H}_B\) has basis \(\{|j\rangle_B\}\) (\(d_B\) elements), then \(\mathcal{H}_A \otimes \mathcal{H}_B\) has basis \(\{|i\rangle_A\otimes|j\rangle_B\}\) and
Contrast with the direct sum. \(\dim(\mathcal{H}_A \oplus \mathcal{H}_B) = d_A + d_B\). Classical composition adds; quantum composition multiplies. For \(n\) qubits: \(2\times2\times\cdots\times2 = 2^n\).
Notation. \(|i\rangle\otimes|j\rangle\) is written \(|i\rangle|j\rangle\) or simply \(|ij\rangle\).
Kronecker product of vectors¶
So the two-qubit computational basis in vector form is
Ordering convention: the leftmost ket is the most significant bit — \(|10\rangle\) means qubit 0 is in state \(|1\rangle\) and qubit 1 is in state \(|0\rangle\) when written \(|q_0 q_1\rangle\). (Qiskit uses the opposite little-endian display order; we will flag this in Unit IV.)
Kronecker product of matrices¶
For \(A\) of size \(m\times n\) and \(B\) of size \(p\times q\), \(A\otimes B\) has size \(mp \times nq\):
Key algebraic rules.
The mixed-product property is what makes "apply \(H\) to qubit 1 and \(X\) to qubit 2" equal to applying the single operator \(H\otimes X\).
Applying a gate to one qubit only. To apply \(U\) to qubit 1 of a 3-qubit register, use \(U \otimes I \otimes I\).
4.6 Solved Problems¶
Problem 1 — Hermitian and unitary checks¶
Determine whether \(A = \begin{pmatrix} 2 & 1-i \\ 1+i & 3\end{pmatrix}\) is Hermitian, and whether \(U = \frac{1}{\sqrt2}\begin{pmatrix}1 & 1 \\ 1 & -1\end{pmatrix}\) is unitary.
Solution.
Hermiticity of \(A\). Transpose then conjugate:
So \(A\) is Hermitian. (Sanity check: diagonal entries 2 and 3 are real, and off-diagonals are conjugates of each other.)
Unitarity of \(U\) (this is the Hadamard gate). \(U\) is real symmetric, so \(U^\dagger = U\):
\(U\) is unitary, and also Hermitian, so \(H^2 = I\) — applying Hadamard twice restores the state.
Problem 2 — Eigen-decomposition of the Pauli X¶
Find the eigenvalues and normalised eigenvectors of \(X\), and write its spectral decomposition.
Solution.
For \(\lambda = +1\): solve \(\begin{pmatrix}-1 & 1\\ 1 & -1\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix} = 0\), giving \(a = b\). Normalised:
For \(\lambda = -1\): \(\begin{pmatrix}1&1\\1&1\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix}=0\) gives \(a = -b\):
Spectral decomposition:
Verify: \(\frac12\begin{pmatrix}1&1\\1&1\end{pmatrix} - \frac12\begin{pmatrix}1&-1\\-1&1\end{pmatrix} = \begin{pmatrix}0&1\\1&0\end{pmatrix} = X\) ✓.
Meaning. Measuring the observable \(X\) yields \(+1\) (state collapses to \(|+\rangle\)) or \(-1\) (collapses to \(|-\rangle\)). "Measuring in the \(X\) basis" is exactly this.
Problem 3 — Tensor product of states¶
Compute \(|+\rangle \otimes |1\rangle\) as a 4-component vector and express it in Dirac notation.
Solution.
Reading off the basis labels \((00,01,10,11)\):
This is a product state — it factorises, so the two qubits are unentangled.
Problem 4 — Tensor product of matrices¶
Compute \(H \otimes I\) where \(H = \frac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}\), and apply it to \(|00\rangle\).
Solution.
Apply to \(|00\rangle = (1,0,0,0)^T\) — this just picks out the first column:
Consistent with the shortcut \((H\otimes I)(|0\rangle\otimes|0\rangle) = (H|0\rangle)\otimes(I|0\rangle) = |+\rangle\otimes|0\rangle\), which is the mixed-product property in action.
Problem 5 — Exponentiating a Pauli¶
Show that \(e^{-i\theta X/2} = \cos\frac{\theta}{2} I - i\sin\frac{\theta}{2} X\), and evaluate at \(\theta = \pi\).
Solution. Since \(X^2 = I\), split the exponential series by parity. Write \(t = \theta/2\):
Even terms: \((-it)^{2m} = (-1)^m t^{2m}\), giving \(\sum_m \frac{(-1)^m t^{2m}}{(2m)!} = \cos t\).
Odd terms: \((-it)^{2m+1} = -i(-1)^m t^{2m+1}\), giving \(-i\sin t\).
At \(\theta = \pi\): \(\cos\frac{\pi}{2} = 0\), \(\sin\frac{\pi}{2}=1\), so
Interpretation. \(R_x(\pi)\) is the \(X\) gate up to the global phase \(-i\). Global phases are physically unobservable, so a \(\pi\) rotation about the \(x\)-axis of the Bloch sphere is the NOT gate. This connects the gate picture (L07) to the Bloch-sphere picture (L05).
4.7 Practice Problems¶
- Verify that \(Y\) is Hermitian and unitary, and find its eigenvectors. [Ans: \(|{\pm}i\rangle\) with eigenvalues \(\pm1\)]
- Compute \(X\otimes Z\) as a \(4\times4\) matrix.
- Show \(\mathrm{Tr}(X) = \mathrm{Tr}(Y) = \mathrm{Tr}(Z) = 0\) and explain why using eigenvalues.
- Prove \((A\otimes B)(C\otimes D) = AC \otimes BD\) for \(2\times2\) matrices by direct computation.
- Write \(M = \begin{pmatrix}3 & 2 \\ 2 & 1\end{pmatrix}\) in the Pauli basis \(aI+bX+cY+dZ\). [Ans: \(a=2, b=2, c=0, d=1\)]
- If \(U\) is unitary with eigenvalue \(\lambda\), prove \(|\lambda| = 1\).
- Compute \(e^{-i\theta Z/2}\) and show it equals \(\mathrm{diag}(e^{-i\theta/2}, e^{i\theta/2})\).
4.8 Summary¶
- \(A^\dagger\) = conjugate transpose; \((AB)^\dagger = B^\dagger A^\dagger\) (order reverses).
- Hermitian (\(A^\dagger = A\)) ⟶ observables, real eigenvalues, orthogonal eigenvectors.
- Unitary (\(U^\dagger U = I\)) ⟶ gates and evolution, norm-preserving, reversible.
- The Paulis \(X,Y,Z\) are both Hermitian and unitary; they square to \(I\) and anticommute.
- Spectral decomposition \(A = \sum_j\lambda_j|v_j\rangle\langle v_j|\) defines \(f(A)\); in particular \(e^{i\theta H} = \cos\theta I + i\sin\theta H\) when \(H^2=I\).
- Tensor product multiplies dimensions: \(n\) qubits ⟶ \(2^n\); mixed-product rule \((A\otimes B)(C\otimes D) = AC\otimes BD\).
Next lesson: L05 — Qubits, superposition and the Bloch sphere.
Practise now: unit1-qubit-lab.html → Matrix Playground multiplies, daggers and tensors any
matrices you type, and flags Hermitian/unitary automatically.