[Math] Relationship between eigenvectors and singular vectors of a Hermitian matrix

eigenvalues-eigenvectorslinear algebramatricessvd

What is the relationship between the eigenvectors and singular vectors of a Hermitian matrix?

Intuitively, I would expect them to be the same (modulo scaling).
However, this doesn't seem to be the case.

For example, if we compare

>> [U, S, V] = svd([1 2; 2 -1])
U =
  -0.447213595499958  -0.894427190999916
  -0.894427190999916   0.447213595499958
S =
   2.236067977499790                   0
                   0   2.236067977499789
V =
    -1     0
     0    -1

with

>> [P, D] = eig([1 2; 2 -1])
P =
   0.525731112119133  -0.850650808352040
  -0.850650808352040  -0.525731112119133
D =
  -2.236067977499790                   0
                   0   2.236067977499790
inv(P) =
   0.525731112119134  -0.850650808352040
  -0.850650808352040  -0.525731112119134

we see that the eigenvalues and singular values match (except for a -1 factor), but the vectors don't.

Why is this? Shouldn't they all match?

Best Answer

(Answering my own question since I figured it out by myself before posting...)

It's because the eigenvalues are repeated, and consequently any linearly independent eigenvectors that span the same corresponding eigenspace can form a basis for the eigendecomposition--and similarly with the singular value decomposition.

Change [U, S, V] = svd([1 2; 2 -1]) to [U, S, V] = svd([1 2; 2 -1.0000000000001]) to see this.