ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 17 Feb 2014 02:48:37 +0100How should I get symbolic expression of eigenvalues and eigenvectors of a real symmetric matrix 3x3https://ask.sagemath.org/question/11047/how-should-i-get-symbolic-expression-of-eigenvalues-and-eigenvectors-of-a-real-symmetric-matrix-3x3/Hi all
I am a physicist and a new user of Sage. I used the following command on "Sage Version 5.1, Release Date: 2012-07-09", to get the expression of eigenvalue and eigenvectors of the symmetric real 3x3 matrix.
var('g11,g12,g13,g22,g23,g33',domain='real')
gamma=matrix(3,3,[g11,g12,g13,g12,g22,g23,g13,g23,g33])
eigs=gamma.eigenvectors_right()
It seems that this type of expression is unavailable, as it took forever to calculate on my laptop (Intel core i7) . So I would like to ask if I used the wrong command or mathematically the analytical expression is unavailable. Thanks very much.Sun, 16 Feb 2014 20:24:10 +0100https://ask.sagemath.org/question/11047/how-should-i-get-symbolic-expression-of-eigenvalues-and-eigenvectors-of-a-real-symmetric-matrix-3x3/Answer by slelievre for <p>Hi all
I am a physicist and a new user of Sage. I used the following command on "Sage Version 5.1, Release Date: 2012-07-09", to get the expression of eigenvalue and eigenvectors of the symmetric real 3x3 matrix.</p>
<pre><code>var('g11,g12,g13,g22,g23,g33',domain='real')
gamma=matrix(3,3,[g11,g12,g13,g12,g22,g23,g13,g23,g33])
eigs=gamma.eigenvectors_right()
</code></pre>
<p>It seems that this type of expression is unavailable, as it took forever to calculate on my laptop (Intel core i7) . So I would like to ask if I used the wrong command or mathematically the analytical expression is unavailable. Thanks very much.</p>
https://ask.sagemath.org/question/11047/how-should-i-get-symbolic-expression-of-eigenvalues-and-eigenvectors-of-a-real-symmetric-matrix-3x3/?answer=16052#post-id-16052You can access the documentation for eigenvalues_right:
sage: gamma.eigenvectors_right?
or the source code:
sage: gamma.eigenvectors_right??
There you see that the right eigenvectors are computed by computing the left
eigenvectors of the transpose matrix. So let's check the documentation for
`eigenvectors_left`:
sage: gamma.eigenvectors_left?
or the source code:
sage: gamma.eigenvectors_left??
You can see there an example involving a 2x2 matrix with symbolic entries,
followed by the following comment:
This routine calls Maxima and can struggle with even small matrices
with a few variables, such as a `3\times 3` matrix with three variables.
However, if the entries are integers or rationals it can produce exact
values in a reasonable time.
Note: to get the documentation for that command in html format, do:
sage: browse_sage_doc(gamma.eigenvectors_left)
Mon, 17 Feb 2014 02:48:37 +0100https://ask.sagemath.org/question/11047/how-should-i-get-symbolic-expression-of-eigenvalues-and-eigenvectors-of-a-real-symmetric-matrix-3x3/?answer=16052#post-id-16052