Project DelphiTensors Workshop

Power iteration

Multiply any starting vector by A repeatedly, rescaling each time. It converges to the eigenvector with the largest eigenvalue.

A = np.array([[4., 1.], [2., 3.]]) x = np.random.randn(2); x /= np.linalg.norm(x) for _ in range(50): x = A @ x x /= np.linalg.norm(x) print(x @ A @ x) # 5.000000 print(np.linalg.eig(A)[0].max()) # 5.000000 — identical

This is how PageRank ranks web pages. It is also why eigenvectors matter far beyond Chapter 2: repeated application of a matrix converges to its dominant eigenvector.