From 0b9c169288849507cadcfea21e58ccd307d30bb9 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Feb 2021 20:10:09 -0500 Subject: [PATCH] eja: switch "category" argument to "cartesian_product" in FDEJA. 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 | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index a8df29f..d23ae2c 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -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)) -- 2.43.2