]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_algebra.py
eja: more cached charpoly coefficients.
[sage.d.git] / mjo / eja / eja_algebra.py
index a10e2a37f30313c54e0d0682c524c71f0e5af416..a2adbb2bed47499aea53b38fe175547b887fb2a9 100644 (file)
@@ -1988,6 +1988,14 @@ class RealSymmetricEJA(MatrixEJA, RationalBasisEJA, ConcreteEJA):
         A = MatrixSpace(field, n)
         super().__init__(A, **kwargs)
 
+        from mjo.eja.eja_cache import real_symmetric_eja_coeffs
+        a = real_symmetric_eja_coeffs(self)
+        if a is not None:
+            if self._rational_algebra is None:
+                self._charpoly_coefficients.set_cache(a)
+            else:
+                self._rational_algebra._charpoly_coefficients.set_cache(a)
+
 
 
 class ComplexHermitianEJA(MatrixEJA, RationalBasisEJA, ConcreteEJA):
@@ -2070,6 +2078,13 @@ class ComplexHermitianEJA(MatrixEJA, RationalBasisEJA, ConcreteEJA):
         A = ComplexMatrixAlgebra(n, scalars=field)
         super().__init__(A, **kwargs)
 
+        from mjo.eja.eja_cache import complex_hermitian_eja_coeffs
+        a = complex_hermitian_eja_coeffs(self)
+        if a is not None:
+            if self._rational_algebra is None:
+                self._charpoly_coefficients.set_cache(a)
+            else:
+                self._rational_algebra._charpoly_coefficients.set_cache(a)
 
     @staticmethod
     def _max_random_instance_size():