First time here? Check out the FAQ!

Ask Your Question
0

Why does jordan_form not work over inexact rings?

asked 11 years ago

Lolina gravatar image

updated 11 years ago

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!

Preview: (hide)

4 Answers

Sort by » oldest newest most voted
0

answered 11 years ago

Lolina gravatar image

updated 11 years ago

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).

Preview: (hide)
link
0

answered 11 years ago

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]
Preview: (hide)
link

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 ( 11 years ago )
0

answered 11 years ago

tmonteil gravatar image

updated 11 years ago

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.

Preview: (hide)
link
0

answered 11 years ago

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?

Preview: (hide)
link

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 ( 11 years ago )

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: 11 years ago

Seen: 1,450 times

Last updated: Sep 02 '13