]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix cartesian_factors() for EJA elements.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 13 Mar 2021 20:49:32 +0000 (15:49 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 13 Mar 2021 20:49:32 +0000 (15:49 -0500)
mjo/eja/TODO
mjo/eja/eja_algebra.py

index 38cff88c1584b5be8c6a6ce7e90a47b8350adce3..421e0e9450bd18bab8fc5b9f0c75c738df099080 100644 (file)
@@ -6,3 +6,5 @@
    could easily cache the identity and charpoly coefficients using
    the nontrivial factor. On the other hand, it's nice that we can
    test out some alternate code paths...
+
+4. Conjecture: if x = (x1,x2), then det(x) = det(x1)det(x2).
index d02b55836c3b47608120f9d72f5cab91d2d04ed4..907f40d72135df42d211cdd9bb8923df6bf462e6 100644 (file)
@@ -3192,6 +3192,34 @@ class CartesianProductEJA(FiniteDimensionalEJA):
         ones = tuple(J.one().to_matrix() for J in factors)
         self.one.set_cache(self(ones))
 
+    def _sets_keys(self):
+        r"""
+
+        SETUP::
+
+            sage: from mjo.eja.eja_algebra import (ComplexHermitianEJA,
+            ....:                                  RealSymmetricEJA)
+
+        TESTS:
+
+        The superclass uses ``_sets_keys()`` to implement its
+        ``cartesian_factors()`` method::
+
+            sage: J1 = RealSymmetricEJA(2,
+            ....:                       field=QQ,
+            ....:                       orthonormalize=False,
+            ....:                       prefix="a")
+            sage: J2 = ComplexHermitianEJA(2,field=QQ,orthonormalize=False)
+            sage: J = cartesian_product([J1,J2])
+            sage: x = sum(i*J.gens()[i] for i in range(len(J.gens())))
+            sage: x.cartesian_factors()
+            (a1 + 2*a2, 3*b0 + 4*b1 + 5*b2 + 6*b3)
+
+        """
+        # Copy/pasted from CombinatorialFreeModule_CartesianProduct,
+        # but returning a tuple instead of a list.
+        return tuple(range(len(self.cartesian_factors())))
+
     def cartesian_factors(self):
         # Copy/pasted from CombinatorialFreeModule_CartesianProduct.
         return self._sets