On Friday, 5 December 2025 at 03:21:26 UTC-8 [email protected] wrote:

So I would hesitate before switching to a position where only eigenvalues 
in the base ring are returned unless a non-default paramater option is 
provided.  On the other hand, I would support having a ring parameter which 
if None (the default) would revert to the current behavious over QQ.  Then 
there would be no change for beginners, while others would be able to say 
M.eigenvalues(ring=RR) or M.eigenvalues(ring=my_favourite_number_field).

For consistency we should probably do the same thing for roots of 
polynomials in QQ[x].  WIth the above M, M.charpoly().roots() returns [],  
not the same as M.eigenvalues()!  If we were to change roots() (for 
univariate polynomials over QQ only) to match the eigenvalues() behaviour 
it could return roots in QQbar unless you specifically set ring=QQ.


Thank you, John, for bringing up this perspective. I think the argument for 
"eigenvalues" is a good one. I wouldn't generalize to roots of polynomials, 
though: that a polynomial over QQ "has no roots" when it is irreducible 
(and of degree at least 2) is also taught quite early. So I think the 
default behaviour of "roots" is fine. The difference with what 
"eigenvalues" does is up to "eigenvalues" to explain.

(Also, "roots" is quite essential in serious code -- one should be careful 
in compromising it with features for interactive and educational use. That 
might have to go in a wrapper instead, if it is that badly needed) 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/2d71e165-26f0-4c3b-8209-49bd87b1edc6n%40googlegroups.com.

Reply via email to