From 00a9e89cf61f53131f4127253f68fb3cacfab128 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 24 Jun 2019 14:05:59 -0400 Subject: [PATCH] eja/euclidean_jordan_algebra.py: implement a working minimal_polynomial(). --- mjo/eja/euclidean_jordan_algebra.py | 48 ++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 097233f..d460aa0 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -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() -- 2.44.2