]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add DirectSumEJA constructor (and not much else).
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 8 Nov 2020 22:54:16 +0000 (17:54 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 8 Nov 2020 22:54:16 +0000 (17:54 -0500)
mjo/eja/all.py
mjo/eja/eja_algebra.py

index a3b524b509646ae3d0f482fa5f77abe407b3418a..c7d02a2990f4498a80fedde93f18e66438d97a2a 100644 (file)
@@ -4,6 +4,7 @@ All imports from mjo.eja modules.
 
 from mjo.eja.eja_algebra import (BilinearFormEJA,
                                  ComplexHermitianEJA,
+                                 DirectSumEJA,
                                  HadamardEJA,
                                  JordanSpinEJA,
                                  QuaternionHermitianEJA,
index 7ae61d513d53246f588a9610f20c5acb105d069b..f327bf51aada40b33fd05fb0d1c38c124d4b545e 100644 (file)
@@ -2134,3 +2134,50 @@ class TrivialEJA(FiniteDimensionalEuclideanJordanAlgebra):
         # largest subalgebra generated by any element.
         fdeja.__init__(field, mult_table, **kwargs)
         self.rank.set_cache(0)
+
+
+class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra):
+    r"""
+    The external (orthogonal) direct sum of two other Euclidean Jordan
+    algebras. Essentially the Cartesian product of its two factors.
+    Every Euclidean Jordan algebra decomposes into an orthogonal
+    direct sum of simple Euclidean Jordan algebras, so no generality
+    is lost by providing only this construction.
+
+    SETUP::
+
+        sage: from mjo.eja.eja_algebra import (HadamardEJA,
+        ....:                                  RealSymmetricEJA,
+        ....:                                  DirectSumEJA)
+
+    EXAMPLES::
+
+        sage: J1 = HadamardEJA(2)
+        sage: J2 = RealSymmetricEJA(3)
+        sage: J = DirectSumEJA(J1,J2)
+        sage: J.dimension()
+        8
+        sage: J.rank()
+        5
+
+    """
+    def __init__(self, J1, J2, field=AA, **kwargs):
+        n1 = J1.dimension()
+        n2 = J2.dimension()
+        n = n1+n2
+        V = VectorSpace(field, n)
+        mult_table = [ [ V.zero() for j in range(n) ]
+                       for i in range(n) ]
+        for i in range(n1):
+            for j in range(n1):
+                p = (J1.monomial(i)*J1.monomial(j)).to_vector()
+                mult_table[i][j] = V(p.list() + [field.zero()]*n2)
+
+        for i in range(n2):
+            for j in range(n2):
+                p = (J2.monomial(i)*J2.monomial(j)).to_vector()
+                mult_table[n1+i][n1+j] = V([field.zero()]*n1 + p.list())
+
+        fdeja = super(DirectSumEJA, self)
+        fdeja.__init__(field, mult_table, **kwargs)
+        self.rank.set_cache(J1.rank() + J2.rank())