]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: switch "category" argument to "cartesian_product" in FDEJA.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 24 Feb 2021 01:10:09 +0000 (20:10 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 24 Feb 2021 01:10:09 +0000 (20:10 -0500)
This constructor is going to need a bunch of special cases for
cartesian products, and this simplifies things (we don't have to infer
whether or not we have a cartesian product from the category).

mjo/eja/eja_algebra.py

index a8df29f6e94161016217a9e13f6c1cc73c30354e..d23ae2cf93e91bdd7998fe8852c3b936e577b222 100644 (file)
@@ -42,7 +42,15 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
 
     INPUT:
 
-      - basis -- a tuple of basis elements in their matrix form.
+      - basis -- a tuple of basis elements in "matrix form," which
+        must be the same form as the arguments to ``jordan_product``
+        and ``inner_product``. In reality, "matrix form" can be either
+        vectors, matrices, or a Cartesian product (ordered tuple)
+        of vectors or matrices. All of these would ideally be vector
+        spaces in sage with no special-casing needed; but in reality
+        we turn vectors into column-matrices and Cartesian products
+        `(a,b)` into column matrices `(a,b)^{T}` after converting
+        `a` and `b` themselves.
 
       - jordan_product -- function of two elements (in matrix form)
         that returns their jordan product in this algebra; this will
@@ -63,10 +71,10 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
                  field=AA,
                  orthonormalize=True,
                  associative=False,
+                 cartesian_product=False,
                  check_field=True,
                  check_axioms=True,
-                 prefix='e',
-                 category=None):
+                 prefix='e'):
 
         if check_field:
             if not field.is_subring(RR):
@@ -95,12 +103,13 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
                 raise ValueError("inner-product is not commutative")
 
 
-        if category is None:
-            category = MagmaticAlgebras(field).FiniteDimensional()
-            category = category.WithBasis().Unital()
-            if associative:
-                # Element subalgebras can take advantage of this.
-                category = category.Associative()
+        category = MagmaticAlgebras(field).FiniteDimensional()
+        category = category.WithBasis().Unital()
+        if associative:
+            # Element subalgebras can take advantage of this.
+            category = category.Associative()
+        if cartesian_product:
+            category = category.CartesianProducts()
 
         # Call the superclass constructor so that we can use its from_vector()
         # method to build our multiplication table.
@@ -2829,9 +2838,9 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
                                       inner_product,
                                       field=field,
                                       orthonormalize=False,
+                                      cartesian_product=True,
                                       check_field=False,
-                                      check_axioms=False,
-                                      category=self.category())
+                                      check_axioms=False)
 
         ones = tuple(J.one() for J in modules)
         self.one.set_cache(self._cartesian_product_of_elements(ones))