From: Michael Orlitzky Date: Mon, 22 Jul 2019 20:50:50 +0000 (-0400) Subject: eja: switch to the "real" element characteristic_polynomial() implementation. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=0e576704d235f1818b4ecd9f6ac0bdd5823fd745;p=sage.d.git eja: switch to the "real" element characteristic_polynomial() implementation. --- diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index b5cef0a..421c70b 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -410,17 +410,37 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): def characteristic_polynomial(self): """ - Return my characteristic polynomial (if I'm a regular - element). + Return the characteristic polynomial of this element. + + EXAMPLES: + + The rank of `R^3` is three, and the minimal polynomial of + the identity element is `(t-1)` from which it follows that + the characteristic polynomial should be `(t-1)^3`:: + + sage: J = RealCartesianProductEJA(3) + sage: J.one().characteristic_polynomial() + t^3 - 3*t^2 + 3*t - 1 + + Likewise, the characteristic of the zero element in the + rank-three algebra `R^{n}` should be `t^{3}`:: + + sage: J = RealCartesianProductEJA(3) + sage: J.zero().characteristic_polynomial() + t^3 + + The characteristic polynomial of an element should evaluate + to zero on that element:: + + sage: set_random_seed() + sage: x = RealCartesianProductEJA(3).random_element() + sage: p = x.characteristic_polynomial() + sage: x.apply_univariate_polynomial(p) + 0 - Eventually this should be implemented in terms of the parent - algebra's characteristic polynomial that works for ALL - elements. """ - if self.is_regular(): - return self.minimal_polynomial() - else: - raise NotImplementedError('irregular element') + p = self.parent().characteristic_polynomial() + return p(*self.vector()) def inner_product(self, other):