In short

Every linear operator A on a finite-dimensional Hilbert space, once you pick an orthonormal basis \{|i\rangle\}, is a matrix. Its entries are inner products: A_{ij} = \langle i|A|j\rangle. The adjoint (or dagger) A^\dagger is the conjugate transpose — you flip rows and columns and conjugate each entry. Three operator families matter in quantum computing: Hermitian (A = A^\dagger, observables have real eigenvalues), unitary (U^\dagger U = I, gates preserve norm), and projectors (P^2 = P = P^\dagger, measurements). The trace \text{tr}(A) = \sum_i A_{ii} is basis-independent — useful because it lets you prove basis-invariant facts without committing to a basis.

The Hadamard gate has the matrix \tfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}. The Pauli X gate has the matrix \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. The projector |0\rangle\langle 0| you built in chapter 6 has the matrix \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}.

Three different operators, three 2 \times 2 matrices. Is this a pattern? Does every quantum operation on a qubit turn out to be a 2 \times 2 matrix? And if so, is there a recipe that takes an abstract operator A — described, say, as "the gate that swaps |0\rangle and |1\rangle" — and produces its matrix without you having to guess?

The answer to both questions is yes. In any finite-dimensional Hilbert space, once you pick an orthonormal basis, every linear operator becomes a matrix. The recipe is short enough to fit on one line — you will see it in the next section — and it is one of the single most-used tricks in all of quantum mechanics. Once you know it you can translate any operator you can name into a concrete matrix, manipulate the matrix, and translate back. That is what this chapter builds.

Operators in the abstract — the three-line definition

Before you pick a basis, what is an operator? The cleanest definition is three lines of linear algebra.

An operator A on a Hilbert space \mathcal{H} is a function that takes a ket in \mathcal{H} to another ket in \mathcal{H}. You write the action as

A|\psi\rangle = |\psi'\rangle.

It is required to be linear: for any two kets |\psi\rangle, |\phi\rangle and any two complex numbers c_1, c_2,

A(c_1|\psi\rangle + c_2|\phi\rangle) = c_1\,A|\psi\rangle + c_2\,A|\phi\rangle.

That is the whole definition. An operator is a linear map from kets to kets. It has no matrix yet. There is no basis yet. It is a coordinate-free object, like a function before you picked a way to plot it.

Every operator you have met in this track is linear: the Pauli gates, the Hadamard, the projectors of chapter 6, the identity. Non-linear maps exist in mathematics, but they do not appear in quantum mechanics — the unitary evolution of a closed quantum system is always linear, by postulate.

Now, to compute anything, you need numbers. Numbers come from a basis. That is the next step.

The recipe — matrix elements as inner products

Pick an orthonormal basis \{|1\rangle, |2\rangle, \ldots, |n\rangle\} for your n-dimensional Hilbert space. The matrix of A in this basis is the n \times n array of complex numbers

A_{ij} = \langle i|A|j\rangle.

Read the recipe carefully: the (i, j) entry of the matrix is the inner product of the i-th basis vector (turned into a bra) with the result of applying A to the j-th basis vector.

Why this recipe works — the derivation in one line. Insert a resolution of the identity on both sides: A = I\,A\,I = \sum_{i, j}|i\rangle\langle i|A|j\rangle\langle j| = \sum_{i, j}A_{ij}\,|i\rangle\langle j|. So the numbers A_{ij} are exactly the coefficients when you expand A in the basis of outer products |i\rangle\langle j| — and those coefficients are inner products by construction.

The action of A on any ket |\psi\rangle = \sum_j c_j|j\rangle now becomes pure matrix-vector multiplication. Compute:

A|\psi\rangle = A\sum_j c_j|j\rangle = \sum_j c_j\,A|j\rangle = \sum_{i, j} c_j\,|i\rangle\langle i|A|j\rangle = \sum_i\Bigl(\sum_j A_{ij}c_j\Bigr)|i\rangle.

