Scientia sine finibus

Linear Algebra / Unit 8, Complex Vector Spaces / Topic 8.6

Units and Topics

Unit 8. Complex Vector Spaces

8.6 Commutators and Shared Eigenvectors

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.

1. The Commutator

The commutator of two square matrices of the same size is written with square brackets.

[A, B] = AB − BA

When [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.

An example

A = 1201 B = 1031 AB = 7231 BA = 1237 [A, B] = 600−6

The commutator is not zero, so these two matrices do not commute.

Rules

  • [B, A] = −[A, B], and [A, A] = 0.
  • [A, B + C] = [A, B] + [A, C], and [A, cB] = c[A, B] for a number c.
  • [A, BC] = [A, B]C + B[A, C]. This rule has the form of the product rule for derivatives.
  • Each matrix commutes with the identity matrix, with its own powers, and with any function of itself.
  • Two diagonal matrices commute.
  • The trace of a commutator is zero, because Topic 3.5 showed that AB and BA have the same trace.

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.

2. The Pauli Matrices

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σz

Subtracting 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σy

These three equations describe the spin of an electron. Topic 9.4 develops them.

3. The Commutator of Two Hermitian Matrices

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.

4. Shared Eigenvectors

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.

From a shared basis to a zero commutator

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 = BA

From a zero commutator to a shared basis

Let Av = λv, and let AB = BA. Apply A to the vector Bv.

A(Bv) = B(Av)because AB = BAA(Bv) = λ(Bv)because Av = λv

The vector Bv is again in the eigenspace of A for the eigenvalue λ. The matrix B sends each eigenspace of A into itself.

  • If the eigenvalue λ is not repeated, its eigenspace is a line. Then Bv is a multiple of v, so v is an eigenvector of B as well.
  • If the eigenvalue λ is repeated, its eigenspace has more than one dimension. Inside that eigenspace, B is a Hermitian map, so the spectral theorem gives an orthonormal basis of eigenvectors of B there. Each of them is still an eigenvector of A with the eigenvalue λ.

An example with different eigenvalues

A = 2112 B = 0110 AB = BA = 1221

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.

An example with a repeated eigenvalue

A = 100010002 B = 010100005

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.

5. Matrices That Do Not Commute

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.

6. Labeling States

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.

Common Mistakes

  • Assuming that AB = BA, and simplifying an expression as if the matrices were numbers.
  • Writing (A + B)² = A² + 2AB + B² for matrices that do not commute.
  • Losing the sign: [B, A] is −[A, B].
  • Calling the commutator of two Hermitian matrices Hermitian. It is skew-Hermitian.
  • Concluding that commuting matrices share all of their eigenvectors. With a repeated eigenvalue, some eigenvectors of one matrix are not eigenvectors of the other.
  • Concluding that two matrices commute because they share one eigenvector. They must share a whole basis.

Summary

FactStatement
Commutator[A, B] = AB − BA
Commuting matrices[A, B] = 0
TraceThe 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 eigenvectorsTwo Hermitian matrices have an orthonormal basis of shared eigenvectors exactly when they commute

Practice

Work each problem on paper first. Then open the answer to check your work.

1. Calculate [A, B] for A = 0100 and B = 0010.

AB = 1000 and BA = 0001.

[A, B] = 100−1, which is σz.

2. Calculate [σy, σz].

σyσz = 0ii0 = iσxσzσy = 0−i−i0 = −iσx[σy, σz] = iσx − (−iσx) = 2iσx

3. Explain why no two n by n matrices have the commutator [A, B] = I.

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.

4. Do A = 1221 and B = 3113 commute? If they do, find the shared eigenvectors.

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.

5. A and B commute. Show that A commutes with B².

AB² = (AB)BAB² = (BA)Bbecause AB = BAAB² = B(AB)AB² = B(BA)because AB = BAAB² = B²A

6. A and B are Hermitian. Show that i[A, B] is Hermitian.

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]

Python Practice

Step 1. Calculate a commutator

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

Step 2. The Pauli matrices

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

Step 3. Commuting matrices share eigenvectors

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

Step 4. Matrices that do not commute

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.

Step 5. The trace of a commutator

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.

Quiz

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.

2. Which matrix is equal to the commutator [σx, σy] of two Pauli matrices?

3. A and B are Hermitian matrices. When do they have an orthonormal basis of shared eigenvectors?

4. A and B are 3 by 3 matrices. Find the trace of AB − BA.

5. Which pair of matrices commutes?

Next: Topic 9.1, Dirac Notation