]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix fast charpoly in one case.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 8 Dec 2020 18:59:19 +0000 (13:59 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 8 Dec 2020 18:59:19 +0000 (13:59 -0500)
mjo/eja/eja_algebra.py

index b14c78ab5705309b272896b6a4996eb2b8f11c35..eca279f68156ef1cd8e407f2f8ad25661af1e517 100644 (file)
@@ -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