]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix cartesian products of cartesian product EJAs.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 25 Feb 2021 01:53:15 +0000 (20:53 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 25 Feb 2021 01:53:15 +0000 (20:53 -0500)
mjo/eja/TODO
mjo/eja/eja_algebra.py
mjo/eja/eja_element.py
mjo/eja/eja_utils.py

index bde3e3bb767b5fbcd9bc34971b34cf0abdaeb1dc..93aa9fb42e6ec6cdba6963db8dacfddd116ba762 100644 (file)
@@ -20,6 +20,3 @@ sage: a0 = (1/4)*X[4]**2*X[6]**2 - (1/2)*X[2]*X[5]*X[6]**2 - (1/2)*X[3]*X[4]*X[6
 6. Profile the construction of "large" matrix algebras (like the
    15-dimensional QuaternionHermitianAlgebra(3)) to find out why
    they're so slow.
-
-7. Printing of Cartesian product subalgebrasis wrong (it prints the
-   superalgebra).
index 811850586f21048aba1ed07292eaf51f15350fe1..618e09cf41d58eec7ade00aca846eb9677f468ae 100644 (file)
@@ -3133,9 +3133,3 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct,
 FiniteDimensionalEJA.CartesianProduct = CartesianProductEJA
 
 random_eja = ConcreteEJA.random_instance
-#def random_eja(*args, **kwargs):
-#    from sage.categories.cartesian_product import cartesian_product
-#    J1 = HadamardEJA(1, **kwargs)
-#    J2 = RealSymmetricEJA(2, **kwargs)
-#    J =  cartesian_product([J1,J2])
-#    return J
index 660cbb5c2d98d4135d465533a92ddba84720abdd..876777eff745fb2610dbce5f6856b6fa619a580b 100644 (file)
@@ -1403,7 +1403,20 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement):
 
         SETUP::
 
-            sage: from mjo.eja.eja_algebra import random_eja
+            sage: from mjo.eja.eja_algebra import (random_eja,
+            ....:                                  HadamardEJA,
+            ....:                                  RealSymmetricEJA)
+
+        EXAMPLES:
+
+        We can create subalgebras of Cartesian product EJAs that are not
+        themselves Cartesian product EJAs (they're just "regular" EJAs)::
+
+            sage: J1 = HadamardEJA(3)
+            sage: J2 = RealSymmetricEJA(2)
+            sage: J = cartesian_product([J1,J2])
+            sage: J.one().subalgebra_generated_by()
+            Euclidean Jordan algebra of dimension 1 over Algebraic Real Field
 
         TESTS:
 
index e8ed4db2ea23def442af71402cac98c5f5dfccf6..803ec636520515543c873ecc59669475a0048a3c 100644 (file)
@@ -10,12 +10,10 @@ def _all2list(x):
     if hasattr(x, 'list'):
         # Easy case...
         return x.list()
-    if hasattr(x, 'cartesian_factors'):
-        # If it's a formal cartesian product space element, then
-        # we also know what to do...
-        return sum(( x_i.list() for x_i in x ), [])
     else:
-        # But what if it's a tuple or something else?
+        # But what if it's a tuple or something else? This has to
+        # handle cartesian products of cartesian products, too; that's
+        # why it's recursive.
         return sum( map(_all2list,x), [] )
 
 def _mat2vec(m):