The new coefficients are \sum_j A_{ij}c_j — the i-th row of the matrix A times the column vector c. That is standard matrix-vector multiplication, which is why the picture works: operators on a finite-dimensional Hilbert space are matrices, once the basis is chosen.

Extracting a matrix element as an inner productA left-to-right diagram. On the right a ket labelled |j> represents a basis state. An operator A in the middle acts on |j>. On the left a bra labelled <i| takes the inner product with the result. The final output is a single complex number A_ij written on the far right.</desc>⟨i|bra ofthe basisAthe abstractoperator|j⟩ket ofthe basis=Aᵢⱼone complexnumberAᵢⱼ = ⟨i|A|j⟩ — the recipe for the matrix of A in the basis {|i⟩}
Extracting one matrix element. Hand $A$ the $j$-th basis ket; it produces some output ket. Take the inner product of that output with the $i$-th basis bra. The single complex number you get out is $A_{ij}$. Run this over every $(i, j)$ pair and you have filled in the whole matrix.

A worked derivation — extracting the Hadamard matrix

The Hadamard gate is most commonly defined by how it acts on the computational basis:

H|0\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) = |+\rangle, \qquad H|1\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle) = |-\rangle.

Extract the matrix. There are four entries to compute: H_{00}, H_{01}, H_{10}, H_{11}.

H_{00} = \langle 0|H|0\rangle = \langle 0|\,\tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) = \tfrac{1}{\sqrt{2}}\bigl(\langle 0|0\rangle + \langle 0|1\rangle\bigr) = \tfrac{1}{\sqrt{2}}(1 + 0) = \tfrac{1}{\sqrt{2}}.

Why the inner products simplify: \langle 0|0\rangle = 1 because the computational-basis states are unit vectors, and \langle 0|1\rangle = 0 because they are orthogonal. Only the |0\rangle-part of H|0\rangle survives the bra-ket.

H_{01} = \langle 0|H|1\rangle = \langle 0|\,\tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle) = \tfrac{1}{\sqrt{2}}(1 - 0) = \tfrac{1}{\sqrt{2}}.
H_{10} = \langle 1|H|0\rangle = \langle 1|\,\tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) = \tfrac{1}{\sqrt{2}}(0 + 1) = \tfrac{1}{\sqrt{2}}.
H_{11} = \langle 1|H|1\rangle = \langle 1|\,\tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle) = \tfrac{1}{\sqrt{2}}(0 - 1) = -\tfrac{1}{\sqrt{2}}.

Assemble:

H = \begin{pmatrix} H_{00} & H_{01} \\ H_{10} & H_{11} \end{pmatrix} = \tfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.

Exactly the matrix you have seen. The recipe delivers every gate's matrix by one pass of inner products.

The same operator, different matrices

The matrix of an operator depends on the basis you chose. Change the basis, change the matrix — the abstract operator is the same, but its numerical representation shifts.

Take the identity operator, I. In the computational basis \{|0\rangle, |1\rangle\} its matrix is

I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},

the 2 \times 2 identity matrix. In the X-basis \{|+\rangle, |-\rangle\} its matrix is

\langle +|I|+\rangle = \langle +|+\rangle = 1, \quad \langle +|I|-\rangle = 0, \quad \langle -|I|+\rangle = 0, \quad \langle -|I|-\rangle = 1,

so the X-basis matrix of I is also \text{diag}(1, 1). The identity has the same matrix in every basis.

But consider the Pauli Z gate, which acts as Z|0\rangle = |0\rangle and Z|1\rangle = -|1\rangle. In the computational basis:

Z_{\text{comp}} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.

In the X-basis:

