]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_algebra.py
eja: cache the charpoly coefficients for the AlbertEJA.
[sage.d.git] / mjo / eja / eja_algebra.py
index b2891e577e9aa0c5e36b64b6a537807e9330d0e6..587d8e339463adaafb0a390ec164e76a6e5ca0c4 100644 (file)
@@ -2281,6 +2281,14 @@ class OctonionHermitianEJA(MatrixEJA, RationalBasisEJA, ConcreteEJA):
         A = OctonionMatrixAlgebra(n, scalars=field)
         super().__init__(A, **kwargs)
 
+        if n == 3:
+            from mjo.eja.eja_cache import albert_eja_coeffs
+            a = albert_eja_coeffs(self.coordinate_polynomial_ring())
+            if self._rational_algebra is None:
+                self._charpoly_coefficients.set_cache(a)
+            else:
+                self._rational_algebra._charpoly_coefficients.set_cache(a)
+
 
 class AlbertEJA(OctonionHermitianEJA):
     r"""