Visualizing Hermitian Matrix as An Ellipse with Dr. Geo


Hermitian matrices have applications in many branches of mathematics and physics. The author of this article does not major in either subject, but has taught linear algebra in a CS department and is fascinated by the philosophical interpretations of quantum mechanics. He has therefore spent some time self-studying the related mathematics. In fact many objects and theorems in linear algebra, including Hermitian matrices, have easily visualized geometric representations. Unfortunately such intuitive but unorthodox views are hardly ever mentioned in mathematics textbooks. In this article we will show you how to visualize the multiplcation of a vector by a Hermitian matrix.

Dry and Boring: Definition and Thereoms

A matrix H is Hermitian if it is equal to its own conjugate transpose. [wikipedia] [mathworld] It is a special case of Normal matrices. A normal matrix is unitarily diagonalizable, and in particular for a Hermitian matrix, the diagonalization yields a real diagonal matrix. That is, H can be decomposed as UDU* where UU*=I and D is a real diagonal matrix. [mathworld] In fact, the column vectors of U are precisely the eigenvectors of H, and the diagonal entries of D are the corresponding eigenvalues.

In this article, we are not interested in the algebraic computations of the diagonalization process. Rather, we would like to visualize the effect of multiplying a vector by a Hermitian matrix.

A Numerical Example

First of all, we will not bother with complex numbers. Secondly, it is easiest to work in lower dimensions. So we end up investigating a tiny 2x2 real symmetric matrix H, but the generalization into higher dimensions and into the complex numbers is easily helped by imagination once this simple example is visually comprehended. Even visualizing a tiny 2x2 real symmetric matrix is probably too much to ask for. What we can really see is the effect of multiplying a vector P by H.

So let's make up a simple numerical example with the help of octave, a very nice matrix computation program freely available for many platforms.

    H = [1.649,0.303;0.303,0.818]       # an arbitrary real symmetric matrix
    [U,D] = eig(H)                      # find eigenvectors  to diagonalize it
    H-U*D*U'                            # verification
    U*U'                                # verification
    p = [0.75,1.67]                     # some random vector
    q = H*p                             # mulitply p by H

So we have diagonalized H as H = UDUT where U=[0.30986,-0.95078; -0.95078,-0.30986] and D=0.71925,0; 0,1.74775]. Note that the column vectors of U are unit vectors and form an orthogonal basis. Its effect on a vector can be interpreted as a change of coordinate system (alias interpretation), where the change is merely a rotation of the coordiante axes. We have also created a random vector p and multiplied p by H.

The Picture and the Interpretation

展示 Hermitian Matrix 效果的 Dr. Geo 圖片

So what does it mean for a vector p to be multiplied by H? It is equivalent to transforming p by the following 3 steps:

  1. Change the coordiante system of p (multiplication by UT). Nothing really gets moved.
  2. Stretch each of the two components of p along the new axes by a constant (multiplication by D)
  3. Change the coordiante system of p back to the original one (multiplication by U). Again nothing really gets moved.

If you have Dr. Geo installed in your Linux system, you can play with hermitian.fgeo. First drag point P around and see how Q = HP moves accordingly. Notice that the ratio between the horizontal sides of the two rectangles remains constant, as determined by D. So does the ratio bewteen the vertical sides. The red circle is the unit circle. The green ellipse is the image of the unit circle under the linear transformation defined by x |--> Hx. Try to trace P along the red circle and watch Q traces the green ellipse.

In this figure, H is not explicitly computed. Instead, U and D are displayed in the left, with U above D. The signs may not match exactly as what you get from the result of eig(H) in octave. But it's always a valid decomposition as you can verify by computing U*D*U'*P-Q in octave. So please drag "a" and "b" around, watch how Q moves accordingly, and verify by substituting the new U and D in the above formula in octave.

Multiplication by an Hermitian matrix is just stretching the orthogonal components of a vector by constant factors in some rotation of the original coordinate system. We can thus conclude with a simple, though not very precise, statement: one can visualize a Hermitian matrix as an ellipsoid centered at the origin. If the one-to-one correspondence between the coordinate axes and the axes of the ellipsoid is also provided, then this representation is unique.