Notebook 15 – Math 2121, Fall 2020

In this notebook we will explore the eigenvalues of a random orthogonal matrix.

An orthogonal matrix is a square matrix Q with the following equivalent properties:

  • The columns of Q are orthonormal.

  • It holds that QQT=QTQ=In when Q is n×n.

  • The matrix Q is invertible with Q1=QT.

Suppose Q is an n×n orthogonal matrix and Qij is the entry in position (i,j) of Q.

Then the property QTQ=In implies that i=1n(Qij)2=1 for each j=1,2,,n.

Therefore all entries of Q must be real numbers in the interval [1,1].

In other words, the set of all n×n orthogonal matrices, within the set of n×n matrices, is a region of finite volume. In fact, this volume is at most 2n2.

If you have a region of space of finite volume, you can try to sample points from that region uniformly at random. That is, you can randomly select points from the region in such a way that no point is more likely to be selected than any other.

In particular, it makes sense to talk about a uniformly random element of the set of n×n orthogonal matrices. But how, practically, can we generate this sort of random matrix?

42.1 μs
497 μs
11.6 s
2.5 s

Julia makes it easy to generate matrices whose individual entries are chosen uniformly at random from some interval. The following generates a 4-by-4 matrix each of whose entries is drawn uniformly at random from the interval [0,1]:

7.2 μs
M
4×4 Array{Float64,2}:
 0.67146   0.328488    0.212337  0.86587
 0.373607  0.410998    0.515854  0.246521
 0.609279  0.285134    0.256232  0.246153
 0.756213  0.00691312  0.198154  0.289334
52.1 ms

With high probability this random matrix is invertible. However, it is not typically orthogonal.

4.2 μs
0.03614020519777915
218 ms
2.3857618450813916
906 ms

We introduced the Gram Schmidt process in class.

This algorithm gives us a way to generate random orthogonal matrices:

  • Generate a random n×n matrix A, with entries sampled independently from what's called the standard normal distribution.

  • Perform the Gram Schmidt process on the columns of A.

  • Normalize the resulting orthogonal vectors to have unit length

  • Use these orthonormal vectors as the columns of a matrix Q.

The matrix Q generated in this way will be orthogonal, and uniformly distributed over all n×n orthogonal matrices.

7.7 μs
gram_schmidt_process (generic function with 1 method)
46.2 μs

The definition of the standard normal distribution is something you'll see in a class on probability.

Very briefly, this is a probability distribution that governs many natural processes (like scores on exams). If you sample many random numbers from the standard normal distribution, the histogram you'll get looks like the following plot:

6.1 μs
7.4 s
plot_complex_numbers (generic function with 1 method)
50.3 μs
n
300
1.5 μs
1.2 ms
490 ms
1.4312821076116828e-12
110 ms

Here is our random 300 by 300 orthogonal matrix:

12.5 μs
300×300 Array{Float64,2}:
  0.0448874    0.0491666   -0.0739788   …  -0.0317672    0.0736054    -0.124933
 -0.056724     0.0556908    0.0604959      -0.0555389    0.015055      0.0244777
  0.0920992    0.00327534   0.00674899      0.0757148    0.0509849    -0.000920985
  0.0528592    0.03524      0.0471785      -0.0568397   -0.0440849    -0.0474272
  0.00119506  -0.0354313   -0.0123086       0.0178764    0.0179261     0.0520182
 -0.0203609    0.100654     0.0199392   …  -0.05953      0.038262      0.0528598
  0.0400311   -0.0235413    0.0126642      -0.0156188    0.0786087    -0.0436996
  ⋮                                     ⋱                             
 -0.0475376    0.0326474    0.00481165      0.00945692   0.0121606     0.0357641
 -0.0816301    0.0506513   -0.153399    …   0.0776899   -0.000731917  -0.113912
 -0.0700405    0.0554915    0.0238207      -0.0776223   -0.179625      0.0360585
 -0.0575912    0.0625821   -0.0142933      -0.0100343    0.00717623   -0.0340247
 -0.0545604    0.0385057   -0.0205914       0.0849721    0.0526457     0.0195796
  0.00672487   0.0163181   -0.0407016       0.0407104   -0.0492313     0.0823654
822 ns
1.2246005129615576e-12
10.2 ms

Recall that if z=a+biC then |z|=a2+b2.

All eigenvalues λ for Q are complex numbers with |λ|=1.

This is because if Qv=λv for 0vCn then Qv¯=λ¯v¯ and Q1v¯=(1/λ¯)v¯.

Thus, in this case we have

v¯TQv=v¯T(Qv)=v¯T(λv)=λv¯Tv=λv2

while at the same time

v¯TQv=(QTv¯)Tv=(Q1v¯)Tv=((1/λ¯)v¯)Tv=(1/λ¯)v2.

Since v2 is a nonzero real number, it follows that λ=1/λ¯ so |λ|2=λλ¯=1 and |λ|=1.

Below is a plot of the eigenvalues of our random orthogonal matrix:

16.9 μs
1.1 s

The eigenvalues are somehow randomly distributed on the unit circle

{zC:|z|=1}.

What random process generates these values?

Another way to generate random points on the unit circle is to independently pick the points uniformly at random each time. If we do this, the resulting set of points appears like this:

4.9 μs
37.2 ms

We can examine several versions of these plots.

There seems to be something qualitatively different between the two different distributions of points of the unit circle.

If we use the eigenvalues of a random orthogonal matrix, the points seem to be more evenly spaced.

If we use 300 points chosen independently at random, gaps and clusters tend to occur.

Can make this distinction more quantitative?

11.9 μs
angle (generic function with 1 method)
51.2 μs
sorted_angles (generic function with 1 method)
26.2 μs

The following plots show that if we arrange the eigenvalues of a random orthogonal matrix in order going counterclockwise, we obtain 300 almost perfectly evenly spaced points on the unit circle.

We do not see such even spacing for 300 independently chosen random points, arranged in order.

16.5 μs
2.5 ms
sorted_fluctuations (generic function with 1 method)
45.5 μs
3.5 ms

What this means practically is that if n is large enough and you select an n×n orthogonal matrix uniformly at random, and then you choose one of its n eigenvalues λ at random, the resulting complex number λ will be uniformly distributed in the unit circle {zC:|z|=1}.

9.3 μs