Complex Eigenvalues and Eigenvectors
A rotation of the plane turns every line through the origin, so it has no real eigenvectors. Its eigenvalues still exist, as complex numbers, and they carry the rotation angle and the scaling factor. Any real matrix with complex eigenvalues is a rotation combined with a scaling, seen in a tilted coordinate system, and that explains the spirals and oscillations such matrices produce.
Real matrices, complex roots
The characteristic polynomial of a real matrix has real coefficients, but its roots may be complex. For a matrix that happens when the discriminant is negative. Example: :
Complex eigenvalues of a real matrix come in conjugate pairs , and so do their eigenvectors: if , conjugating everything ( is real) gives . Finding the eigenvector works as before, with complex arithmetic. For , the second row of gives , so . (The complex numbers themselves are reviewed in The Complex Numbers.)
The rotation matrix
The rotation by angle is . Its trace is and its determinant :
So the eigenvalues of a rotation lie on the unit circle (, nothing is stretched), and their angle is the rotation angle. Multiplying a complex number by rotates it by in the complex plane (Geometric Interpretation of Complex Numbers), which is the same thing the matrix does to the plane.
import numpy as np
theta = np.radians(30)
R = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]])
values, vectors = np.linalg.eig(R)
for lam in values:
print(f"lambda = {lam.real:.4f} {lam.imag:+.4f}i |lambda| = {abs(lam):.4f}"
f" angle = {np.degrees(np.angle(lam)):.1f} deg")
v = np.array([1, -1j])
print("R (1, -i) == e^(i theta) (1, -i):", np.allclose(R @ v, np.exp(1j * theta) * v))lambda = 0.8660 +0.5000i |lambda| = 1.0000 angle = 30.0 deg
lambda = 0.8660 -0.5000i |lambda| = 1.0000 angle = -30.0 deg
R (1, -i) == e^(i theta) (1, -i): True
Every such matrix is a rotation-scaling in disguise
A rotation-scaling matrix has the form
It rotates by and scales by . The general fact: if a real matrix has eigenvalue () with eigenvector , put the real and imaginary parts of in the columns of :
For : has eigenvector , so , and : a rotation by and a scaling by , in the skewed coordinates given by .
from sympy import Matrix, I, re, im, atan2, deg, sqrt
A = Matrix([[1, -2], [1, 3]])
lam, v = 2 - I, Matrix([-1 - I, 1])
print("A v == lambda v:", (A * v - lam * v).expand() == Matrix([0, 0]))
P = Matrix.hstack(v.applyfunc(re), v.applyfunc(im))
print("P =", P.tolist())
print("P^-1 A P =", (P.inv() * A * P).tolist())
print("r =", sqrt(5), " theta =", deg(atan2(1, 2)).evalf(5), "degrees")A v == lambda v: True
P = [[-1, -1], [1, 0]]
P^-1 A P = [[2, -1], [1, 2]]
r = sqrt(5) theta = 26.565 degrees
Spirals
Because , the iterates turn by every step and scale by . In the plane they trace a spiral (an ellipse-shaped one, since skews it):
| Size | Iterates | Continuous system with |
|---|---|---|
| spiral into the origin | : damped oscillation | |
| stay on a closed ellipse | : undamped oscillation | |
| spiral outward | : growing oscillation |
For differential equations the real part decides decay or growth and the imaginary part is the angular frequency: contains and (Systems of Linear Differential Equations).
import numpy as np
import matplotlib.pyplot as plt
A = np.array([[1.0, -2.0], [1.0, 3.0]]) / 2.4 # |lambda| = sqrt(5)/2.4 ~ 0.93
x = np.array([1.0, 0.0])
points = [x]
for _ in range(40):
x = A @ x
points.append(x)
pts = np.array(points)
plt.figure(figsize=(5, 5))
plt.plot(pts[:, 0], pts[:, 1], "o-", ms=3)
plt.gca().set_aspect("equal"); plt.grid(alpha=0.3); plt.title("Iterates of A spiral inward")
print("|lambda| =", round(float(abs(np.linalg.eigvals(A)[0])), 4))
print("|x_40| =", round(float(np.linalg.norm(pts[-1])), 4))|lambda| = 0.9317
|x_40| = 0.076
In software
- 2D rotation as complex multiplication: games and graphics code sometimes store a 2D rotation as one unit complex number instead of a matrix; composing rotations is complex multiplication. Quaternions extend this idea to 3D (Rotations: Matrices vs Quaternions).
- Oscillation and stability: a recurrent neural network, a digital filter or a physics step matrix with complex eigenvalues oscillates; means the oscillation explodes.
- Fourier transform: the eigenvectors of every circulant matrix (cyclic convolution) are complex exponentials, which is why the FFT diagonalizes convolution (FFT).
Exercises
Exercise 1: Purely imaginary eigenvalues
Find the eigenvalues of .
Answer
.
Solution
and the angle is ; it is not a pure rotation-scaling matrix, but it is similar to .
Exercise 2: Read off and
For , give the eigenvalues, the scaling factor and the rotation angle.
Answer
, , .
Solution
has the form with , , so . , and .
Exercise 3: An eigenvector of a rotation
Check by hand that is an eigenvector of , with eigenvalue .
Answer
.
Solution
Exercise 4: Factor and use it
. Find its eigenvalues, write with a rotation-scaling matrix, and use it to find .
Answer
; , ; .
Solution
from sympy import Matrix
A = Matrix([[3, -5], [1, -1]])
P = Matrix([[2, -1], [1, 0]])
print("P^-1 A P =", (P.inv() * A * P).tolist())
print("A^8 =", (A**8).tolist())P^-1 A P = [[1, -1], [1, 1]]
A^8 = [[16, 0], [0, 16]]
Test yourself
What are the eigenvalues of the rotation matrix ?
- and
- and
- 1 and
- and
A real matrix has eigenvalues 2 and . What is the third?
- 2
Iterates of a real matrix with eigenvalues do what?
- Spiral outward
- Move along a straight line
- Spiral into the origin
- Stay on a circle