Linear Algebra / Unit 8, Complex Vector Spaces / Topic 8.6
Unit 8. Complex Vector Spaces
Topic 3.2 showed that the products AB and BA of two matrices are usually different. The difference AB − BA is called the commutator of A and B. This topic shows what the commutator decides: two Hermitian matrices have an orthonormal basis of shared eigenvectors exactly when their commutator is zero. In quantum mechanics, this is the difference between quantities that can be known together and quantities that cannot.
You need Topics 3.2, 3.5, 8.3, and 8.5 for this topic.
The commutator of two square matrices of the same size is written with square brackets.
[A, B] = AB − BAWhen [A, B] = 0, the two products are equal, and the matrices are said to commute. Topic 5.5 used this word for the rule about eA + B.
The commutator is not zero, so these two matrices do not commute.
When two matrices do not commute, the rules of algebra for numbers must be applied carefully. For example,
(A + B)² = A² + AB + BA + B²The middle terms combine to 2AB only when A and B commute.
The Pauli matrices of Topic 8.3 do not commute with each other.
σxσy = 0110 0−ii0 = i00−imultiplyσxσy = iσzσyσx = 0−ii0 0110 = −i00imultiply in the other orderσyσx = −iσzSubtracting gives the commutator. The other two pairs follow the same pattern, with x, y, and z moved around in a cycle.
[σx, σy] = 2iσz [σy, σz] = 2iσx [σz, σx] = 2iσyThese three equations describe the spin of an electron. Topic 9.4 develops them.
Let A and B be Hermitian. The conjugate transpose of a product reverses the order.
[A, B]† = (AB − BA)†the definition of the commutator[A, B]† = B†A† − A†B†the conjugate transpose reverses each product[A, B]† = BA − ABA and B are Hermitian[A, B]† = −[A, B]The commutator of two Hermitian matrices is skew-Hermitian. It can always be written as i times a Hermitian matrix. For the Pauli matrices, [σx, σy] is i times the Hermitian matrix 2σz.
The same calculation gives the rule of Topic 8.3: (AB)† = BA, so the product AB is Hermitian exactly when A and B commute.
Theorem. Two Hermitian matrices A and B commute exactly when there is an orthonormal basis in which each vector is an eigenvector of A and also an eigenvector of B.
Put the shared eigenvectors in the columns of a unitary matrix U. Then A = UΛU† and B = UMU†, where Λ and M are diagonal matrices of eigenvalues. Diagonal matrices commute.
AB = UΛMU†the factors U†U in the middle give IAB = UMΛU†diagonal matrices commuteAB = BALet Av = λv, and let AB = BA. Apply A to the vector Bv.
A(Bv) = B(Av)because AB = BAA(Bv) = λ(Bv)because Av = λvThe vector Bv is again in the eigenspace of A for the eigenvalue λ. The matrix B sends each eigenspace of A into itself.
The vector (1, 1) is an eigenvector of A with the eigenvalue 3 and of B with the eigenvalue 1. The vector (1, −1) is an eigenvector of A with the eigenvalue 1 and of B with the eigenvalue −1.
These matrices commute. The vector (1, 0, 0) is an eigenvector of A, but it is not an eigenvector of B, because B sends it to (0, 1, 0). The eigenvalue 1 of A is repeated, and its eigenspace is the xy-plane. Inside that plane, the eigenvectors of B are (1, 1, 0) and (1, −1, 0). The shared basis is (1, 1, 0)/√2, (1, −1, 0)/√2, and (0, 0, 1).
Commuting matrices do not share all of their eigenvectors. They share one suitable basis.
Try it: two symmetric matrices and their eigenvector lines
The matrix A has the eigenvalues 3 and 1, and the matrix B has the eigenvalues 2 and −1. The sliders turn the eigenvector lines of A, in blue, and of B, in dashed red. The thick line of each color belongs to the larger eigenvalue. The readout gives the two matrices and their commutator.
The Pauli matrices σz and σx do not commute. The eigenvectors of σz are (1, 0) and (0, 1), and the eigenvectors of σx are (1, 1) and (1, −1). No vector is on both lists.
In quantum mechanics, a state has a definite value of a quantity when it is an eigenvector of the matrix of that quantity. A state with a definite value of σz is therefore not a state with a definite value of σx. The two quantities cannot both be known exactly.
The uncertainty relation makes this statement exact. For a state x, the spread of the results of A times the spread of the results of B is at least one half of the absolute value of ⟨x, [A, B]x⟩. Topic 9.10 proves it. For position and momentum the commutator is iħ times the identity, which gives the uncertainty relation of Heisenberg.
A commutator equal to iħ times the identity is not possible for matrices of finite size. The trace of a commutator is zero, and the trace of iħ times the n by n identity matrix is iħn. Position and momentum need a space of infinite dimension, which Unit 9 introduces.
When two Hermitian matrices commute, each vector of the shared basis has a pair of eigenvalues, one for A and one for B. In the example with a repeated eigenvalue, the eigenvalue 1 of A does not single out one basis vector. The pairs (1, 1), (1, −1), and (2, 5) do.
Quantum mechanics uses this to name the states of a system. The states of the hydrogen atom are named by the eigenvalues of several matrices that commute with each other: the energy, the size of the angular momentum, and one component of the angular momentum. These eigenvalues are the quantum numbers of chemistry.
| Fact | Statement |
|---|---|
| Commutator | [A, B] = AB − BA |
| Commuting matrices | [A, B] = 0 |
| Trace | The trace of a commutator is zero |
| Pauli matrices | [σx, σy] = 2iσz, and the same with x, y, z moved in a cycle |
| Hermitian matrices | [A, B] is skew-Hermitian, and AB is Hermitian exactly when [A, B] = 0 |
| Shared eigenvectors | Two Hermitian matrices have an orthonormal basis of shared eigenvectors exactly when they commute |
Work each problem on paper first. Then open the answer to check your work.
AB = 1000 and BA = 0001.
[A, B] = 100−1, which is σz.
σyσz = 0ii0 = iσxσzσy = 0−i−i0 = −iσx[σy, σz] = iσx − (−iσx) = 2iσx
The trace of AB − BA is the trace of AB minus the trace of BA, which is zero.
The trace of the identity matrix is n, which is not zero.
AB = 5775 and BA = 5775, so they commute.
(1, 1) is an eigenvector of A with the eigenvalue 3 and of B with the eigenvalue 4. (1, −1) is an eigenvector of A with the eigenvalue −1 and of B with the eigenvalue 2.
AB² = (AB)BAB² = (BA)Bbecause AB = BAAB² = B(AB)AB² = B(BA)because AB = BAAB² = B²A
From Part 3, [A, B]† = −[A, B]. The conjugate of i is −i.
(i[A, B])† = (−i)(−[A, B])(i[A, B])† = i[A, B]
The commutator is typed directly from its definition, with the @ sign for the two products.
Python
The two products are different, and the commutator has the rows 6, 0 and 0, −6, as in Part 1. Now calculate the commutator of Practice Problem 1, and store it under the name C.
Python
The code below types the three Pauli matrices and calculates the commutator of the first two.
Python
The result has the diagonal entries 2i and −2i, which is 2iσz, as in Part 2. Now change the code so that C is the commutator of σy and σz.
Python
The matrices A and B below commute. The code finds the orthonormal eigenvectors of A with np.linalg.eigh and puts them in the columns of V. The product VTBV writes B in the basis of those eigenvectors. If the eigenvectors of A are also eigenvectors of B, this product is a diagonal matrix.
Python
The commutator is the zero matrix, and the last result is diagonal with the entries −1 and 1. Each eigenvector of A is an eigenvector of B, and the diagonal entries are the eigenvalues of B.
Now change B to the matrix of Practice Problem 4, with the rows 3, 1 and 1, 3.
Python
The same test fails for two matrices that do not commute. The code below uses the Pauli matrices σz and σx.
Python
The commutator is not zero. In the basis of the eigenvectors of σz, the matrix σx is not diagonal, so those eigenvectors are not eigenvectors of σx.
The instruction np.trace of Topic 3.5 adds the diagonal entries. The code below calculates the trace of a commutator of two 3 by 3 matrices.
Python
The commutator is not zero, but its trace is 0. Change any entries of A or B and run the code again. The trace stays 0.
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. Let A = 1101 and B = 1011. Find the two diagonal entries of the commutator [A, B] = AB − BA.
AB = 2111 and BA = 1112. Subtracting gives the matrix with the rows 1, 0 and 0, −1.
2. Which matrix is equal to the commutator [σx, σy] of two Pauli matrices?
σxσy = iσzσyσx = −iσz[σx, σy] = iσz − (−iσz) = 2iσz
3. A and B are Hermitian matrices. When do they have an orthonormal basis of shared eigenvectors?
In a shared basis both matrices are diagonal, and diagonal matrices commute. In the other direction, if AB = BA, then B sends each eigenspace of A into itself, and a shared basis can be built inside each eigenspace.
4. A and B are 3 by 3 matrices. Find the trace of AB − BA.
From Topic 3.5, the products AB and BA have the same trace. So the trace of the difference is 0, for any two square matrices of the same size.
5. Which pair of matrices commutes?
For the third pair, both products are the matrix with the rows 2, 1 and 1, 2. The two matrices share the eigenvectors (1, 1) and (1, −1). The Pauli matrices do not commute with each other.