Ask Your Question
0

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

asked 2010-12-13 16:20:49 +0200

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
1

answered 2010-12-22 03:35:36 +0200

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()
1.0
sage: P.column(1).norm()
1.0
sage: P.column(2).norm()
1.0
edit flag offensive delete link more
0

answered 2010-12-15 09:21:51 +0200

niles gravatar image

Try the following:

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

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

M.eigenmatrix_left??

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

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

Stats

Asked: 2010-12-13 16:20:49 +0200

Seen: 1,742 times

Last updated: Dec 22 '10