]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: simplify (and cite) the minimal_polynomial() implementation.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 21 Jul 2019 16:00:08 +0000 (12:00 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index fb92a310c2edaa27cd9b9cab35dd86d908790469..0ea9a4debe9c2ad0e33652f50b779fb8fc3838d3 100644 (file)
@@ -626,6 +626,13 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
 
         def minimal_polynomial(self):
             """
+            ALGORITHM:
+
+            We restrict ourselves to the associative subalgebra
+            generated by this element, and then return the minimal
+            polynomial of this element's operator matrix (in that
+            subalgebra). This works by Baes Proposition 2.3.16.
+
             EXAMPLES::
 
                 sage: set_random_seed()
@@ -660,25 +667,13 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
                 True
 
             """
-            # The element we're going to call "minimal_polynomial()" on.
-            # Either myself, interpreted as an element of a finite-
-            # dimensional algebra, or an element of an associative
-            # subalgebra.
-            elt = None
-
-            if self.parent().is_associative():
-                elt = FiniteDimensionalAlgebraElement(self.parent(), self)
-            else:
-                V = self.span_of_powers()
-                assoc_subalg = self.subalgebra_generated_by()
-                # Mis-design warning: the basis used for span_of_powers()
-                # and subalgebra_generated_by() must be the same, and in
-                # the same order!
-                elt = assoc_subalg(V.coordinates(self.vector()))
-
-            # Recursive call, but should work since elt lives in an
-            # associative algebra.
-            return elt.minimal_polynomial()
+            V = self.span_of_powers()
+            assoc_subalg = self.subalgebra_generated_by()
+            # Mis-design warning: the basis used for span_of_powers()
+            # and subalgebra_generated_by() must be the same, and in
+            # the same order!
+            elt = assoc_subalg(V.coordinates(self.vector()))
+            return elt.operator_matrix().minimal_polynomial()
 
 
         def natural_representation(self):