Ask Your Question

Is it possible to get normalised eigenvectors using eigenmatrix_right()?

asked 2010-12-13 09:20:49 -0500

Shashank gravatar image

I am trying to find out the diagonalizing matrix for a matrix using eigenmatrix_right(). The problem is that the eigenvector matrix returned by sage is not normalized. I have been writing a couple of for loops to normalize the eigenvectors. I was wondering whether there is a easier way maybe a option in eigenmatrix_right() which would give me an eigenmatrix with normalized eigenvectors?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2010-12-21 20:35:36 -0500

Jason Grout gravatar image

If you use RDF matrices, the eigenvectors are normalized, since scipy by default normalizes eigenvectors:

sage: m=random_matrix(RDF, 3)
sage: D,P=m.eigenmatrix_right()
sage: P
[                    0.772199899036                     0.772199899036                    -0.343345671023]
[-0.293125911736 - 0.444881864588*I -0.293125911736 + 0.444881864588*I                     0.612459302127]
[ 0.174684604473 + 0.298914588669*I  0.174684604473 - 0.298914588669*I                     0.712044488377]
sage: P.column(0).norm()
sage: P.column(1).norm()
sage: P.column(2).norm()
edit flag offensive delete link more

answered 2010-12-15 02:21:51 -0500

niles gravatar image

Try the following:

M = Matrix(2,2,range(4)) # or any matrix you have around

This will show the source code for eigenmatrix_right -- there, you'll see that eigenmatrix_right is defined by calling eigenmatrix_left on the transpose . . . checking


will show you that eigenmatrix_left just builds a matrix from the vectors in eigenvectors_left . . .


does some real work: it gets the eigenspaces from eigenspaces_left and performs some further checks on the basis for each eigenspace.

So the short answer to your question is "No, there is not an option for eigenmatrix_right which will return normalized eigenvectors". However, you might be able to get them easily by getting the basis of eigenspaces_right and normailzing it yourself.

Good luck :)

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


Asked: 2010-12-13 09:20:49 -0500

Seen: 651 times

Last updated: Dec 21 '10