- # The superclass constructor takes a list of matrices, the ith
- # representing right multiplication by the ith basis element
- # in the vector space. So if e_1 = (1,0,0), then right
- # (Hadamard) multiplication of x by e_1 picks out the first
- # component of x; and likewise for the ith basis element e_i.
- Qs = [ matrix(field, n, n, lambda k,j: 1*(k == j == i))
- for i in xrange(n) ]
+ V = VectorSpace(field, n)
+ mult_table = [ [ V.basis()[i]*(i == j) for i in range(n) ]
+ for j in range(n) ]