]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add minimal_polynomial() for operators.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 28 Jul 2019 15:35:08 +0000 (11:35 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index cc44f61aa5ed24934e753599557ab2210b393cf9..9a201609b1051d8c68580836797b284aac79b67f 100644 (file)
@@ -351,6 +351,22 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map):
         return self._matrix
 
 
+    def minimal_polynomial(self):
+        """
+        Return the minimal polynomial of this linear operator,
+        in the variable ``t``.
+
+        EXAMPLES::
+
+            sage: J = RealSymmetricEJA(3)
+            sage: J.one().operator().minimal_polynomial()
+            t - 1
+
+        """
+        # The matrix method returns a polynomial in 'x' but want one in 't'.
+        return self.matrix().minimal_polynomial().change_variable_name('t')
+
+
 class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
     @staticmethod
     def __classcall_private__(cls,
@@ -1349,11 +1365,8 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
             # and subalgebra_generated_by() must be the same, and in
             # the same order!
             elt = assoc_subalg(V.coordinates(self.vector()))
+            return elt.operator().minimal_polynomial()
 
-            # We get back a symbolic polynomial in 'x' but want a real
-            # polynomial in 't'.
-            p_of_x = elt.operator().matrix().minimal_polynomial()
-            return p_of_x.change_variable_name('t')
 
 
         def natural_representation(self):