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()
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()