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 On Jan 19, 11:28 pm, Jason Grout <jason-s...@creativetrax.com> wrote: > 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 --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---