Z|+\rangle = \tfrac{1}{\sqrt{2}}\bigl(Z|0\rangle + Z|1\rangle\bigr) = \tfrac{1}{\sqrt{2}}\bigl(|0\rangle - |1\rangle\bigr) = |-\rangle,
Z|-\rangle = \tfrac{1}{\sqrt{2}}\bigl(Z|0\rangle - Z|1\rangle\bigr) = \tfrac{1}{\sqrt{2}}\bigl(|0\rangle + |1\rangle\bigr) = |+\rangle.

So in the X-basis, Z swaps the two basis kets — its matrix is

Z_{X} = \begin{pmatrix} \langle +|Z|+\rangle & \langle +|Z|-\rangle \\ \langle -|Z|+\rangle & \langle -|Z|-\rangle \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.

That is the matrix of the Pauli X gate in the computational basis. The same abstract operator Z has two different matrices — \text{diag}(1, -1) in one basis, \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} in the other.

The same operator with two different matricesTwo matrix boxes side by side, both labelled Z. The left matrix is diagonal with entries 1 and minus 1, labelled computational basis. The right matrix is the off-diagonal X-looking matrix, labelled X basis. Arrows between them carry the relation A prime equals U dagger A U.Z in {|0⟩, |1⟩}100−1A′ = U†AUvia U = H (change of basis)Z in {|+⟩, |−⟩}0110same operator, two different matrices — the basis made the difference
The Pauli $Z$ operator in two bases. In the computational basis it is diagonal. In the $X$-basis it becomes off-diagonal — in fact, it is the matrix the Pauli $X$ gate has in the computational basis. The two matrices are related by the change-of-basis formula $A' = U^\dagger A U$ using the Hadamard $U = H$, which is the change-of-basis matrix between the two bases.

This is an important habit-of-mind. Operators are basis-independent abstractions; matrices are basis-dependent representations. When someone tells you "the matrix of operator A," your first question should be "in what basis?" The matrix of the identity is always the identity, but most operators have different numerical representations in different bases.

Chapter 8 will have more to say about change-of-basis formulas; the going-deeper section at the end of this chapter states the formula A' = U^\dagger A U and explains where it comes from.

The adjoint — the dagger operation

You have been seeing the symbol \dagger (pronounced "dagger") for two chapters. Time to pin it down. The adjoint of an operator A, written A^\dagger, is the operator whose matrix is the conjugate transpose of A's matrix:

(A^\dagger)_{ij} = (A_{ji})^*.

Take the matrix of A, swap rows and columns (transpose), and complex-conjugate every entry. That is the matrix of A^\dagger.

Example. For A = \begin{pmatrix} 1 & 2+i \\ 3 & 4-i \end{pmatrix}:

A^\dagger = \begin{pmatrix} 1 & 3 \\ 2-i & 4+i \end{pmatrix}.

Why each entry changed: swapping rows and columns moved (1,2) = 2+i to position (2,1), and complex-conjugating it turned 2+i into 2-i. Same for the others. The real entries 1, 3, 4 (the original 4-i had a complex part too; only 1 and 3 were pure real) either kept their place or moved without conjugation changes.

Adjoint in bra-ket form

There is an equivalent, basis-free way to state the adjoint. The operator A^\dagger is the unique operator that satisfies

\langle A\psi|\phi\rangle = \langle\psi|A^\dagger|\phi\rangle,

for all states |\psi\rangle, |\phi\rangle. Equivalently, and more commonly written,

\langle\phi|A|\psi\rangle^* = \langle\psi|A^\dagger|\phi\rangle.

Why these are the same statement: take the complex conjugate of both sides of \langle\phi|A|\psi\rangle^* = \langle\psi|A^\dagger|\phi\rangle. Using \overline{\langle x|y\rangle} = \langle y|x\rangle, the left side becomes \langle A\psi|\phi\rangle (where \langle A\psi| = (A|\psi\rangle)^\dagger) and the right side becomes \langle A^\dagger\phi|\psi\rangle^* = \langle\psi|A^\dagger\phi\rangle. So the two forms agree.

