Jordan Normal Form Problem

181 views
Skip to first unread message

c mullan

unread,
Jan 19, 2009, 6:07:56 PM1/19/09
to sage-support
Hi all,

by general theory I know that an invertible transformation matrix P
exists such that A = ~P*J*P where J is the Jordan Normal Form of a
square matrix A. When I try to calculate P, some strange things
happen..

M=MatrixSpace(GF(2),7)
A=M.random_element()
f=A.charpoly()
d = lcm([p.degree() for p,e in f.factor()])
J,P=A.jordan_form(GF(2^d,'b'),transformation=True) # in general,
A's e.values will live in an extension field

In some instances I get an error message like:

ValueError: cannot compute the basis of the Jordan block of size 6
with eigenvalue 0

(nothing special about the e.value 0 here) and in other instances I
get no error messages but the matrix P is singular!

Can anyone see what the problem is here?
Thanks.

Jason Grout

unread,
Jan 19, 2009, 6:28:33 PM1/19/09
to sage-s...@googlegroups.com
c mullan wrote:
> Hi all,
>
> by general theory I know that an invertible transformation matrix P
> exists such that A = ~P*J*P where J is the Jordan Normal Form of a
> square matrix A. When I try to calculate P, some strange things
> happen..
>
> M=MatrixSpace(GF(2),7)
> A=M.random_element()
> f=A.charpoly()
> d = lcm([p.degree() for p,e in f.factor()])
> J,P=A.jordan_form(GF(2^d,'b'),transformation=True) # in general,
> A's e.values will live in an extension field
>
> In some instances I get an error message like:
>
> ValueError: cannot compute the basis of the Jordan block of size 6
> with eigenvalue 0
>


Can you give a specific example of it not working, or if the above
example doesn't work, exactly what you expect? When I run the above
commands in 3.2.3, I get the following. Note that there was a bug in
the Jordan Form code a few versions back, so you might be running into
problems if you are running an old version of Sage.

sage: M=MatrixSpace(GF(2),7)
sage: A=M.random_element()
sage: f=A.charpoly()
sage: d = lcm([p.degree() for p,e in f.factor()])
sage: J,P=A.jordan_form(GF(2^d,'b'),transformation=True)
sage: J

[ 1| 0| 0| 0 0| 0 0]
[-----+-----+-----+-----------+-----------]
[ 0| b| 0| 0 0| 0 0]
[-----+-----+-----+-----------+-----------]
[ 0| 0|b + 1| 0 0| 0 0]
[-----+-----+-----+-----------+-----------]
[ 0| 0| 0| 0 1| 0 0]
[ 0| 0| 0| 0 0| 0 0]
[-----+-----+-----+-----------+-----------]
[ 0| 0| 0| 0 0| 0 1]
[ 0| 0| 0| 0 0| 0 0]
sage: P

[ 0 1 1 1 0 1 1]
[ 1 1 1 0 0 1 0]
[ 0 b + 1 b 1 1 1 0]
[ 0 0 0 1 0 1 0]
[ 1 1 1 0 1 0 1]
[ 0 1 1 1 1 0 1]
[ 0 1 1 1 0 0 1]


Jason

c mullan

unread,
Jan 20, 2009, 6:47:57 PM1/20/09
to sage-support
Hi Jason,

thanks, you hit the nail on the head - I had not downloaded the latest
version..it works fine now, and I've learned a valuable lesson!

Ciaran
Reply all
Reply to author
Forward
0 new messages