]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: default to the identity IP matrix when orthonormalizing.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 8 Dec 2020 15:43:38 +0000 (10:43 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 8 Dec 2020 15:43:38 +0000 (10:43 -0500)
mjo/eja/eja_algebra.py

index 34f88010cd31eb8d5cba9446d6dd6ffd2f5a2eaf..9e808ae1cb1c6ec41ca59136c8a6787fd589e61c 100644 (file)
@@ -158,7 +158,7 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
 
         # Now we actually compute the multiplication and inner-product
         # tables/matrices using the possibly-orthonormalized basis.
-        self._inner_product_matrix = matrix.zero(field, n)
+        self._inner_product_matrix = matrix.identity(field, n)
         self._multiplication_table = [ [0 for j in range(i+1)]
                                        for i in range(n) ]
 
@@ -171,15 +171,20 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
                 q_i = basis[i]
                 q_j = basis[j]
 
-                elt = jordan_product(q_i, q_j)
-                ip = inner_product(q_i, q_j)
-
                 # The jordan product returns a matrixy answer, so we
                 # have to convert it to the algebra coordinates.
+                elt = jordan_product(q_i, q_j)
                 elt = W.coordinate_vector(V(elt.list()))
                 self._multiplication_table[i][j] = self.from_vector(elt)
-                self._inner_product_matrix[i,j] = ip
-                self._inner_product_matrix[j,i] = ip
+
+                if not orthonormalize:
+                    # If we're orthonormalizing the basis with respect
+                    # to an inner-product, then the inner-product
+                    # matrix with respect to the resulting basis is
+                    # just going to be the identity.
+                    ip = inner_product(q_i, q_j)
+                    self._inner_product_matrix[i,j] = ip
+                    self._inner_product_matrix[j,i] = ip
 
         self._inner_product_matrix._cache = {'hermitian': True}
         self._inner_product_matrix.set_immutable()