| 1 | initial version |
Could you change the ring to SR as a workaround?
sage: R = PolynomialRing(QQ, 'x', 2)
sage: x = R.gens()
sage: M = matrix([[x[0],x[1]],[x[1],x[0]]])
sage: M.eigenvalues()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
[...]
sage: M.change_ring(SR)
[x0 x1]
[x1 x0]
sage: M.change_ring(SR).eigenvalues()
[x0 - x1, x0 + x1]
| 2 | No.2 Revision |
Could you change the ring to SR as a workaround?
sage: R = PolynomialRing(QQ, 'x', 2)
sage: x = R.gens()
sage: M = matrix([[x[0],x[1]],[x[1],x[0]]])
sage: M.eigenvalues()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
[...]
sage: M.change_ring(SR)
[x0 x1]
[x1 x0]
sage: M.change_ring(SR).eigenvalues()
[x0 - x1, x0 + x1]
EDIT: You might want to use K=R.fraction_field() and then do something like M.characteristic_polynomial().change_ring(K).roots(). It doesn't get you the eigenvalues that aren't rational over R, but the answer you get back in SR will not be very useful either.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.