From 64acf9a1c40c3a8c6d7ecc4afe83fe84202c1b1f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Jul 2019 11:03:51 -0400 Subject: [PATCH] eja: implement element powers in terms of operator(). --- mjo/eja/euclidean_jordan_algebra.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 30881da..f913030 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -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): -- 2.44.2