]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/euclidean_jordan_algebra.py
eja: convert another operator_matrix() test to operator().
[sage.d.git] / mjo / eja / euclidean_jordan_algebra.py
index f913030a7a52be7d369a78ba026848dd986acade..9072a12e511b51dbeb64fe6c9e0336a0ab6d87fe 100644 (file)
@@ -962,6 +962,57 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
                 sage: lhs == rhs
                 True
 
+            Test the first polarization identity from my notes, Koecher Chapter
+            III, or from Baes (2.3)::
+
+                sage: set_random_seed()
+                sage: J = random_eja()
+                sage: x = J.random_element()
+                sage: y = J.random_element()
+                sage: Lx = x.operator()
+                sage: Ly = y.operator()
+                sage: Lxx = (x*x).operator()
+                sage: Lxy = (x*y).operator()
+                sage: bool(2*Lx*Lxy + Ly*Lxx == 2*Lxy*Lx + Lxx*Ly)
+                True
+
+            Test the second polarization identity from my notes or from
+            Baes (2.4)::
+
+                sage: set_random_seed()
+                sage: J = random_eja()
+                sage: x = J.random_element()
+                sage: y = J.random_element()
+                sage: z = J.random_element()
+                sage: Lx = x.operator()
+                sage: Ly = y.operator()
+                sage: Lz = z.operator()
+                sage: Lzy = (z*y).operator()
+                sage: Lxy = (x*y).operator()
+                sage: Lxz = (x*z).operator()
+                sage: bool(Lx*Lzy + Lz*Lxy + Ly*Lxz == Lzy*Lx + Lxy*Lz + Lxz*Ly)
+                True
+
+            Test the third polarization identity from my notes or from
+            Baes (2.5)::
+
+                sage: set_random_seed()
+                sage: J = random_eja()
+                sage: u = J.random_element()
+                sage: y = J.random_element()
+                sage: z = J.random_element()
+                sage: Lu = u.operator()
+                sage: Ly = y.operator()
+                sage: Lz = z.operator()
+                sage: Lzy = (z*y).operator()
+                sage: Luy = (u*y).operator()
+                sage: Luz = (u*z).operator()
+                sage: Luyz = (u*(y*z)).operator()
+                sage: lhs = Lu*Lzy + Lz*Luy + Ly*Luz
+                sage: rhs = Luyz + Ly*Lu*Lz + Lz*Lu*Ly
+                sage: bool(lhs == rhs)
+                True
+
             """
             if not other in self.parent():
                 raise TypeError("'other' must live in the same algebra")
@@ -1224,7 +1275,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
             Our parent class defines ``left_matrix`` and ``matrix``
             methods whose names are misleading. We don't want them.
             """
-            raise NotImplementedError("use operator_matrix() instead")
+            raise NotImplementedError("use operator().matrix() instead")
 
         matrix = left_matrix
 
@@ -1384,57 +1435,6 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
 
             EXAMPLES:
 
-            Test the first polarization identity from my notes, Koecher Chapter
-            III, or from Baes (2.3)::
-
-                sage: set_random_seed()
-                sage: J = random_eja()
-                sage: x = J.random_element()
-                sage: y = J.random_element()
-                sage: Lx = x.operator_matrix()
-                sage: Ly = y.operator_matrix()
-                sage: Lxx = (x*x).operator_matrix()
-                sage: Lxy = (x*y).operator_matrix()
-                sage: bool(2*Lx*Lxy + Ly*Lxx == 2*Lxy*Lx + Lxx*Ly)
-                True
-
-            Test the second polarization identity from my notes or from
-            Baes (2.4)::
-
-                sage: set_random_seed()
-                sage: J = random_eja()
-                sage: x = J.random_element()
-                sage: y = J.random_element()
-                sage: z = J.random_element()
-                sage: Lx = x.operator_matrix()
-                sage: Ly = y.operator_matrix()
-                sage: Lz = z.operator_matrix()
-                sage: Lzy = (z*y).operator_matrix()
-                sage: Lxy = (x*y).operator_matrix()
-                sage: Lxz = (x*z).operator_matrix()
-                sage: bool(Lx*Lzy + Lz*Lxy + Ly*Lxz == Lzy*Lx + Lxy*Lz + Lxz*Ly)
-                True
-
-            Test the third polarization identity from my notes or from
-            Baes (2.5)::
-
-                sage: set_random_seed()
-                sage: J = random_eja()
-                sage: u = J.random_element()
-                sage: y = J.random_element()
-                sage: z = J.random_element()
-                sage: Lu = u.operator_matrix()
-                sage: Ly = y.operator_matrix()
-                sage: Lz = z.operator_matrix()
-                sage: Lzy = (z*y).operator_matrix()
-                sage: Luy = (u*y).operator_matrix()
-                sage: Luz = (u*z).operator_matrix()
-                sage: Luyz = (u*(y*z)).operator_matrix()
-                sage: lhs = Lu*Lzy + Lz*Luy + Ly*Luz
-                sage: rhs = Luyz + Ly*Lu*Lz + Lz*Lu*Ly
-                sage: bool(lhs == rhs)
-                True
-
             Ensure that our operator's ``matrix`` method agrees with
             this implementation::
 
@@ -1591,13 +1591,13 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
                 sage: x.subalgebra_generated_by().is_associative()
                 True
 
-            Squaring in the subalgebra should be the same thing as
-            squaring in the superalgebra::
+            Squaring in the subalgebra should work the same as in
+            the superalgebra::
 
                 sage: set_random_seed()
                 sage: x = random_eja().random_element()
                 sage: u = x.subalgebra_generated_by().random_element()
-                sage: u.operator_matrix()*u.vector() == (u**2).vector()
+                sage: u.operator()(u) == u^2
                 True
 
             """