Jordan Canonical Form
- To: mathgroup at smc.vnet.net
- Subject: [mg26343] Jordan Canonical Form
- From: "Matt Herman" <Henayni at hotmail.com>
- Date: Tue, 12 Dec 2000 02:54:53 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
I wrote to the mathgroup earlier, detailing an error in
JordanDecomposition.
I have written the following function to compute the JCF.
JordanForm[M_, opt_, opt2_] :=
Module[{m = M, q = Dimensions[M][[1]], rootlist, list, list2, list3,
list4, s, r, g, h, i, list5, func, z, a},
If[opt == 0, func = Identity, func = N]; Attributes[CirclePlus]
= {Orderless, Flat};
g := list2[[t]]; h := list3[[t]]; i := list4[[t]]; rootlist =
Eigenvalues[M]; list = Union[rootlist]; r = Length[list];
list2 = Table[Count[rootlist, list[[t]]], {t, 1, r}];
list3 = Table[ Dimensions[ NullSpace[ MatrixPower[func[m -
list[[t]]*IdentityMatrix[q]], k]]][[1]], {t, 1, r}, {k, 1, g}];
list4 = Table[2 h[[g - k]] - (h[[g]] + h[[g - k - 1]]), {t, 1, r}, {k,
0, g - 2}];
Table[If[Length[h] > 1, list4[[t]] = Flatten[{i, h[[1]] - Plus @@ i}],
list4[[t]] = Flatten[{i, h[[1]]}]], {t, 1, r}];
list5 = List @@ Plus @@ Table[ list4[[n]].Reverse[ Table[j[list[[n]],
t], {t, 1, Length[list4[[n]]]}]], {n, 1, r}];
If[opt2 == 0, list5, Return[z = list5[[1]]; a = 1;
While[a < Length[list5], a++; z = CirclePlus[z, list5[[a]]]]; z]]]
*
Options for JordanForm:
opt -- if 0, use integer arithmetic; if 1, use numerical approximations.
opt2 -- if 0, output list of jordan matrices; if 1, output list in
direct sum notation
*
---------
The above implementation is not the most efficient, but it'll do. As I
said before, we define j(c,n) to be the nxn matrix with c's on the
diagonal and ones on the subdiagonal below the c's. If you output list5,
you get {d11 j(c1,n11),...,d1k j(c1,n1k),...,dst j(cs,nst)}, a list of
all the j's. The d_i's symbolize that there are d_i jordan blocks of the
certain form. The JCF is the matrix, with those "jordan blocks" on the
diagonal, and 0's everywhere else. The question is, how do you make this
matrix from the given list. The stuff from
LinearAlgebra`MatrixManipulation doesn't seem to work.
Thanks,
Matt