The definition above does not require a basis — it says "for every pair of states, the inner products on the two sides agree," which is a coordinate-free condition. Once you fix a basis, the definition reduces to the conjugate-transpose rule.

The reversal rule

The dagger has one computational property you will use constantly. For any two operators A and B:

(AB)^\dagger = B^\dagger A^\dagger.

The order reverses when you dagger a product.

Proof. Compute (AB)^\dagger entry-by-entry:

((AB)^\dagger)_{ij} = (AB)_{ji}^* = \Bigl(\sum_k A_{jk}B_{ki}\Bigr)^* = \sum_k A_{jk}^* B_{ki}^* = \sum_k (B^\dagger)_{ik}(A^\dagger)_{kj} = (B^\dagger A^\dagger)_{ij}.

Why the order had to reverse: matrix multiplication is not commutative, so (AB)_{ji} has A on the left and B on the right. When you dagger and rearrange, the conjugate-transposed pieces naturally rebind in the opposite order — B^\dagger on the left, A^\dagger on the right.

The same rule extends to products of kets and bras: (|\psi\rangle\langle\phi|)^\dagger = |\phi\rangle\langle\psi|. The outer product's two factors flip and dagger (ket to bra, bra to ket), which matches the reversal rule exactly — you saw this in the Hermitian-conjugate property of projectors in chapter 6.

The three operator families you meet in QC

Three kinds of operators dominate quantum computing. Each is defined by a specific relation between A and A^\dagger.

Unitary: U^\dagger U = I

An operator U is unitary if its adjoint is also its inverse:

U^\dagger U = U U^\dagger = I.

Unitary operators preserve inner products: if |\phi'\rangle = U|\phi\rangle and |\psi'\rangle = U|\psi\rangle, then

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

Why this matters: inner products are preserved, so norms are preserved, and a unit vector stays a unit vector. Unitary operators are the rotations of Hilbert space — they rearrange states without stretching or shrinking them. This is why quantum gates are unitary: you cannot have a gate that unnormalises a state.

Examples: every quantum gate. The Pauli X, Y, Z, the Hadamard H, the phase gate S, the T gate, every CNOT, every rotation R_x(\theta), R_y(\theta), R_z(\theta), and in fact every arbitrary unitary you can construct from those. The whole of gate-based quantum computing lives inside the unitary group.

H = \tfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad H^\dagger = \tfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad HH^\dagger = \tfrac{1}{2}\begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = I.

H is its own dagger (a real-valued Hermitian matrix has A^\dagger = A^T, and this A is symmetric), and multiplying by itself gives the identity — so H is both Hermitian and unitary. It is one of the rare gates that sits in both families.

Hermitian: A = A^\dagger

An operator A is Hermitian (or self-adjoint) if it equals its own adjoint:

A = A^\dagger.

In matrix form: the diagonal entries are real, and off-diagonal entries satisfy A_{ij} = A_{ji}^* — symmetric up to conjugation.

Hermitian operators have two crucial properties, both provable in a page of linear algebra.

  1. Real eigenvalues. All the eigenvalues of a Hermitian operator are real numbers.
  2. Orthogonal eigenvectors. Eigenvectors corresponding to distinct eigenvalues are orthogonal, and you can always find a full orthonormal basis of eigenvectors (the spectral theorem).

This is why Hermitian operators are used to represent physical observables: the real eigenvalues are the possible measurement outcomes, and the orthonormal eigenbasis gives you the projectors associated with each outcome. Chapter 12 on projective measurement will unpack this.

Examples: the Pauli operators X, Y, Z are all Hermitian. So are the projectors |\psi\rangle\langle\psi| of chapter 6. So is any energy operator (Hamiltonian) H. The computational-basis number operator N = |1\rangle\langle 1| has eigenvalues 0 and 1, which is why it encodes "the bit value."

X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = X^\dagger. \ \checkmark

Projectors: P^2 = P = P^\dagger

From chapter 6: a projector P is Hermitian and idempotent.

