# Bypass the hijinks if they won't benefit us.
return super()._charpoly_coefficients()
- # Do the computation over the rationals. The answer will be
- # the same, because all we've done is a change of basis.
- # Then, change back from QQ to our real base ring
+ # Do the computation over the rationals.
a = ( a_i.change_ring(self.base_ring())
for a_i in self.rational_algebra()._charpoly_coefficients() )
- # Otherwise, convert the coordinate variables back to the
- # deorthonormalized ones.
+ # Convert our coordinate variables into deorthonormalized ones
+ # and substitute them into the deorthonormalized charpoly
+ # coefficients.
R = self.coordinate_polynomial_ring()
from sage.modules.free_module_element import vector
X = vector(R, R.gens())