
Operators in Quantum Mechanics#
Part 27 of the Learning Quantum Physics series.
An operator takes the column of a state and returns a new column. On one qubit the column has two entries, so the operator is a 2 by 2 matrix. Write the matrix on the left. Write the column on the right. Multiply.
From Geometry to Quantum Mechanics uses these names side by side with arrows in a plane. This article defines each operator, writes its matrix, and says what the matrix does.
The two basis columns of one qubit are
\[ |0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \qquad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}. \]The top entry is the amplitude of \(|0\rangle\). The bottom entry is the amplitude of \(|1\rangle\). A general column is \(\alpha|0\rangle + \beta|1\rangle\). The number \(i\) satisfies \(i^2 = -1\).
In a product of matrices, the rightmost matrix acts first. The product \(ZH\) means: apply \(H\), then apply \(Z\). Here \(H\) is the Hadamard gate. §7 lists the other names in this series that start with H.
1. A column in, a column out#
Pauli \(X\) is the matrix
\[ X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. \]Apply it to \(|0\rangle\):
\[ \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} = |1\rangle. \]The top entry of the product is \(0\cdot 1 + 1\cdot 0 = 0\). The bottom entry is \(1\cdot 1 + 0\cdot 0 = 1\). So \(X\) sends the 0 column to the 1 column. The same multiplication sends \(|1\rangle\) to \(|0\rangle\).
That is the whole action of an operator on a state: matrix times column.
Three words name three jobs. A gate changes the state and keeps the length equal to 1. An observable is the matrix of a quantity you can measure. A projector keeps the piece of the column that matches one reading. §2 is the test for each job. The vocabulary map keeps the matrix, the physical quantity, and the laboratory instrument as three separate objects. Multiplying by the matrix is the mathematics. The instrument is the hardware.
2. Three tests#
The dagger \(A^{\dagger}\) is the conjugate transpose of \(A\). Swap rows and columns. Then replace every \(i\) by \(-i\), and every \(-i\) by \(i\).
Pauli \(Y\) is already equal to its own dagger:
\[ Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}, \qquad Y^{\dagger} = Y. \]These three tests assign the job of a square matrix.
| Test | Rule | Job |
|---|---|---|
| Unitary | \(U^{\dagger} U = I\) | Gate, or time evolution of a closed system. The length of the column stays 1. |
| Hermitian | \(A^{\dagger} = A\) | Observable. Each eigenvalue is a possible reading, and each reading is a real number. |
| Projector | \(P^{2} = P\) and \(P^{\dagger} = P\) | Keeps the piece of the column for one reading. Drops the rest. |
\(I\) is the identity matrix, with rows \((1, 0)\) and \((0, 1)\).
A matrix can pass more than one test.
- \(I\) passes all three.
- \(X\), \(Y\), \(Z\), and the Hadamard matrix \(H\) pass the unitary test and the Hermitian test.
- The projector \(|0\rangle\langle 0|\) passes the Hermitian test and the projector test. Applied to \(|+\rangle\) it returns a shorter column. A unitary matrix keeps every column at length 1, so this projector fails the unitary test.
The average reading of an observable \(A\) in the state \(|\psi\rangle\) is the number \(\langle\psi|A|\psi\rangle\). For a projector, that same number is the chance of the matching reading. §6 computes one chance from the length of the projected column.
3. Every operator on one qubit#
Every 2 by 2 matrix is an operator on one qubit. The named list in §4 is the set with a standard job. The three jobs have a complete shape.
Every unitary 2 by 2 matrix has four real parameters: one global phase and three angles.
\[ U = e^{i\alpha}\, R_z(\beta)\, R_y(\gamma)\, R_z(\delta). \]\(\beta\) and \(\delta\) are different angles. \(R_y(\gamma)\) stands between the two \(R_z\) factors, so \(\beta\) and \(\delta\) stay separate. An x-rotation uses both:
\[ R_x(\theta) = R_z(-\pi/2)\, R_y(\theta)\, R_z(\pi/2). \]The rightmost factor acts first. A global phase is the factor \(e^{i\alpha}\). It multiplies the whole column. It does not change the chance of any reading. The named gates in §4 are this shape at special angles.
Every Hermitian 2 by 2 matrix is a real combination of four matrices:
\[ A = a_0 I + a_x X + a_y Y + a_z Z. \]The four coefficients \(a_0, a_x, a_y, a_z\) are real numbers. Every one-qubit observable has this shape. §5 writes the four matrices and their readings.
Every projector on one qubit is one of three matrices. The zero matrix drops the whole column. The identity keeps the whole column. A rank-1 projector \(|\psi\rangle\langle\psi|\), for a column \(|\psi\rangle\) of length 1, keeps the part along \(|\psi\rangle\).
The bra \(\langle 0|\) is the row \((1,\ 0)\). The product of the column \(|0\rangle\) with that row is the matrix
\[ |0\rangle\langle 0| = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}. \]4. Named one-qubit gates#
The Bloch sphere is the picture of one pure qubit as a point on a sphere. A one-qubit unitary turns that point. The angle \(\theta\) in \(R_x(\theta)\), \(R_y(\theta)\), and \(R_z(\theta)\) is the angle of that turn. The entries of the matrix use half of that angle, \(\theta/2\). A half turn on the sphere is \(\theta = \pi\), and the matrix uses \(\pi/2\). The pictures of those turns are in Seeing Three Dimensions.
Two columns used below:
\[ |+\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}, \qquad |-\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}}. \]| Name | Matrix | Tests | Action |
|---|---|---|---|
| Identity \(I\) | \(\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\) | Unitary, Hermitian, projector | Leaves every column unchanged. |
| Pauli \(X\) | \(\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\) | Unitary, Hermitian | Swaps the 0 column and the 1 column. |
| Pauli \(Y\) | \(\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\) | Unitary, Hermitian | Sends the 0 column to \(i\) times the 1 column, and the 1 column to \(-i\) times the 0 column. |
| Pauli \(Z\) | \(\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\) | Unitary, Hermitian | Leaves the 0 column. Multiplies the 1 column by \(-1\). |
| Hadamard \(H\) | \(\dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\) | Unitary, Hermitian | Sends the 0 column to \(\lvert +\rangle\), and the 1 column to \(\lvert -\rangle\). |
| Phase \(S\) | \(\begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}\) | Unitary | Leaves the 0 column. Multiplies the 1 column by \(i\). Two copies equal \(Z\). |
| Phase \(T\) | \(\begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}\) | Unitary | Leaves the 0 column. Multiplies the 1 column by \(e^{i\pi/4}\). Two copies equal \(S\). |
| Phase \(P(\phi)\) | \(\begin{pmatrix} 1 & 0 \\ 0 & e^{i\phi} \end{pmatrix}\) | Unitary | Leaves the 0 column. Multiplies the 1 column by \(e^{i\phi}\). |
| \(R_x(\theta)\) | \(\begin{pmatrix} \cos(\theta/2) & -i\sin(\theta/2) \\ -i\sin(\theta/2) & \cos(\theta/2) \end{pmatrix}\) | Unitary | Turns the Bloch point by \(\theta\) about the x-axis. |
| \(R_y(\theta)\) | \(\begin{pmatrix} \cos(\theta/2) & -\sin(\theta/2) \\ \sin(\theta/2) & \cos(\theta/2) \end{pmatrix}\) | Unitary | Turns the Bloch point by \(\theta\) about the y-axis. |
| \(R_z(\theta)\) | \(\begin{pmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{pmatrix}\) | Unitary | Turns the Bloch point by \(\theta\) about the z-axis. |
| \(\sqrt{X}\) | \(\dfrac{1}{2}\begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \end{pmatrix}\) | Unitary | Two copies, one after the other, equal \(X\). |
Three action cells say what two copies produce. Those cells are the \(S\) row, the \(T\) row, and the \(\sqrt{X}\) row:
\[ S^2 = Z, \qquad T^2 = S, \qquad (\sqrt{X})^2 = X. \]\(S\), \(T\), and \(Z\) are three angles of one phase gate: \(S = P(\pi/2)\), \(T = P(\pi/4)\), and \(Z = P(\pi)\). The other name of \(T\) is the \(\pi/8\) gate. The relative phase on the 1 column is \(\pi/4\). The name \(\pi/8\) is half of that phase, the half-angle inside \(R_z(\pi/4)\). Those two matrices differ by a global phase: \(T = e^{i\pi/8} R_z(\pi/4)\).
\(X\), \(Y\), and \(Z\) turn the Bloch point by \(180^\circ\). The rotation matrices at \(\theta = \pi\) turn it the same way. The matrices differ by a global phase:
\[ R_x(\pi) = -i\, X, \qquad R_y(\pi) = -i\, Y, \qquad R_z(\pi) = -i\, Z. \]The factor \(-i\) multiplies the whole column. The measurement chances match. The Bloch points match.
The \(Y\) row equals this product of the \(X\) row and the \(Z\) row:
\[ Y = iXZ. \]Hadamard, then \(Z\), then Hadamard, equals Pauli \(X\). The rightmost \(H\) acts first:
\[ HZH = X. \]That product changes the \(Z\) basis into the \(X\) basis.
\(S\) passes the unitary test, so \(S\) is a gate. One eigenvalue of \(S\) is \(i\). A reading of an observable is a real number, so \(S\) fails the Hermitian test.
5. Observables and Pauli matrices#
A Hermitian matrix only rescales each of its eigenstates. The scale factor is the eigenvalue. For an observable, that eigenvalue is the reading on that eigenstate.
| Observable | Eigenstate | Reading |
|---|---|---|
| \(Z\) | \(\lvert 0\rangle\) | \(+1\) |
| \(Z\) | \(\lvert 1\rangle\) | \(-1\) |
| \(X\) | \(\lvert +\rangle\) | \(+1\) |
| \(X\) | \(\lvert -\rangle\) | \(-1\) |
| \(Y\) | \((\lvert 0\rangle + i\lvert 1\rangle)/\sqrt{2}\) | \(+1\) |
| \(Y\) | \((\lvert 0\rangle - i\lvert 1\rangle)/\sqrt{2}\) | \(-1\) |
A Hermitian matrix equals the sum of its readings times the projector onto each eigenstate. That sum is the spectral decomposition. For \(Z\):
\[ Z = (+1)\,|0\rangle\langle 0| + (-1)\,|1\rangle\langle 1|. \]The same pattern gives \(X = |+\rangle\langle +| - |-\rangle\langle -|\). The derivation of eigenvalues and this decomposition is in From Eigenvalues to Singular Value Decomposition.
\(I\) is the observable whose only reading is \(+1\), on every column.
6. Projectors#
These four projectors match the eigenstates in §5.
\[ |0\rangle\langle 0| = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, \qquad |1\rangle\langle 1| = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}. \]\[ |+\rangle\langle +| = \frac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}, \qquad |-\rangle\langle -| = \frac{1}{2}\begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}. \]The square of each matrix equals that same matrix. Each matrix equals its own dagger. They come in pairs that add to \(I\):
\[ |0\rangle\langle 0| + |1\rangle\langle 1| = I, \qquad |+\rangle\langle +| + |-\rangle\langle -| = I. \]One calculation. Start with \(|+\rangle\), the column \((1/\sqrt{2},\ 1/\sqrt{2})\). Multiply by \(|0\rangle\langle 0|\):
\[ \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} \begin{pmatrix} 1/\sqrt{2} \\ 1/\sqrt{2} \end{pmatrix} = \begin{pmatrix} 1/\sqrt{2} \\ 0 \end{pmatrix}. \]The product is a shorter column. Its squared length is \((1/\sqrt{2})^2 = 1/2\). That number is the chance of the reading that belongs to \(|0\rangle\). After that reading is recorded, divide the piece by its length. The state column is then \(|0\rangle\).
The same steps with \(|1\rangle\langle 1|\) give the chance \(1/2\) and the later column \(|1\rangle\).
A projective measurement uses a set of projectors that add to \(I\). A more general measurement uses a set of operators \(M_k\). They obey one sum: add \(M_k^{\dagger} M_k\) over every outcome \(k\), and the sum is \(I\). The chance of outcome \(k\) is the squared length of the column \(M_k|\psi\rangle\). When each \(M_k\) is a projector, this chance is the chance already computed above. The laboratory side of a reading is in Quantum Measurement, Randomness, and Everyday Technology.
7. Names that start with H#
This series uses the letter H for several different objects.
| Label | What it is |
|---|---|
| \(H\) | The Hadamard gate in §4. It sends the 0 column to \(\lvert +\rangle\). |
| \(\hat{H}\) | The Hamiltonian. It is the observable for energy. The hat keeps this operator separate from the gate. |
| Hermitian | The test \(A^{\dagger} = A\) in §2. An observable passes this test. |
| Hilbert space | The space of square-integrable functions. Each function assigns a complex number to each label, and the total of the squared lengths of those numbers is finite. |
| \(h\) | Planck’s constant. It is one fixed laboratory number. |
| \(\hbar\) | Planck’s constant divided by \(2\pi\). |
| \(A \odot B\) | The Hadamard product. It multiplies corresponding entries of two arrays with the same shape. |
A particle on a line has a label for each position \(x\). The function is \(\psi(x)\), used in §11. Square-integrable means \(\int |\psi(x)|^2\, dx\) is finite. One qubit has two labels, 0 and 1. The function assigns \(\alpha\) to 0 and \(\beta\) to 1. Written as a list, that function is the column \(\alpha|0\rangle + \beta|1\rangle\), and the total is \(|\alpha|^2 + |\beta|^2\). A state is one of these functions with the total equal to 1. The real numbers inside the one-qubit column are counted in How Many Numbers Does a Qubit Need?. The entrywise product is defined in Every Kind of Product. The gate \(H\) and the product \(A \odot B\) share the name Hadamard.
On one qubit a common Hamiltonian puts the lower energy on \(|0\rangle\):
\[ \hat{H} = -\frac{\hbar\omega}{2}\, Z. \]The number \(\omega\) is positive. The reading of \(\hat{H}\) on \(|0\rangle\) is \(-\hbar\omega/2\). The reading on \(|1\rangle\) is \(+\hbar\omega/2\). The gap between those two readings is \(\hbar\omega\).
A closed system changes by the unitary operator built from that Hamiltonian:
\[ U(t) = e^{-i\hat{H}t/\hbar}. \]For the Hamiltonian above, the exponential equals a \(Z\) rotation:
\[ U(t) = R_z(-\omega t). \]The state at time \(t\) is the column \(U(t)\) times the column at time \(0\). The equation that says the same thing for a changing column is the Schrödinger equation, \(i\hbar\, d|\psi\rangle/dt = \hat{H}|\psi\rangle\), in the vocabulary map.
8. Two-qubit operators#
Two qubits have four basis columns. This article writes them in this order:
\[ |00\rangle,\ |01\rangle,\ |10\rangle,\ |11\rangle. \]The first digit is qubit 1. The second digit is qubit 2. A two-qubit operator is a 4 by 4 matrix. The tensor product that builds this space is in Every Kind of Product.
A one-qubit gate on one of the two qubits is a 4 by 4 matrix. \(I \otimes X\) applies \(X\) to qubit 2 and leaves qubit 1:
\[ I \otimes X = \begin{pmatrix} 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}. \]It swaps \(|00\rangle\) with \(|01\rangle\), and swaps \(|10\rangle\) with \(|11\rangle\).
| Name | Action on the basis |
|---|---|
| CNOT | Flips qubit 2 when qubit 1 is 1. Sends \(\lvert 10\rangle\) to \(\lvert 11\rangle\) and \(\lvert 11\rangle\) to \(\lvert 10\rangle\). Leaves \(\lvert 00\rangle\) and \(\lvert 01\rangle\). |
| CZ | Multiplies \(\lvert 11\rangle\) by \(-1\). Leaves the other three basis columns. |
| SWAP | Exchanges the two digits. Swaps \(\lvert 01\rangle\) with \(\lvert 10\rangle\). |
| iSWAP | Swaps \(\lvert 01\rangle\) with \(\lvert 10\rangle\) and multiplies each of those two results by \(i\). |
Each of these four matrices is unitary. CNOT, CZ, and SWAP are Hermitian as well. Each of those three equals its own dagger, and the square of each one is \(I\). The dagger of iSWAP replaces each \(i\) by \(-i\), so iSWAP fails the Hermitian test.
A controlled-\(U\) gate is the same pattern as CNOT, with a general one-qubit unitary \(U\) in place of \(X\). Qubit 1 equal to 0 leaves qubit 2 unchanged. Qubit 1 equal to 1 applies \(U\) to qubit 2. CNOT is controlled-\(X\). CZ is controlled-\(Z\).
9. Toffoli and Fredkin#
Three qubits have eight basis columns, labeled from \(|000\rangle\) to \(|111\rangle\). The first digit is qubit 1, the second is qubit 2, and the third is qubit 3. The operator is an 8 by 8 matrix. The action on those eight labels is the matrix: each label goes to one label, and the other entries are 0.
Toffoli, also called CCNOT. Qubits 1 and 2 are the controls. Qubit 3 is the target. Both controls equal to 1 flips the target. Toffoli swaps \(|110\rangle\) and \(|111\rangle\). It leaves the other six labels in place.
Fredkin, also called CSWAP. Qubit 1 is the control. When qubit 1 is 1, Fredkin swaps qubit 2 and qubit 3. Fredkin swaps \(|101\rangle\) and \(|110\rangle\). It leaves the other six labels in place. In particular \(|111\rangle\) stays \(|111\rangle\), because swapping two 1s changes nothing.
Both matrices are unitary. Both are Hermitian. Each square equals \(I\), because doing the swap a second time returns every label.
10. Order#
Apply \(Z\) and \(H\) in both orders, each time to \(|0\rangle\).
Hadamard first, then \(Z\):
\[ H|0\rangle = |+\rangle, \qquad Z|+\rangle = |-\rangle. \]So \(ZH|0\rangle = |-\rangle\).
\(Z\) first, then Hadamard:
\[ Z|0\rangle = |0\rangle, \qquad H|0\rangle = |+\rangle. \]So \(HZ|0\rangle = |+\rangle\).
The two results are different columns, so \(ZH\) and \(HZ\) are different operators. Their matrices are
\[ ZH = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}, \qquad HZ = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}. \]The rightmost factor acted first in both products.
11. Other operators#
Position and momentum. A particle on a line has a state \(\psi(x)\) for each position \(x\). Each rule below acts on that function. The position operator multiplies the function by \(x\):
\[ \hat{x}\,\psi(x) = x\,\psi(x). \]The momentum operator takes a derivative:
\[ \hat{p}\,\psi(x) = -i\hbar\,\frac{d\psi}{dx}. \]Both are Hermitian. The vocabulary map separates each operator from the instrument that measures it.
Density operator. A density operator stores a state as a matrix. For a pure state \(|\psi\rangle\) of length 1, the density operator is the projector \(|\psi\rangle\langle\psi|\). For a mixed state it is a sum \(p_1|\psi_1\rangle\langle\psi_1| + p_2|\psi_2\rangle\langle\psi_2| + \cdots\). Each weight \(p_k\) is a real number, at least 0, and the weights add to 1. The matrix is Hermitian. Its trace is 1. Its eigenvalues are real and at least 0. When the columns \(|\psi_k\rangle\) are orthogonal, those eigenvalues are the weights \(p_k\). The one-qubit picture is in From Geometry to Quantum Mechanics. A density operator stores the state. A gate is a separate matrix, and that matrix changes a state.
Kraus operators. A noisy step uses a set of operators \(K_1, K_2, \ldots\). On a density operator \(\rho\) the step is
\[ \rho \mapsto K_1\rho K_1^{\dagger} + K_2\rho K_2^{\dagger} + \cdots. \]The set obeys \(K_1^{\dagger} K_1 + K_2^{\dagger} K_2 + \cdots = I\). A gate \(U\) on a closed system is the case of one Kraus operator, that gate itself: \(K_1 = U\).
Any matrix of the matching size is an operator. §3 gives the shape of every one-qubit unitary, every one-qubit observable, and every one-qubit projector. The tables name the matrices that have a fixed job in this series.
Related reading#
- From Geometry to Quantum Mechanics
- Before the Equations: A Mental Map of Quantum Mechanics Vocabulary
- How Many Numbers Does a Qubit Need?
- Seeing Three Dimensions: Colors, Planes, a Sphere and the Meaning of Rotation
- From Eigenvalues to Singular Value Decomposition
- Quantum Measurement, Randomness, and Everyday Technology
Hashtags#
#QuantumMechanics #QuantumComputing #QuantumOperators #PauliMatrices #HadamardGate #UnitaryOperator #HermitianOperator #ProjectionOperator #QuantumGates #LinearAlgebra #Qubit #Hamiltonian

Comments: