Skip to content

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:

  1. Represent a linear operator as a matrix and compute its adjoint \(A^\dagger\).
  2. Define and recognise Hermitian, unitary and normal operators, and state why each matters physically.
  3. Find eigenvalues and eigenvectors and write a spectral decomposition.
  4. Compute the trace and use its cyclic property.
  5. 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

\[ A_{ij} = \langle e_i | A | e_j\rangle . \]

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

\[ A = \sum_{i,j} A_{ij} |e_i\rangle\langle e_j| . \]

The adjoint

Definition (Adjoint / Hermitian conjugate). \(A^\dagger\) is the unique operator satisfying

\[ \langle \phi | A \psi\rangle = \langle A^\dagger\phi | \psi\rangle \quad \text{for all } |\phi\rangle,|\psi\rangle. \]

Concretely, \(A^\dagger = \overline{A}^{\,T} = (A^*)^T\): transpose and conjugate.

Rules.

\[ (A^\dagger)^\dagger = A, \quad (AB)^\dagger = B^\dagger A^\dagger, \quad (aA)^\dagger = a^* A^\dagger, \quad \big(A|\psi\rangle\big)^\dagger = \langle\psi|A^\dagger . \]

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\),

\[ \langle U\phi | U\psi\rangle = \langle\phi| U^\dagger U|\psi\rangle = \langle\phi|I|\psi\rangle = \langle\phi|\psi\rangle .\]

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

\[ I = \begin{pmatrix}1&0\\0&1\end{pmatrix},\quad X = \begin{pmatrix}0&1\\1&0\end{pmatrix},\quad Y = \begin{pmatrix}0&-i\\ i&0\end{pmatrix},\quad Z = \begin{pmatrix}1&0\\0&-1\end{pmatrix} \]

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.

\[ XY = iZ, \quad YZ = iX, \quad ZX = iY, \qquad XY = -YX \ \text{(anticommute)} \]
\[ \{\sigma_i, \sigma_j\} = 2\delta_{ij}I, \qquad [\sigma_i,\sigma_j] = 2i\,\epsilon_{ijk}\sigma_k \]

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.

  1. Solve the characteristic equation \(\det(A - \lambda I) = 0\) for \(\lambda\).
  2. For each \(\lambda\), solve \((A-\lambda I)|v\rangle = 0\).
  3. 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:

\[ \boxed{\ A = \sum_{j} \lambda_j |v_j\rangle\langle v_j| \ } \]

Functions of operators. With a spectral decomposition, functions are defined eigenvalue-wise:

\[ f(A) = \sum_j f(\lambda_j)\,|v_j\rangle\langle v_j| . \]

Most important instance: for a Hermitian \(H\) with \(H^2 = I\) (like any Pauli),

\[ e^{i\theta H} = \cos\theta\, I + i\sin\theta\, H . \]

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

\[ \dim(\mathcal{H}_A\otimes\mathcal{H}_B) = d_A \cdot d_B . \]

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

\[ \begin{pmatrix}a_1\\a_2\end{pmatrix}\otimes\begin{pmatrix}b_1\\b_2\end{pmatrix} = \begin{pmatrix} a_1 b_1 \\ a_1 b_2 \\ a_2 b_1 \\ a_2 b_2 \end{pmatrix} \]

So the two-qubit computational basis in vector form is

\[ |00\rangle = (1,0,0,0)^T,\ |01\rangle = (0,1,0,0)^T,\ |10\rangle = (0,0,1,0)^T,\ |11\rangle = (0,0,0,1)^T .\]

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\):

\[ A\otimes B = \begin{pmatrix} a_{11}B & a_{12}B & \cdots \\ a_{21}B & a_{22}B & \cdots \\ \vdots & & \ddots \end{pmatrix} \]

Key algebraic rules.

\[ (A\otimes B)(C\otimes D) = (AC)\otimes(BD) \qquad \text{(mixed-product property)} \]
\[ (A\otimes B)^\dagger = A^\dagger \otimes B^\dagger, \qquad \mathrm{Tr}(A\otimes B) = \mathrm{Tr}(A)\,\mathrm{Tr}(B) \]
\[ A\otimes B \text{ is unitary if } A,B \text{ are unitary} \]

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:

