]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
Revert "eja: factor out a separate class used by cartesian_product()."
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 21 Feb 2021 22:53:01 +0000 (17:53 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 21 Feb 2021 22:53:01 +0000 (17:53 -0500)
This reverts commit 858aa3653fd2e4ae8573f472cf3f0d698072c185.

mjo/eja/all.py
mjo/eja/eja_algebra.py

index 051bd48224f1a68841d4d7d643d3111e73eee970..a3b524b509646ae3d0f482fa5f77abe407b3418a 100644 (file)
@@ -3,7 +3,6 @@ All imports from mjo.eja modules.
 """
 
 from mjo.eja.eja_algebra import (BilinearFormEJA,
-                                 CartesianProductEJA,
                                  ComplexHermitianEJA,
                                  HadamardEJA,
                                  JordanSpinEJA,
index 1302ca18bf9988f57048cdd9035e79212aa7ca3d..55b8207ddc3f881e8d98f245bf0275bc4b947334 100644 (file)
@@ -2742,7 +2742,9 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
 
     """
     def __init__(self, modules, **kwargs):
-        CombinatorialFreeModule_CartesianProduct.__init__(self, modules)
+        CombinatorialFreeModule_CartesianProduct.__init__(self,
+                                                          modules,
+                                                          **kwargs)
         field = modules[0].base_ring()
         if not all( J.base_ring() == field for J in modules ):
             raise ValueError("all factors must share the same base field")
@@ -2764,16 +2766,33 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
         # some join of the EJA and Cartesian product
         # categories. There's no need to check the field since it
         # already came from an EJA. Likewise the axioms are guaranteed
-        # to be satisfied.
+        # to be satisfied. We can't orthonormalize by default because
+        # there's no way to pass "orthonormalize=False" to
+        # cartesian_product(...) when the base ring is QQ and
+        # orthonormalizing would give us irrational entries.
+        #
+        # TODO: create a separate constructor that is capable of
+        # orthonormalizing and is only used by the cartesian_product()
+        # thingy.
         FiniteDimensionalEJA.__init__(self,
                                       basis,
                                       jordan_product,
                                       inner_product,
                                       field=field,
+                                      orthonormalize=False,
                                       check_field=False,
                                       check_axioms=False,
-                                      category=self.category(),
-                                      **kwargs)
+                                      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))
 
@@ -3040,23 +3059,5 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
     Element = FiniteDimensionalEJAElement
 
 
-class FiniteDimensionalEJA_CartesianProduct(CartesianProductEJA):
-    r"""
-    A wrapper around the :class:`CartesianProductEJA` class that gets
-    used by the ``cartesian_product`` functor. Its one job is to set
-    ``orthonormalize=False``, since ``cartesian_product()`` can't be
-    made to pass that option through. And if we try to orthonormalize
-    over the rationals, we get conversion errors. If you want a non-
-    standard Jordan product or inner product, or if you want to
-    orthonormalize the basis, use :class:`CartesianProductEJA`
-    directly.
-    """
-    def __init__(self, modules, **options):
-        CombinatorialFreeModule_CartesianProduct.__init__(self,
-                                                          modules,
-                                                          **options)
-        CartesianProductEJA.__init__(self, modules, orthonormalize=False)
-
-
-FiniteDimensionalEJA.CartesianProduct = FiniteDimensionalEJA_CartesianProduct
+FiniteDimensionalEJA.CartesianProduct = CartesianProductEJA
 random_eja = ConcreteEJA.random_instance