P^2 = P, \qquad P^\dagger = P.

All projectors are Hermitian, but not all Hermitian operators are projectors — the idempotency condition P^2 = P is extra. It forces the eigenvalues of P to be 0 or 1 only (any real number \lambda satisfying \lambda^2 = \lambda is 0 or 1).

Projectors are the objects that describe measurement outcomes; you built them in chapter 6 and will see them deployed in chapter 12.

Summary table

Three operator families in quantum computingA three-row table. Columns are labelled Family, Defining condition, and Example. Row 1 is unitary with U dagger U equals I and example H over root two with a specific 2-by-2 matrix. Row 2 is Hermitian with A equals A dagger and example Pauli X. Row 3 is Projector with P squared equals P equals P dagger and example |0><0| showing the diagonal matrix.FamilyDefining conditionExampleUnitaryU†U = I — gates preserve normsH = ½√2 ×(1, 1; 1, −1)HermitianA = A† — observables, real eigenvaluesX =(0, 1; 1, 0)ProjectorP² = P = P† — measurement outcomes|0⟩⟨0| =(1, 0; 0, 0)
Three operator families. Each is a subfamily of "all linear operators" defined by how $A$ relates to $A^\dagger$. Unitary operators are the gates; Hermitian operators are the observables; projectors are the measurement outcomes. All three appear in nearly every quantum circuit you will meet.

The trace — a basis-independent summary

The trace of an operator is the sum of its diagonal matrix elements:

\text{tr}(A) = \sum_i A_{ii} = \sum_i \langle i|A|i\rangle.

At first glance this looks like a basis-dependent quantity — you are summing diagonal entries of a specific matrix. It is not. The trace is invariant under change of basis: compute the trace in any orthonormal basis and you get the same number.

You will prove this properly in chapter 8, but the key tool is the cyclic property:

\text{tr}(AB) = \text{tr}(BA).

Short proof:

\text{tr}(AB) = \sum_i (AB)_{ii} = \sum_{i, j} A_{ij}B_{ji} = \sum_{i, j} B_{ji}A_{ij} = \sum_j (BA)_{jj} = \text{tr}(BA).

Why the summation rearrange is legal: the sums \sum_{i, j} over all pairs of indices, and scalar multiplication commutes, so A_{ij}B_{ji} = B_{ji}A_{ij} term-by-term. The reindexing just collects the terms into the alternative matrix product.

By cyclicity, if U is unitary and A is any operator, then \text{tr}(U^\dagger A U) = \text{tr}(U U^\dagger A) = \text{tr}(A). So changing the basis (which rotates the matrix of A by U^\dagger \cdot U on both sides) leaves the trace unchanged.

Examples of the trace appearing in quantum mechanics:

The trace is the simplest basis-independent summary number you can extract from an operator. In quantum information it shows up everywhere — in the definition of expectation values, fidelities, and the partial trace over a subsystem (chapter 9).

Worked examples

Example 1: Find the matrix of $A = |0\rangle\langle 1| + |1\rangle\langle 0|$

You are told an operator A as a sum of outer products:

A = |0\rangle\langle 1| + |1\rangle\langle 0|.

Compute its matrix in the computational basis. What is A?

Step 1. Use the definitions from chapter 6 to write each outer product as a matrix.

|0\rangle\langle 1| = \begin{pmatrix} 1 \\ 0 \end{pmatrix}(0, 1) = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, \qquad |1\rangle\langle 0| = \begin{pmatrix} 0 \\ 1 \end{pmatrix}(1, 0) = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}.

Why the entries land where they do: the outer product |i\rangle\langle j| has a 1 in position (i+1, j+1) and 0 elsewhere (using 0-indexed qubit labels to match the matrix rows and columns). Adding the two gets 1s in the off-diagonal positions and 0s on the diagonal.

Step 2. Add the matrices.

A = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} + \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.

