JordanBlockExamps.mws

Linear Algebra Powertool

Creating Example Matrices

Worksheet by Russell Blyth

The material in chapter 7 on canonical forms is rather dense. It is useful to look at examples with the material. A minor difficulty is that any computation on 8 by 8 matrices gets tedious in a hurry. That is where Maple comes in. We start by loading Maple's linear algebra functions.

> with(linalg);

Warning, the protected names norm and trace have been redefined and unprotected

[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...
[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp,...

Creating a Jordan bloc k matrix.

The first kind of matrix we would like to create is a specified Jordan block. To do this we use the JordanBock command. Consider the Jordan block of size 4 associated with eigenvalue 2.

> J2s4 := JordanBlock(2,4);

J2s4 := matrix([[2, 1, 0, 0], [0, 2, 1, 0], [0, 0, ...

Next we would like to put several Jordan blocks together in a single matrix. We do that with the diag command. Consider the matrix used in example 1.

> Examp1 := diag(JordanBlock(2,3),JordanBlock(2,1),JordanBlock(3,2), JordanBlock(0,2));

Examp1 := matrix([[2, 1, 0, 0, 0, 0, 0, 0], [0, 2, ...

We also want to be able to produce an identity matrix of the same size.

> Ident8 := diag(seq(1,i=1..8));

Ident8 := matrix([[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, ...

We can now look at matrices of the form A-lambda*I and its powers.

> evalm(Examp1-2*Ident8);
evalm((Examp1-2*Ident8)^2);
evalm((Examp1-2*Ident8)^3);

matrix([[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0...

matrix([[0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0...

matrix([[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0...

Notice that the Jordan blocks associated with 2 are killed by sufficiently high powers of (M-2I) and other blocks keep the same size.

Finding a Jordan basis

To find a Jordan basis for M, we need to look at the nulspaces of (M-lambda*I)^i for various lambda and i.

We continue to work with the same example. (You should stop and not that since the matrix is in Jordan form, the canonical basis is a Jordan basis. Nevertheless, it is a good example for working on technique.) We want to look at the nullspces of (M-2I) ^n for various n.

> Mat1 := evalm(Examp1-2*Ident8);
ans1 := nullspace(Mat1);
ans2 := nullspace(evalm(Mat1^2));
ans3 := nullspace(evalm(Mat1^3));
ans4 := nullspace(evalm(Mat1^4));

Mat1 := matrix([[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1,...

ans1 := {vector([0, 0, 0, 1, 0, 0, 0, 0]), vector([...

ans2 := {vector([0, 0, 0, 1, 0, 0, 0, 0]), vector([...

ans3 := {vector([0, 0, 0, 1, 0, 0, 0, 0]), vector([...

ans4 := {vector([0, 0, 0, 1, 0, 0, 0, 0]), vector([...

Time for some technical tidying. Maple answers the nullspace command with a set of basis vectors for the nullspace. Sets are unordered. To turn the sets into sequences we use the op command.

> nul1 := op(ans1);
nul2 := op(ans2);
nul3 := op(ans3);

nul1 := vector([1, 0, 0, 0, 0, 0, 0, 0]), vector([0...

nul2 := vector([1, 0, 0, 0, 0, 0, 0, 0]), vector([0...

nul3 := vector([0, 1, 0, 0, 0, 0, 0, 0]), vector([0...

Looking at the sizes of the nullspaces, we need a 3-cycle that starts with a vector in nul3 that is not in the span of nul2, and a 1-cycle that starts with a vector in nul1 that is linearly independent form the set of initial vectors of the longer cycle.

To check linear independence of the vectors in nul3 from the vectors in nul2 I want to turn the vectors in nul2 into a matrix with the stackmatrix command.

> test1 := stackmatrix(nul2[1], nul2[2], nul2[3]);

test1 := matrix([[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0...

Next I add each vector in nul3 to that matrix and see if the rank increases.

> for i from 1 to 4 do
rank(stackmatrix(test1,nul3[i]));
od;

3

4

3

3

So we see that v1 should be nul3[2].

> v1 := nul3[2];

v1 := vector([0, 0, 1, 0, 0, 0, 0, 0])

Next we find the other vectors in the cycle.

> v1a := evalm(Mat1&*v1);
v1b := evalm(Mat1&*v1a);

v1a := vector([0, 1, 0, 0, 0, 0, 0, 0])

v1b := vector([1, 0, 0, 0, 0, 0, 0, 0])

Now we look for vectors in nul1 that are LI from v1b.

> for i from 1 to 2 do
rank(stackmatrix(v1b, nul1[i]));
od;

1

2

> v2 := nul1[1];

v2 := vector([1, 0, 0, 0, 0, 0, 0, 0])

Thus the Jordan basis for K_2 is {v1b, v1a, v1, v2}.

Exercise

Find the Jordan basis for the following matrix which is not in Jordan form.

> M2 := diag(companion((x-3)^4, x), companion((x-3)^2,x),
companion((x-3)^2,x), companion(x-3,x));
factor(charpoly(M2,x));

M2 := matrix([[0, 0, 0, -81, 0, 0, 0, 0, 0], [1, 0,...

(x-3)^9

>

>

>