]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: implement element powers in terms of operator().
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 28 Jul 2019 15:03:51 +0000 (11:03 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index 30881da2bf696d01b51b6d159cb005f3a9459728..f913030a7a52be7d369a78ba026848dd986acade 100644 (file)
@@ -761,7 +761,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
 
                 sage: set_random_seed()
                 sage: x = random_eja().random_element()
-                sage: x.operator_matrix()*x.vector() == (x^2).vector()
+                sage: x.operator()(x) == (x^2)
                 True
 
             A few examples of power-associativity::
@@ -780,19 +780,18 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
                 sage: x = random_eja().random_element()
                 sage: m = ZZ.random_element(0,10)
                 sage: n = ZZ.random_element(0,10)
-                sage: Lxm = (x^m).operator_matrix()
-                sage: Lxn = (x^n).operator_matrix()
+                sage: Lxm = (x^m).operator()
+                sage: Lxn = (x^n).operator()
                 sage: Lxm*Lxn == Lxn*Lxm
                 True
 
             """
-            A = self.parent()
             if n == 0:
-                return A.one()
+                return self.parent().one()
             elif n == 1:
                 return self
             else:
-                return A( (self.operator_matrix()**(n-1))*self.vector() )
+                return (self.operator()**(n-1))(self)
 
 
         def apply_univariate_polynomial(self, p):