# long run to have the multiplication table be in terms of
# algebra elements. We do this after calling the superclass
# constructor so that from_vector() knows what to do.
- self._multiplication_table = [
- list(map(lambda x: self.from_vector(x), ls))
- for ls in mult_table
- ]
+ self._multiplication_table = [ [ self.vector_space().zero()
+ for i in range(n) ]
+ for j in range(n) ]
+ # take advantage of symmetry
+ for i in range(n):
+ for j in range(n):
+ elt = self.from_vector(mult_table[i][j])
+ self._multiplication_table[i][j] = elt
+ self._multiplication_table[j][i] = elt
if check_axioms:
if not self._is_commutative():
return superclass._charpoly_coefficients()
mult_table = tuple(
- map(lambda x: x.to_vector(), ls)
+ tuple(map(lambda x: x.to_vector(), ls))
for ls in self._multiplication_table
)