]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: begin adding OctonionHermitianEJA.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 13:40:16 +0000 (08:40 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 13:40:16 +0000 (08:40 -0500)
mjo/eja/TODO
mjo/eja/all.py
mjo/eja/eja_algebra.py

index 13b00ac6a3056eaf623ac5c2905be6c7d049706c..2d93ffb38a772f9409ecdff4153e975cb7c02c0b 100644 (file)
@@ -19,7 +19,8 @@ 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. Instead of storing a basis multiplication matrix, just make
    product_on_basis() a cached method and manually cache its
    entries. The cython cached method lookup should be faster than a
-   python-based matrix lookup anyway.
+   python-based matrix lookup anyway. NOTE: we should still be able
+   to recompute the table somehow. Is this worth it?
 
 7. What the ever-loving fuck is this shit?
 
index a3b524b509646ae3d0f482fa5f77abe407b3418a..f5ef5c9d9533082f1cebf36492211d3592baba2c 100644 (file)
@@ -6,6 +6,7 @@ from mjo.eja.eja_algebra import (BilinearFormEJA,
                                  ComplexHermitianEJA,
                                  HadamardEJA,
                                  JordanSpinEJA,
+                                 OctonionHermitianEJA,
                                  QuaternionHermitianEJA,
                                  RealSymmetricEJA,
                                  TrivialEJA,
index 5bf597565b2ae292032c3f0a532763d7889cd2a8..e16fd97c4f0e55591728dc8204da3d941529380c 100644 (file)
@@ -2585,6 +2585,67 @@ class QuaternionHermitianEJA(ConcreteEJA, QuaternionMatrixEJA):
         n = ZZ.random_element(cls._max_random_instance_size() + 1)
         return cls(n, **kwargs)
 
+class OctonionHermitianEJA(FiniteDimensionalEJA, MatrixEJA):
+
+    def __init__(self, n, field=AA, **kwargs):
+        if n > 3:
+            # Otherwise we don't get an EJA.
+            raise ValueError("n cannot exceed 3")
+
+        # We know this is a valid EJA, but will double-check
+        # if the user passes check_axioms=True.
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
+        super().__init__(self._denormalized_basis(n,field),
+                         self.jordan_product,
+                         self.trace_inner_product,
+                         **kwargs)
+
+        # TODO: this could be factored out somehow, but is left here
+        # because the MatrixEJA is not presently a subclass of the
+        # FDEJA class that defines rank() and one().
+        self.rank.set_cache(n)
+        idV = self.matrix_space().one()
+        self.one.set_cache(self(idV))
+
+
+    @classmethod
+    def _denormalized_basis(cls, n, field):
+        """
+        Returns a basis for the space of octonion Hermitian n-by-n
+        matrices.
+
+        SETUP::
+
+            sage: from mjo.eja.eja_algebra import OctonionHermitianEJA
+
+        EXAMPLES::
+
+            sage: B = OctonionHermitianEJA._denormalized_basis(3)
+            sage: all( M.is_hermitian() for M in B )
+            True
+            sage: len(B)
+            27
+
+        """
+        from mjo.octonions import OctonionMatrixAlgebra
+        MS = OctonionMatrixAlgebra(n, field=field)
+        es = MS.entry_algebra().gens()
+
+        basis = []
+        for i in range(n):
+            for j in range(i+1):
+                if i == j:
+                    E_ii = MS.monomial( (i,j,es[0]) )
+                    basis.append(E_ii)
+                else:
+                    for e in es:
+                        E_ij  = MS.monomial( (i,j,e)             )
+                        E_ij += MS.monomial( (j,i,e.conjugate()) )
+                        basis.append(E_ij)
+
+        return tuple( basis )
+
 
 class HadamardEJA(ConcreteEJA):
     """