- def __init__(self, n, field=QQ, **kwargs):
- S = _complex_hermitian_basis(n)
+ def __init__(self, n, field=QQ, normalize_basis=True, **kwargs):
+ if n > 1:
+ # We'll need sqrt(2) to normalize the basis, and this
+ # winds up in the multiplication table, so the whole
+ # algebra needs to be over the field extension.
+ R = PolynomialRing(field, 'z')
+ z = R.gen()
+ p = z**2 - 2
+ if p.is_irreducible():
+ field = NumberField(p, 'sqrt2', embedding=RLF(2).sqrt())
+
+ S = _complex_hermitian_basis(n, field, normalize_basis)