]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: implement a working minimal_polynomial().
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 24 Jun 2019 18:05:59 +0000 (14:05 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:12:27 +0000 (23:12 -0400)
mjo/eja/euclidean_jordan_algebra.py

index 097233fdad86dea01e11483d7b7525f0ab816f2a..d460aa029e777f137e64d6028f34a2b55cce6101 100644 (file)
@@ -141,7 +141,53 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
 
 
         def minimal_polynomial(self):
-            return self.matrix().minimal_polynomial()
+            """
+            EXAMPLES::
+
+                sage: set_random_seed()
+                sage: n = ZZ.random_element(1,10).abs()
+                sage: J = eja_rn(n)
+                sage: x = J.random_element()
+                sage: x.degree() == x.minimal_polynomial().degree()
+                True
+
+            ::
+
+                sage: set_random_seed()
+                sage: n = ZZ.random_element(1,10).abs()
+                sage: J = eja_ln(n)
+                sage: x = J.random_element()
+                sage: x.degree() == x.minimal_polynomial().degree()
+                True
+
+            The minimal polynomial and the characteristic polynomial coincide
+            and are known (see Alizadeh, Example 11.11) for all elements of
+            the spin factor algebra that aren't scalar multiples of the
+            identity::
+
+                sage: set_random_seed()
+                sage: n = ZZ.random_element(2,10).abs()
+                sage: J = eja_ln(n)
+                sage: y = J.random_element()
+                sage: while y == y.coefficient(0)*J.one():
+                ....:     y = J.random_element()
+                sage: y0 = y.vector()[0]
+                sage: y_bar = y.vector()[1:]
+                sage: actual = y.minimal_polynomial()
+                sage: x = SR.symbol('x', domain='real')
+                sage: expected = x^2 - 2*y0*x + (y0^2 - norm(y_bar)^2)
+                sage: bool(actual == expected)
+                True
+
+            """
+            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!
+            subalg_self = assoc_subalg(V.coordinates(self.vector()))
+            return subalg_self.matrix().minimal_polynomial()
+
 
         def characteristic_polynomial(self):
             return self.matrix().characteristic_polynomial()