Hello all

trying approximate numerically eigenvalues of a matrix I get Error

sage: A=matrix(((0,1),(-1,0)))
sage: B=A.eigenvalues()[0]
sage: n(B)
Traceback (click to the left for traceback)
...
ValueError: Cannot coerce algebraic number with non-zero imaginary
part
to algebraic real


I guess, I have to convert B into complex number, since things like
sage: n(I)
works well. I understand that I can also extract real and imaginary
part, do numerical approximation and put things together. But it would
be nice to have one command for this trivial task.

How can I use the conversion into a type which can be approximated
numerically? And why is the result of eigenvalues not
'sage.symbolic.expression.Expression' as other complex numbers? What
is the difference.

I guess that missed something relevant to complex numbers in Sage.

And another question for people working with this: Do we have in Sage
a function which prints the number of positive eigenvalues, negative
eigenvalues, complex with positive real part and complex with negative
real part? Thank you

Robert Marik
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to