]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_algebra.py
Revert "eja: demonstration for https://trac.sagemath.org/ticket/31421."
[sage.d.git] / mjo / eja / eja_algebra.py
index 9815ae48de66ebcb50fbc236d09875cc87cefb3a..ccc5006f3d79397d81ad98bbf45a7262e36dd6e9 100644 (file)
@@ -2690,7 +2690,8 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
 
     SETUP::
 
-        sage: from mjo.eja.eja_algebra import (CartesianProductEJA,
+        sage: from mjo.eja.eja_algebra import (random_eja,
+        ....:                                  CartesianProductEJA,
         ....:                                  HadamardEJA,
         ....:                                  JordanSpinEJA,
         ....:                                  RealSymmetricEJA)
@@ -2740,6 +2741,19 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
         ...
         ValueError: all factors must share the same base field
 
+    The "cached" Jordan and inner products are the componentwise
+    ones::
+
+        sage: set_random_seed()
+        sage: J1 = random_eja()
+        sage: J2 = random_eja()
+        sage: J = cartesian_product([J1,J2])
+        sage: x,y = J.random_elements(2)
+        sage: x*y == J.cartesian_jordan_product(x,y)
+        True
+        sage: x.inner_product(y) == J.cartesian_inner_product(x,y)
+        True
+
     """
     def __init__(self, modules, **kwargs):
         CombinatorialFreeModule_CartesianProduct.__init__(self,
@@ -2762,6 +2776,13 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
             y = self.from_vector(_mat2vec(y_mat))
             return self.cartesian_inner_product(x,y)
 
+        # Use whatever category the superclass came up with. Usually
+        # some join of the EJA and Cartesian product
+        # categories. There's no need to check the field since it
+        # already came from an EJA.
+        #
+        # If you want the basis to be orthonormalized, orthonormalize
+        # the factors.
         FiniteDimensionalEJA.__init__(self,
                                       basis,
                                       jordan_product,
@@ -2771,16 +2792,6 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
                                       check_field=False,
                                       check_axioms=False,
                                       category=self.category())
-        # TODO:
-        #
-        # Initialize the FDEJA class, too. Does this override the
-        # initialization that we did for the
-        # CombinatorialFreeModule_CartesianProduct class? If not, we
-        # will probably have to duplicate some of the work (i.e. one
-        # of the constructors).  Since the CartesianProduct one is
-        # smaller, that makes the most sense to copy/paste if it comes
-        # down to that.
-        #
 
         self.rank.set_cache(sum(J.rank() for J in modules))