Step 3. Recognise the result. This is the Pauli X gate's matrix in the computational basis. So

A = X.

Step 4. Verify by applying A to |0\rangle and |1\rangle and checking the action.

A|0\rangle = |0\rangle\langle 1|0\rangle + |1\rangle\langle 0|0\rangle = |0\rangle \cdot 0 + |1\rangle \cdot 1 = |1\rangle.
A|1\rangle = |0\rangle\langle 1|1\rangle + |1\rangle\langle 0|1\rangle = |0\rangle \cdot 1 + |1\rangle \cdot 0 = |0\rangle.

Why this is the bit-flip: A takes |0\rangle to |1\rangle and |1\rangle to |0\rangle. That is exactly what the Pauli X gate does — the quantum analogue of the classical NOT gate.

Result. The abstract operator A = |0\rangle\langle 1| + |1\rangle\langle 0| is the Pauli X gate, whose matrix in the computational basis is

X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.
Outer-product sum equals the Pauli X matrixThree 2-by-2 matrix boxes in a row. The first is |0><1| with a single 1 in the top-right. The second is |1><0| with a single 1 in the bottom-left. The third box, after a plus and equals sign, is the Pauli X matrix with 1s on the off-diagonal.|0⟩⟨1|0100+|1⟩⟨0|0010=X0110abstract outer-product sum → concrete Pauli X matrix
The operator $A = |0\rangle\langle 1| + |1\rangle\langle 0|$ as the sum of two rank-1 projectors (well, outer products — they are not projectors because the two factors are different). The result is the Pauli $X$ matrix, the bit-flip gate. The recipe works in both directions: you can start from outer products and build the matrix, or start from the matrix and read off the outer-product expansion.

What this shows. Outer-product notation and matrix notation are the same information in two different forms. Given one, you can always produce the other. This is why you will see textbooks switching back and forth freely — a derivation that looks clean in bra-ket form might hide a nasty matrix calculation, and vice versa.

Example 2: Compute the trace of a pure-state projector

Let |\psi\rangle be any normalised state in an n-dimensional Hilbert space, so \langle\psi|\psi\rangle = 1. Show that \text{tr}(|\psi\rangle\langle\psi|) = 1.

Step 1. Use the basis-expansion form of |\psi\rangle. Pick any orthonormal basis \{|i\rangle\}, and write

|\psi\rangle = \sum_i c_i|i\rangle, \qquad \langle\psi| = \sum_i c_i^*\langle i|.

Why this expansion exists: completeness says any state can be written as a sum over basis kets with complex coefficients c_i = \langle i|\psi\rangle.

Step 2. Compute the projector |\psi\rangle\langle\psi| as a double sum.

|\psi\rangle\langle\psi| = \sum_{i, j} c_i c_j^*\,|i\rangle\langle j|.

Step 3. Take the trace. The trace sums the diagonal matrix elements:

\text{tr}(|\psi\rangle\langle\psi|) = \sum_k \langle k|\psi\rangle\langle\psi|k\rangle = \sum_k c_k c_k^* = \sum_k |c_k|^2.

Why the middle equality: \langle k|\psi\rangle = c_k (the k-th coefficient), and \langle\psi|k\rangle = c_k^* (the conjugate, because bra-ket flips the conjugation). Their product is |c_k|^2.

Step 4. Use normalisation.

The condition \langle\psi|\psi\rangle = 1 says, when expanded, \sum_k |c_k|^2 = 1. So:

\text{tr}(|\psi\rangle\langle\psi|) = \sum_k |c_k|^2 = 1. \ \checkmark

Result. For any normalised pure state |\psi\rangle, the trace of the corresponding projector is exactly 1:

