From: Michael Orlitzky Date: Fri, 26 Jul 2019 14:05:45 +0000 (-0400) Subject: eja: use the quadratic representation for the element inverse. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=9144c528176a467bec604e334ba05379cc995ae3;p=sage.d.git eja: use the quadratic representation for the element inverse. --- diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index da3f600..4b46380 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -658,8 +658,10 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): """ Return the Jordan-multiplicative inverse of this element. - We can't use the superclass method because it relies on the - algebra being associative. + ALGORITHM: + + We appeal to the quadratic representation as in Koecher's + Theorem 12 in Chapter III, Section 5. EXAMPLES: @@ -698,34 +700,28 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): sage: (not x.is_invertible()) or (x.inverse()*x == J.one()) True - """ - if not self.is_invertible(): - raise ValueError("element not invertible") + The inverse of the inverse is what we started with:: - if self.parent().is_associative(): - elt = FiniteDimensionalAlgebraElement(self.parent(), self) - # elt is in the right coordinates, but has the wrong class. - return self.parent()(elt.inverse().vector()) + sage: set_random_seed() + sage: J = random_eja() + sage: x = J.random_element() + sage: (not x.is_invertible()) or (x.inverse().inverse() == x) + True - # We do this a little different than the usual recursive - # call to a finite-dimensional algebra element, because we - # wind up with an inverse that lives in the subalgebra and - # we need information about the parent to convert it back. - 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())) + The zero element is never invertible:: + + sage: set_random_seed() + sage: J = random_eja().zero().inverse() + Traceback (most recent call last): + ... + ValueError: element is not invertible - # This will be in the subalgebra's coordinates... - fda_elt = FiniteDimensionalAlgebraElement(assoc_subalg, elt) - subalg_inverse = fda_elt.inverse() + """ + if not self.is_invertible(): + raise ValueError("element is not invertible") - # So we have to convert back... - basis = [ self.parent(v) for v in V.basis() ] - pairs = zip(subalg_inverse.vector(), basis) - return self.parent().linear_combination(pairs) + P = self.parent() + return P(self.quadratic_representation().inverse()*self.vector()) def is_invertible(self):