+ if orthonormalize:
+ # Compute the deorthonormalized tables before we orthonormalize
+ # the given basis.
+ W = V.span_of_basis( vector_basis )
+
+ # TODO: use symmetry
+ self._deortho_multiplication_table = [ [0 for j in range(n)]
+ for i in range(n) ]
+ self._deortho_inner_product_table = [ [0 for j in range(n)]
+ for i in range(n) ]
+
+ # Note: the Jordan and inner-products are defined in terms
+ # of the ambient basis. It's important that their arguments
+ # are in ambient coordinates as well.
+ for i in range(n):
+ for j in range(i+1):
+ # given basis w.r.t. ambient coords
+ q_i = vector_basis[i]
+ q_j = vector_basis[j]
+
+ if basis_is_matrices:
+ q_i = _vec2mat(q_i)
+ q_j = _vec2mat(q_j)
+
+ elt = jordan_product(q_i, q_j)
+ ip = inner_product(q_i, q_j)
+
+ if basis_is_matrices:
+ # do another mat2vec because the multiplication
+ # table is in terms of vectors
+ elt = _mat2vec(elt)
+
+ # TODO: use symmetry
+ elt = W.coordinate_vector(elt)
+ self._deortho_multiplication_table[i][j] = elt
+ self._deortho_multiplication_table[j][i] = elt
+ self._deortho_inner_product_table[i][j] = ip
+ self._deortho_inner_product_table[j][i] = ip
+
+ if self._deortho_multiplication_table is not None:
+ self._deortho_multiplication_table = tuple(map(tuple, self._deortho_multiplication_table))
+ if self._deortho_inner_product_table is not None:
+ self._deortho_inner_product_table = tuple(map(tuple, self._deortho_inner_product_table))
+