From: Michael Orlitzky Date: Mon, 22 Jul 2019 19:46:50 +0000 (-0400) Subject: eja: use 't' for the minimal polynomial variable name. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1ba2e2b5a4b46933c820ec7cc61cc6dcb8cadc6b;p=sage.d.git eja: use 't' for the minimal polynomial variable name. --- diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 29248fc..8f508bc 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -675,6 +675,9 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): def minimal_polynomial(self): """ + Return the minimal polynomial of this element, + as a function of the variable `t`. + ALGORITHM: We restrict ourselves to the associative subalgebra @@ -682,14 +685,20 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): polynomial of this element's operator matrix (in that subalgebra). This works by Baes Proposition 2.3.16. - EXAMPLES:: + TESTS: + + The minimal polynomial of the identity and zero elements are + always the same:: sage: set_random_seed() - sage: x = random_eja().random_element() - sage: x.degree() == x.minimal_polynomial().degree() - True + sage: J = random_eja() + sage: J.one().minimal_polynomial() + t - 1 + sage: J.zero().minimal_polynomial() + t - :: + The degree of an element is (by one definition) the degree + of its minimal polynomial:: sage: set_random_seed() sage: x = random_eja().random_element() @@ -710,8 +719,8 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): 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: t = PolynomialRing(J.base_ring(),'t').gen(0) + sage: expected = t^2 - 2*y0*t + (y0^2 - norm(y_bar)^2) sage: bool(actual == expected) True @@ -722,7 +731,11 @@ 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_matrix().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):