Ask Your Question
0

Why does jordan_form not work over inexact rings?

asked 2013-08-28 23:43:36 -0500

Lolina gravatar image

updated 2013-08-28 23:45:02 -0500

Hi,

Given a matrix M with entries (variables) in SR, I needed to compute the transformation matrix to a jordan form of M.

I ended up copying the code in "jordan_form" and "_jordan_form_vector_in_difference" from "matrix2.pyx", deleting the "if (base_ring is None and not self.base_ring().is_exact()) ..." and replacing "evals = A.charpoly().roots()" by

    eigenvects=A.eigenvectors_right()
    evals=[(eigenvect[0],eigenvect[2]) for eigenvect in eigenvects]

So far it seems to work. Can this go wrong? Or could one just change the original code in matrix2.pyx, and allow inexact rings?

Thanks for your help!

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2013-09-02 05:30:40 -0500

Lolina gravatar image

Yes, it's the "right" result, so

[   d0     1     0    0]
[    0    d0     1    0]
[    0     0    d0    1]
[    0     0     0   d0]

@nbruin: So you are saying that in general there shouldn't be a problem in my case?

edit flag offensive delete link more

Comments

You managed to compute the correct answer, didn't you? It's just that you can't expect the general code to perform well on non-exact input, since numerical stability would have to be taken into account. And SR has elements that should be considered non-exact. If you have further design questions about sage, please send them to a discussion group such as sage-support or sage-devel. Asksage is an awkward forum for discussion.

nbruin gravatar imagenbruin ( 2013-09-02 14:13:44 -0500 )edit
0

answered 2013-08-29 05:03:15 -0500

tmonteil gravatar image

updated 2013-08-29 05:04:50 -0500

Please could you provide the entries of your matrix more precisely ?

You should notice that things like x or even cos(x) are elements of the Symbolic Ring, and i doubt that your method will work correcly with such entries. the Symbolic Ring also contains elements of RR for which the computation of eigenvalues is not reliable.

Depending on your entries, it could make sense to send them to an exact ring first (e.g. the algebraic numbers).

Also, if your entries are numerical, you should convert them in RDF for which the computation of eigenvalues is OK.

edit flag offensive delete link more
0

answered 2013-09-01 02:18:03 -0500

tmonteil gravatar image

I am curious to see what does Sage answers on this particular example. If there is no asumption on the di, the following non equivalent answers are possible:

[   d0     1     0    0]
[    0    d0     1    0]
[    0     0    d0    1]
[    0     0     0   d0]

[   d0     0     0    0]
[    0    d0     0    0]
[    0     0    d0    0]
[    0     0     0   d0]
edit flag offensive delete link more

Comments

Actually, there is only one possibility. The matrix M-d0*I has a one-dim kernel if d1 is non-zero, so there's only one Jordan block.The symbolic ring has issues, but for simple polynomial algebra its properties are fairly regular: a variable like d1 is simply a transcendental element, so in particular non-zero. (SR tries to model a domain)

nbruin gravatar imagenbruin ( 2013-09-01 09:32:32 -0500 )edit
0

answered 2013-08-29 06:37:31 -0500

Lolina gravatar image

updated 2013-08-29 10:42:03 -0500

Thanks for the answer. I want to compute [the transformation matrix to] the Jordan normal forms of block matrices whose blocks are of the form

[   d0    d1    d2   d3]
[    0    d0    d1   d2]
[    0     0    d0   d1]
[    0     0     0   d0]

(i.e. an upper triangular Toeplitz matrix whose entries are variables or 0).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-28 23:43:36 -0500

Seen: 351 times

Last updated: Sep 02 '13