]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: use the quadratic representation for the element inverse.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 26 Jul 2019 14:05:45 +0000 (10:05 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index da3f6001e2d3878f6c5311eb309f8b2a22676a00..4b46380708e05fdeb564d300c6f5cca7f91178e7 100644 (file)
@@ -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):