R. = QQ['t'] f = t^5-5*t+12 F. = CyclotomicField(5) L. = F.extension(t^2-10*t+1025) L0. = L.absolute_field() (from_L0, to_L0) = L0.structure() K. = L0.extension(f) K0. = K.absolute_field() (from_K0, to_K0) = K0.structure() tmproots = [x for (x,_) in f.change_ring(K0).roots()] g = R(prod([t-(tmproots[i]+tmproots[j]) for i in range(5) for j in range(i)])) # g.factor() g1 = t^5 - 5*t^3 - 10*t^2 + 30*t - 36 reorder = [[i for i in range(5) if tmproots[i] == to_K0(v)][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] if sum([tmproots[reorder[i]]*tmproots[reorder[(i+1)%5]]^3 for i in range(5)]) != to_K0(to_L0(u)): reorder = [reorder[i] for i in [0,4,3,2,1]] roots = [tmproots[i] for i in reorder] tmpzeta1 = to_K0(to_L0(zeta)) tmpzeta = [tmpzeta1^i for i in range(5)] alpha = [sum(roots[i]*tmpzeta[(i*j)%5] for i in range(5)) for j in range(5)] alpha5 = [from_K0(alpha[i]^5).vector()[0] for i in range(5)] sqrt5 = 1+2*(zeta+zeta^-1) sqrtm10m2sqrt5 = 2*(zeta-zeta^-1) sqrtm10p2sqrt5 = 2*(zeta^2-zeta^-2) sqrtm10 = -1/2 + u/10 sqrtm2 = sqrt5*sqrtm10/5 sqrt25p5sqrt5 = -sqrtm10 * sqrtm10m2sqrt5 / 2 sqrt25m5sqrt5 = -sqrtm10 * sqrtm10p2sqrt5 / 2 nice_basis = [to_L0(x) for x in [1, sqrt5, sqrtm10m2sqrt5, sqrtm10p2sqrt5, sqrtm10, sqrtm2, sqrt25p5sqrt5, sqrt25m5sqrt5]] m = Matrix(QQ, 8, 8, [(QQ^8)((x0.coordinates_in_terms_of_powers())(x)) for x in nice_basis]) minv = m.inverse() alpha5_on_x0_basis = [(QQ^8)((x0.coordinates_in_terms_of_powers())(x)) for x in alpha5] alpha5_on_nice_basis = [v * m.inverse() for v in alpha5_on_x0_basis] tmproots = [x for (x,_) in f.change_ring(QQbar).roots()] reorder = [0] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] reorder += [[i for i in range(5) if g1(tmproots[reorder[len(reorder)-1]] + tmproots[i]) == 0 and not i in reorder][0]] if sum([tmproots[reorder[i]]*tmproots[reorder[(i+1)%5]]^3 for i in range(5)]) != QQbar(5+10*sqrt(-10)): reorder = [reorder[i] for i in [0,4,3,2,1]] rootsQQbar = [tmproots[i] for i in reorder] symbolic_basis = [1, sqrt(5), sqrt(-10-2*sqrt(5)), sqrt(-10+2*sqrt(5)), sqrt(-10), sqrt(-2), sqrt(25+5*sqrt(5)), sqrt(25-5*sqrt(5))] symbolic_alpha5 = [sum([alpha5_on_nice_basis[i][j]*symbolic_basis[j] for j in range(8)]) for i in range(5)] zetaQQbar = QQbar(exp(2*I*pi/5)) alphaQQbar = [sum(rootsQQbar[i]*zetaQQbar^((i*j)%5) for i in range(5)) for j in range(5)] zetab = [0]+[ZZ(floor(arg(CC(alphaQQbar[i]/QQbar(symbolic_alpha5[i]^(1/5))))/N(2*pi/5)+0.5)) for i in range(1,5)] symbolic_zetapow = [1, (-symbolic_basis[0]+symbolic_basis[1]+symbolic_basis[2])/4, (-symbolic_basis[0]-symbolic_basis[1]+symbolic_basis[3])/4, (-symbolic_basis[0]-symbolic_basis[1]-symbolic_basis[3])/4, (-symbolic_basis[0]+symbolic_basis[1]-symbolic_basis[2])/4] symbolic_alpha = [symbolic_zetapow[zetab[i]]*symbolic_alpha5[i]^(1/5) for i in range(5)] symbolic_roots = [sum([symbolic_zetapow[(zetab[i]+4*i*j)%5]*symbolic_alpha5[i]^(1/5) for i in range(5)])/5 for j in range(5)]