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
It is required to be linear: for any two kets |\psi\rangle, |\phi\rangle and any two complex numbers c_1, c_2,
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
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:
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.
A worked derivation — extracting the Hadamard matrix
The Hadamard gate is most commonly defined by how it acts on the computational basis:
Extract the matrix. There are four entries to compute: H_{00}, H_{01}, H_{10}, H_{11}.
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.
Assemble:
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
the 2 \times 2 identity matrix. In the X-basis \{|+\rangle, |-\rangle\} its matrix is
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:
In the X-basis:
So in the X-basis, Z swaps the two basis kets — its matrix is
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.
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:
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}:
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
for all states |\psi\rangle, |\phi\rangle. Equivalently, and more commonly written,
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:
The order reverses when you dagger a product.
Proof. Compute (AB)^\dagger entry-by-entry:
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:
Unitary operators preserve inner products: if |\phi'\rangle = U|\phi\rangle and |\psi'\rangle = U|\psi\rangle, then
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 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:
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.
- Real eigenvalues. All the eigenvalues of a Hermitian operator are real numbers.
- 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."
Projectors: P^2 = P = P^\dagger
From chapter 6: a projector P is Hermitian and idempotent.
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
The trace — a basis-independent summary
The trace of an operator is the sum of its diagonal matrix elements:
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:
Short proof:
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:
- \text{tr}(|\psi\rangle\langle\psi|) = 1 for any normalised state (you will prove this in Example 2 below).
- \text{tr}(\rho) = 1 for any density matrix \rho (the density-matrix generalisation of normalisation; chapter 13 will define this).
- \text{tr}(P\rho) = probability of outcome associated with the projector P, when the state is described by the density matrix \rho.
- \text{tr}(A) = sum of eigenvalues of A (in any basis).
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:
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.
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.
Step 3. Recognise the result. This is the Pauli X gate's matrix in the computational basis. So
Step 4. Verify by applying A to |0\rangle and |1\rangle and checking the action.
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
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
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.
Step 3. Take the trace. The trace sums the diagonal matrix elements:
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:
Result. For any normalised pure state |\psi\rangle, the trace of the corresponding projector is exactly 1:
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
-
"Operators and matrices are the same thing." Close, but not quite. In finite dimensions, every linear operator can be represented by a matrix once a basis is fixed, and every matrix defines a linear operator. In that sense they are equivalent. But operators are basis-independent abstractions; matrices are basis-dependent representations. You will often see "the Pauli X operator" or "the Hadamard operator" — and the relevant matrix is always the one in the computational basis unless stated otherwise. Keeping the distinction in mind helps when you change bases (which you will do in chapters 8 and 11).
-
"Hermitian and unitary are the same." No. Hermitian operators satisfy A = A^\dagger; unitary operators satisfy U^\dagger U = I. Hermitian operators have real eigenvalues (they represent observables); unitary operators have eigenvalues of modulus 1 (they represent reversible transformations). A few operators are both Hermitian and unitary — the Pauli gates are the canonical examples — but in general these are two distinct families.
-
"The dagger is the inverse." Only for unitary operators: U^\dagger = U^{-1}. For a general operator, the dagger is the adjoint (conjugate transpose), which is not the same as the inverse. A Hermitian operator with zero eigenvalues is not invertible but is certainly its own dagger. Projectors are Hermitian but not invertible (because they kill the perpendicular subspace). Treating the dagger as "quantum inverse" is a common early mistake.
-
"The trace is just the sum of diagonal entries in a particular basis." It is, operationally — but the trace is basis-independent. No matter which orthonormal basis you use, \sum_i A_{ii} gives the same number. This is why the trace is useful as a physical quantity: it does not depend on how you set up your coordinates.
-
"Every 2 \times 2 matrix is a quantum gate." No. Quantum gates must be unitary, and most 2 \times 2 complex matrices are not unitary. The constraint U^\dagger U = I is four real equations on eight real numbers (the real and imaginary parts of the four complex entries), so the unitary 2 \times 2 matrices form a four-parameter family — a submanifold of all 2 \times 2 matrices, not the whole space. The Pauli X, Y, Z, H, S, T, and all rotation gates live in this family.
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:
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
Derivation. The entry of A' in the new basis is
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
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
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
Expanding in the computational basis gives the familiar matrix
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):
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:
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
- Tensor Products the Quantum Way — chapter 8, next in the track. How operators on two qubits are 4 \times 4 matrices, how the tensor product combines two smaller operators, and the first step into multi-qubit quantum computing.
- Four Postulates of Quantum Mechanics — chapter 11. The formal postulates, where unitary operators govern evolution and Hermitian operators represent observables.
- Pauli X, Y, Z Gates — chapter 22. The three fundamental single-qubit gates as specific Hermitian-and-unitary matrices, along with their algebraic relations.
- Adjoints and Hermitian Operators — chapter 23. A focused article on Hermitian operators, their eigenvalue properties, and the spectral theorem.
- Rotation Gates — chapter 25. R_x(\theta), R_y(\theta), R_z(\theta) as matrix exponentials of the Pauli operators.
References
- Nielsen and Chuang, Quantum Computation and Quantum Information (2010), §2.1 — Cambridge University Press.
- John Preskill, Lecture Notes on Quantum Computation, Ch. 2 — theory.caltech.edu/~preskill/ph229.
- John Watrous, The Theory of Quantum Information, §1.1 — cs.uwaterloo.ca/~watrous/TQI.
- Wikipedia, Operator (physics) — Hermitian, unitary, and projector families.
- Wikipedia, Trace (linear algebra) — basis-independence and the cyclic property.
- Wikipedia, Meghnad Saha — the ionisation equation and its operator formulation.