\[ A^T = \begin{pmatrix}2 & 1+i \\ 1-i & 3\end{pmatrix}, \qquad A^\dagger = \overline{A^T} = \begin{pmatrix}2 & 1-i \\ 1+i & 3\end{pmatrix} = A \ \checkmark \]

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^\dagger U = \frac{1}{2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}\begin{pmatrix}1&1\\1&-1\end{pmatrix} = \frac12\begin{pmatrix} 1+1 & 1-1 \\ 1-1 & 1+1\end{pmatrix} = \frac12\begin{pmatrix}2&0\\0&2\end{pmatrix} = I \ \checkmark \]

\(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.

\[ \det(X - \lambda I) = \begin{vmatrix} -\lambda & 1 \\ 1 & -\lambda\end{vmatrix} = \lambda^2 - 1 = 0 \ \Rightarrow\ \lambda = \pm 1 . \]

For \(\lambda = +1\): solve \(\begin{pmatrix}-1 & 1\\ 1 & -1\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix} = 0\), giving \(a = b\). Normalised:

\[ |v_+\rangle = \frac{1}{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix} = |+\rangle . \]

For \(\lambda = -1\): \(\begin{pmatrix}1&1\\1&1\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix}=0\) gives \(a = -b\):

\[ |v_-\rangle = \frac{1}{\sqrt2}\begin{pmatrix}1\\-1\end{pmatrix} = |-\rangle . \]

Spectral decomposition:

\[ X = (+1)|+\rangle\langle+| \;+\; (-1)|-\rangle\langle-| . \]

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.

\[ |+\rangle\otimes|1\rangle = \frac{1}{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix} \otimes \begin{pmatrix}0\\1\end{pmatrix} = \frac{1}{\sqrt2}\begin{pmatrix} 1\cdot 0 \\ 1\cdot 1 \\ 1\cdot 0 \\ 1\cdot 1\end{pmatrix} = \frac{1}{\sqrt2}\begin{pmatrix}0\\1\\0\\1\end{pmatrix} \]

Reading off the basis labels \((00,01,10,11)\):

\[ |+\rangle|1\rangle = \frac{1}{\sqrt2}\big(|01\rangle + |11\rangle\big) . \]

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.

\[ H\otimes I = \frac{1}{\sqrt2}\begin{pmatrix} 1\cdot I & 1\cdot I \\ 1\cdot I & -1\cdot I\end{pmatrix} = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \end{pmatrix} \]

Apply to \(|00\rangle = (1,0,0,0)^T\) — this just picks out the first column:

\[ (H\otimes I)|00\rangle = \frac{1}{\sqrt2}\begin{pmatrix}1\\0\\1\\0\end{pmatrix} = \frac{1}{\sqrt2}\big(|00\rangle + |10\rangle\big) = |+\rangle|0\rangle . \]

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\):

\[ e^{-itX} = \sum_{k=0}^{\infty}\frac{(-it)^k X^k}{k!} = \underbrace{\sum_{m}\frac{(-it)^{2m}}{(2m)!}}_{X^{2m}=I}\,I \;+\; \underbrace{\sum_{m}\frac{(-it)^{2m+1}}{(2m+1)!}}_{X^{2m+1}=X}\,X \]

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\).

\[ e^{-i\theta X/2} = \cos\tfrac{\theta}{2}\,I - i\sin\tfrac{\theta}{2}\,X = \begin{pmatrix} \cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2}\end{pmatrix} = R_x(\theta). \]

At \(\theta = \pi\): \(\cos\frac{\pi}{2} = 0\), \(\sin\frac{\pi}{2}=1\), so

\[ R_x(\pi) = -iX = \begin{pmatrix}0 & -i\\ -i & 0\end{pmatrix} . \]

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

  1. Verify that \(Y\) is Hermitian and unitary, and find its eigenvectors. [Ans: \(|{\pm}i\rangle\) with eigenvalues \(\pm1\)]
  2. Compute \(X\otimes Z\) as a \(4\times4\) matrix.
  3. Show \(\mathrm{Tr}(X) = \mathrm{Tr}(Y) = \mathrm{Tr}(Z) = 0\) and explain why using eigenvalues.
  4. Prove \((A\otimes B)(C\otimes D) = AC \otimes BD\) for \(2\times2\) matrices by direct computation.
  5. 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\)]
  6. If \(U\) is unitary with eigenvalue \(\lambda\), prove \(|\lambda| = 1\).
  7. 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.