]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix the basis for the octonion matrix algebra.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 16:27:28 +0000 (11:27 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 16:27:28 +0000 (11:27 -0500)
mjo/eja/eja_algebra.py

index d7010bcfd63ff838c0219dc7208a9b8e1988c889..18138f4c2a8ca4fad76b79de29d0e64e09a6435f 100644 (file)
@@ -2641,7 +2641,13 @@ class OctonionHermitianEJA(FiniteDimensionalEJA, MatrixEJA):
                 else:
                     for e in es:
                         E_ij  = MS.monomial( (i,j,e)             )
-                        E_ij += MS.monomial( (j,i,e.conjugate()) )
+                        ec = e.conjugate()
+                        # If the conjugate has a negative sign in front
+                        # of it, (j,i,ec) won't be a monomial!
+                        if (j,i,ec) in MS.indices():
+                            E_ij += MS.monomial( (j,i,ec) )
+                        else:
+                            E_ij -= MS.monomial( (j,i,-ec) )
                         basis.append(E_ij)
 
         return tuple( basis )