From: Michael Orlitzky Date: Tue, 8 Dec 2020 15:43:38 +0000 (-0500) Subject: eja: default to the identity IP matrix when orthonormalizing. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=sage.d.git;a=commitdiff_plain;h=82b8e49f8f8fae889a64c40139abcbaef71101af eja: default to the identity IP matrix when orthonormalizing. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 34f8801..9e808ae 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -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()