I dont' understand why Sage is unable to give an exact expression for the 
eigenvalues of the following matrix :

sage: A= matrix([[0,1],[1,-2]])
sage: [a for a,_,_ in A.eigenvectors_right()]
[-2.414213562373095?, 0.4142135623730951?]


The characteristic polynomial is very simple :

sage: A.charpoly()                           
x^2 + 2*x - 1


and Sage is able to compute the roots in exact form :

sage: (x^2 + 2*x - 1).roots()                
[(-sqrt(2) - 1, 1), (sqrt(2) - 1, 1)]
sage:

What is very surprising is that Sage does recognise the exact values :

sage: L=(x^2 + 2*x - 1).roots(multiplicities=False);L
[-sqrt(2) - 1, sqrt(2) - 1]
sage: [a for a,_,_ in A.eigenvectors_right()]==L     
True
sage: 


Is there any way to convert the charpoly result to a symbolic expression ?


Note that Maple gives the result in symbolic form:

> restart;with(LinearAlgebra):
> 
> A:=Matrix([<0,1>,<1,-2>]);

                                 [0     1]
                            A := [       ]
                                 [1    -2]

> Eigenvalues(A);

                             [      1/2]
                             [-1 + 2   ]
                             [         ]
                             [      1/2]
                             [-1 - 2   ]


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to