\text{tr}(|\psi\rangle\langle\psi|) = 1.
Trace of a pure-state projectorA 2-by-2 matrix box labelled |psi><psi|. The top-left entry is |c_0|^2, the top-right is c_0 c_1-conjugate, the bottom-left is c_1 c_0-conjugate, and the bottom-right is |c_1|^2. The two diagonal entries are highlighted in red. An arrow leads from the diagonal to the number 1 at the right.</desc>|ψ⟩⟨ψ| — general pure-state projector|c₀|²c₀c₁*c₁c₀*|c₁|²sum the diagonaltr|c₀|² + |c₁|² = 1by normalisation
The trace of a pure-state projector. The diagonal entries of $|\psi\rangle\langle\psi|$ are the squared magnitudes of the state's coefficients. Normalisation forces them to sum to $1$, so every pure-state projector has trace $1$ — a defining property that chapter 13 will use to generalise the idea to density matrices.

What this shows. The trace of a pure-state projector is a rigid fact — it is always 1, regardless of what the state is or what basis you chose. This is the first example of a "basis-independent scalar summary" of an operator. In chapter 13, when you meet density matrices, the same fact will appear in its more general form: \text{tr}(\rho) = 1 for any density matrix. Pure-state projectors are the simplest density matrices, and this trace-is-one property is one way to see it.

Common confusions

Going deeper

If you can extract the matrix of an operator using A_{ij} = \langle i|A|j\rangle, compute a conjugate transpose, recognise which of the three families an operator belongs to, and compute a trace — you have everything you need for the next several chapters. What follows is optional context: the change-of-basis formula, functions of operators via the spectral decomposition, the operator norm, and an Indian-context aside on Meghnad Saha's ionisation equation.

Change of basis — the similarity transformation

If \{|i\rangle\} and \{|i'\rangle\} are two orthonormal bases for the same Hilbert space, they are related by a unitary operator U:

|i'\rangle = U|i\rangle,

or equivalently U has columns equal to the new basis vectors written in the old basis. The matrices of the same abstract operator A in the two bases are related by

A' = U^\dagger A U.

Derivation. The entry of A' in the new basis is

A'_{ij} = \langle i'|A|j'\rangle = \langle U i|A|Uj\rangle = \langle i|U^\dagger A U|j\rangle = (U^\dagger A U)_{ij}.

Why the formula has this shape: the old basis ket |j\rangle is turned into the new basis ket by U, and the old basis bra is turned by U^\dagger (the dagger because bras are conjugate transposes of kets). The operator A is sandwiched in the middle.

A similarity transformation like U^\dagger A U is also called a unitary conjugation of A. It preserves the trace and the eigenvalues of A (and hence the determinant, and any other basis-invariant quantity). What changes is the specific matrix — the numerical representation rotates.

Example. The Pauli Z matrix in the computational basis is \text{diag}(1, -1). The change-of-basis matrix from the computational basis to the X-basis is H. So the matrix of Z in the X-basis is

H^\dagger Z H = H Z H = \tfrac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \tfrac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix} = \tfrac{1}{2}\begin{pmatrix} 0 & 2 \\ 2 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.

Exactly the matrix you computed earlier as the X-basis representation of Z. The change-of-basis formula works.

Functions of operators via spectral decomposition

Any Hermitian operator A with spectral decomposition A = \sum_i \lambda_i |i\rangle\langle i| has a function f(A) defined by

f(A) = \sum_i f(\lambda_i)\,|i\rangle\langle i|.

You apply f to each eigenvalue, leaving the eigenprojectors unchanged. This definition agrees with the power-series definition of f(A) — for instance, e^A = \sum_k A^k / k! — whenever the power series converges.

Example. X^2 = I because X = |+\rangle\langle +| - |-\rangle\langle -| (spectral decomposition with eigenvalues \pm 1), so X^2 = 1 \cdot |+\rangle\langle +| + 1 \cdot |-\rangle\langle -| = I.

Example 2. The rotation gate R_x(\theta) = e^{-i\theta X/2} can be computed by applying e^{-i\theta \lambda/2} to each eigenvalue \lambda = \pm 1 of X. This gives

