A linear operator becomes concrete the moment you pick a basis: it turns into a grid of numbers, a
matrix. The individual numbers in that grid are called matrix elements, and computing them is
the everyday arithmetic of quantum mechanics.
Definition
Let {∣e1⟩,…,∣en⟩} be an orthonormal basis, so ⟨ei∣ej⟩=δij. For a linear operator A, the matrix element between basis vectors ∣ei⟩
and ∣ej⟩ is the complex number
Aij=⟨ei∣A∣ej⟩.
Read it inside out: first A acts on ∣ej⟩ to produce a vector A∣ej⟩, then you take
the inner product of that vector with ∣ei⟩. The result is a single scalar — the entry in
row i, column j of the matrix of A.
Why this recovers the whole matrix
Recall from the previous lesson that A∣ej⟩=∑iAij∣ei⟩. Take the inner
product of both sides with ⟨ei∣ and use orthonormality:
⟨ei∣A∣ej⟩=k∑Akj⟨ei∣ek⟩=k∑Akjδik=Aij.
So the bracket ⟨ei∣A∣ej⟩ is exactly the coefficient Aij. Sweeping i and
j over the basis fills in the entire matrix. The matrix and the operator carry the same
information once a basis is fixed.
Reading off the matrix from gate actions
For a qubit with the computational basis {∣0⟩,∣1⟩} (with ∣0⟩ labeling row/
column 0 and ∣1⟩ labeling row/column 1), the three Pauli operators are
X=(0110),Y=(0i−i0),Z=(100−1).
Take Y. Its defining action is Y∣0⟩=i∣1⟩ and Y∣1⟩=−i∣0⟩. To find
⟨0∣Y∣1⟩, compute Y∣1⟩=−i∣0⟩ and then project onto ⟨0∣:
⟨0∣Y∣1⟩=⟨0∣(−i∣0⟩)=−i⟨0∣0⟩=−i.
That −i sits in row 0, column 1 — exactly the top-right entry of the matrix above. Likewise
⟨1∣Y∣0⟩=⟨1∣(i∣1⟩)=i,
the bottom-left entry. Notice ⟨0∣Y∣1⟩=⟨1∣Y∣0⟩: the
off-diagonal elements are complex conjugates of each other. That is the Hermitian symmetry
Aij=Aji, a property we will study in detail two lessons from now.
A useful sanity check: the trace
The diagonal matrix elements Aii=⟨ei∣A∣ei⟩ add up to the trace,
Tr(A)=i∑⟨ei∣A∣ei⟩.
Remarkably, the trace does not depend on the chosen orthonormal basis, even though the individual
Aii do. For each Pauli matrix above, the two diagonal entries cancel, so Tr(X)=Tr(Y)=Tr(Z)=0.
Try it
Compute the matrix element ⟨1∣Y∣0⟩ of the Pauli-Y operator. It is purely
imaginary — return its imaginary part as a plain number.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.