Diagonalization is the fundamental matrix decomposition. From this topic, you will begin to know improved versions of it that will bring you closer to the definitive understanding of all the properties of any matrix.
Today you will start with the spectral decomposition. The good news is that it's easy to compute from diagonalization. With it, you'll understand all the geometry of symmetric matrices, and you'll put the properties of unitary matrices to work.
An improved decomposition
As you know, a square matrix of dimension is diagonalizable if there exists a diagonal matrix and an invertible one , both of size , such that . Since the diagonal entries of are the eigenvalues of , while the columns of are the eigenvectors of , this result is known as an eigendecomposition of .
Building this decomposition isn't easy. Although calculating all the eigenvalues and eigenvectors of can be relatively straightforward, next comes a perhaps more complicated task: inverting the matrix . Since its columns form a basis, the inverse always exists, but calculating it can involve a lot of work. Fortunately, there's a class of matrices whose inverses are trivial to calculate: unitary matrices, since their inverses are just their transposes. So, it is natural to ask when the invertible matrix can be changed to a unitary one.
So, as you remember, to build you just need to compute a basis for each eigenspace and then combine them all to form a basis for the whole space. But wait just a minute. The columns of an orthogonal matrix form an orthonormal basis. Would improving the basis of each eigenspace by an orthonormal one be enough? After that, you'd only need to put them all together so that you get the orthonormal basis for the entire space. Finally, by putting their elements as columns of a matrix, this would end up unitary.
There is a small problem with this procedure. It's true that every eigenspace has an orthonormal basis. It is also true that by putting together all the orthonormal bases of the eigenspaces, you would end up with a basis for the whole space. It is clear that all basic vectors have lengths equal to . Also, if they belong to the same eigenspace, then they are orthogonal. But nothing guarantees that if they come from different eigenspaces, they're orthogonal to each other! That is, the final base may not be orthogonal. You were very close to success.
But there's still hope. Although symmetric matrices may seem simple at first, it is surprising that they're precisely the only ones for which this improved decomposition works. That is, the eigenvectors of different eigenspaces are orthogonal to each other. With this, you're finally ready for the promised result, the spectral decomposition:
For any symmetric matrix there exists a unitary matrix and a diagonal one , both of size , such that:
Although symmetric matrices may seem unhelpful at first, they arise naturally in many applications. For example, probability studies the interactions between different random phenomena through the covariance matrix that turns out to be symmetric. In graph theory, which studies relationships between similar objects (for example, you might have a set of cities that you want to connect by building roads), the adjacency matrix is used to order these relationships, which also ends up being symmetric.
The geometry of symmetric matrices
Thanks to spectral decomposition, you can decompose the geometric behavior of any symmetric matrix in simple steps. First, notice that the linear operator of is given by the following composition of more understandable ones:So, the behavior of is described by three stages:
- As is unitary, the action of is just a rotation of the space,
- since is diagonal, it implies that only stretches the space,
- finally is a rotation in the inverse direction that one of .
Note that the first rotation is countered in the third stage, so essentially is very much like a stretch of the whole space.
But, how to actually obtain such a decomposition? Let's get to it!
Computing the decomposition
The procedure to calculate the spectral decomposition is almost identical to the one you already know to find the diagonalization. You just need one extra step that is quite predictable.
-
Find all the eigenvalues of .
-
Compute the eigenspace of every eigenvalue.
-
Form an orthonormal basis for every eigenspace.
-
Build : its columns are the elements of all the orthonormal bases.
-
Build : the entries on its diagonal are the eigenvalues corresponding to the eigenvectors in the same order that in . If an eigenvalue has more than one eigenvector, then it is repeated as many times as many eigenvectors it has in .
Here is a pair of clarifications that will make it easier to calculate the decomposition:
- By the spectral theorem, every symmetric matrix is automatically diagonalizable, so you don't need to worry about the geometric dimension of the eigenvalues.
- An eigenspace is a subspace, so you can compute a basis for it. From that basis, you can build an orthonormal basis—for example, use the Gram-Schmidt procedure.
Let's compute a couple of decompositions.
A quick example
Consider the following matrix:
The first step is computing all its eigenvalues. Calculating its characteristic polynomial , you can notice that the eigenvalues are and . After that, you must find the eigenspaces and form an orthonormal basis for each one:
- : its eigenspace is . Hence a basis is simply but the extra step requires an orthonormal basis, so you can use .
- : its eigenspace is and an orthonormal basis is .
The final steps are building and using the bases:
Thus the spectral decomposition is .
Being careful
Now take a bigger matrix:
It's easy to compute its characteristic polynomial, , so the eigenvalues are and .
- : the eigenspace is . In consequence, an orthonormal basis is .
- : now the eigenspace is . This case is more delicate because the basis isn't orthogonal. But you can use the Gram-Schmidt procedure to build an orthonormal basis, for example, .
Great, then the pieces of the decomposition are:
Conclusion
-
The spectral decomposition is an improved diagonalization that characterizes symmetric matrices.
-
A matrix is symmetric if and only if there exists a unitary matrix and a diagonal one , both of size , such that .
-
The geometric behavior of a symmetric matrix is the composition of a rotation, a stretching, and a rotation in the opposite direction.
-
In order to compute the spectral decomposition, you just have to diagonalize the matrix but with the slight modification that the eigenvectors must be orthogonal and of length .