R_x(\theta) = e^{-i\theta/2}|+\rangle\langle +| + e^{i\theta/2}|-\rangle\langle -|.

Expanding in the computational basis gives the familiar matrix

R_x(\theta) = \begin{pmatrix} \cos(\theta/2) & -i\sin(\theta/2) \\ -i\sin(\theta/2) & \cos(\theta/2) \end{pmatrix}.

Functions of operators are how you define every continuous quantum gate — rotations, time evolution under a Hamiltonian, unitary channels. Chapter 25 unpacks this for the single-qubit rotation gates.

The operator norm

There are several "sizes" you can associate with an operator. The most common in quantum information is the operator norm (also called the spectral norm):

\|A\|_{\text{op}} = \max_{|\psi\rangle \neq 0} \frac{\|A|\psi\rangle\|}{\||\psi\rangle\|}.

The operator norm is the largest factor by which A can stretch a vector. For a Hermitian operator, the operator norm equals the largest-in-magnitude eigenvalue:

\|A\|_{\text{op}} = \max_i |\lambda_i| \quad (\text{for Hermitian }A).

Unitary operators have operator norm 1 (they preserve lengths). Projectors have operator norm 1 (they do not stretch, though they can shrink). Pauli gates have operator norm 1. A general Hermitian operator with eigenvalues \{-3, 0, 2, 5\} has operator norm 5.

The operator norm is used everywhere in error analysis. The distance between two unitaries U_1 and U_2 is often measured as \|U_1 - U_2\|_{\text{op}}; a noisy gate is characterised by the operator norm of its deviation from the ideal. Quantum error-correction thresholds, algorithm analyses, and convergence proofs all use it.

Meghnad Saha's ionisation equation as an operator application

In 1920, the Indian astrophysicist Meghnad Saha derived an equation that predicts, given the temperature and pressure of a gas, what fraction of its atoms are ionised — that is, what fraction have lost an electron. The equation became fundamental to astrophysics: it is how you read the surface temperature of a star from its spectral lines. The Sun's temperature, the composition of a white dwarf, the boundary between neutral and ionised regions in a galaxy — all of them come out of Saha's equation.

The underlying mathematics rests on operators and their eigenvalues. A hydrogen atom's electron has discrete energy levels E_n, which are the eigenvalues of the Hamiltonian operator H (the observable for energy). Each E_n is associated with a projector P_n = |n\rangle\langle n| — exactly the chapter 6 construction. The population of atoms in state n at thermal equilibrium follows the Boltzmann factor e^{-E_n/k_B T} — a function of the operator H evaluated at its eigenvalues, exactly the construction of "functions of operators" above.

Saha put these pieces together and wrote down a formula for the ratio of ionised to neutral populations. The ratio depends on the eigenvalues of the Hamiltonian (the energies), the eigen-projectors (one per quantum state), and basic thermal statistics. Every element of the formal structure of this chapter appears in his derivation: operators as matrices, their matrix elements as inner products, the trace as a basis-independent sum over eigenvalues.

When you see an emission or absorption spectrum in any astrophysics text — Balmer lines from a star, absorption lines from a Saha-Bridge, the boundaries of H II regions — the machinery you have been building here is what makes those predictions possible.

Where this leads next

References

  1. Nielsen and Chuang, Quantum Computation and Quantum Information (2010), §2.1 — Cambridge University Press.
  2. John Preskill, Lecture Notes on Quantum Computation, Ch. 2 — theory.caltech.edu/~preskill/ph229.
  3. John Watrous, The Theory of Quantum Information, §1.1 — cs.uwaterloo.ca/~watrous/TQI.
  4. Wikipedia, Operator (physics) — Hermitian, unitary, and projector families.
  5. Wikipedia, Trace (linear algebra) — basis-independence and the cyclic property.
  6. Wikipedia, Meghnad Saha — the ionisation equation and its operator formulation.