S = [ vec2mat(b) for b in W.basis() ]
Qs = []
- for s in basis:
+ for s in S:
# Brute force the multiplication-by-s matrix by looping
# through all elements of the basis and doing the computation
# to find out what the corresponding row should be. BEWARE:
# constructor uses ROW vectors and not COLUMN vectors. That's
# why we're computing rows here and not columns.
Q_rows = []
- for t in basis:
+ for t in S:
this_row = mat2vec((s*t + t*s)/2)
Q_rows.append(W.coordinates(this_row))
Q = matrix(field,Q_rows)