Diagonalization and the Jordan form

> with(linalg):

The command "jordan" produces the Jordan form of a matrix. If the matrix can be diagonalized

it Jordan form is its diagonalization. If the matrix cannot be diagonalized its Jordan form tells us the eigenvalues and is a complete similarity invariant.

Example 1:

> A:=matrix([[1,3,2],[0,2,2],[0,0,3]]);

A := matrix([[1, 3, 2], [0, 2, 2], [0, 0, 3]])

> J:=jordan(A,'P');

J := matrix([[1, 0, 0], [0, 2, 0], [0, 0, 3]])

> evalm(P);

matrix([[4, -8, 4], [0, -8/3, 2], [0, 0, 1]])

The jordan command produces the Jordan form directly, and stores the transition matrix in P.

The column vectors of P are eigenvectors of A. We check that P^(-1)*A*P=J.

> evalm(inverse(P) &* A &* P);

matrix([[1, 0, 0], [0, 2, 0], [0, 0, 3]])

Compare to the eigenvector command.

> eigenvectors(A);

[1, 1, {vector([1, 0, 0])}], [2, 1, {vector([3, 1, ...

Check that each of these are multiples of columns of P.

Example 2: (Nondiagonalizable)

> B:=matrix([[2,3,0],[0,2,0],[1,0,-5]]);

B := matrix([[2, 3, 0], [0, 2, 0], [1, 0, -5]])

> jordan(B,'P2');

matrix([[-5, 0, 0], [0, 2, 1], [0, 0, 2]])

The eigenvalues are 2,2,-5. But we do not get a diagonal matrix. In this case the repeated eigenvalue 2 does not have two lineary independent eigenvectors. (The transition matrix is more complex is the case).

> eigenvectors(B);

[2, 2, {vector([7, 0, 1])}], [-5, 1, {vector([0, 0,...

The geometric multiplicity of 2 is 1, while its algebraic multiplicity is 2. When this happens the matrix while not be diagonalizable.

Example 3:

> C:=matrix([[-5,0,4],[0,2,5],[0,0,2]]);

C := matrix([[-5, 0, 4], [0, 2, 5], [0, 0, 2]])

> jordan(C);

matrix([[-5, 0, 0], [0, 2, 1], [0, 0, 2]])

Thus C is similar to B. One has to be a little careful. If the Jordan form results do not match, but can be made to match by rearranging the diagonial blocks, then the matrices are still similar.