From: Michael Orlitzky Date: Tue, 8 Dec 2020 18:59:19 +0000 (-0500) Subject: eja: fix fast charpoly in one case. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=3f7be6593b9eb870406dbb511feaf85c58c75121;p=sage.d.git eja: fix fast charpoly in one case. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index b14c78a..eca279f 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1261,7 +1261,14 @@ class RationalBasisEJA(FiniteDimensionalEJA): a = ( a_i.change_ring(self.base_ring()) for a_i in self._rational_algebra._charpoly_coefficients() ) - # Now convert the coordinate variables back to the + if self._deortho_matrix is None: + # This can happen if our base ring was, say, AA and we + # chose not to (or didn't need to) orthonormalize. It's + # still faster to do the computations over QQ even if + # the numbers in the boxes stay the same. + return tuple(a) + + # Otherwise, convert the coordinate variables back to the # deorthonormalized ones. R = self.coordinate_polynomial_ring() from sage.modules.free_module_element import vector