1 | initial version |
Here you go:
m = 5
Zm = Zmod(m)
L = [Zm(1), Zm(-1)]
K.<z> = CyclotomicField(m)
power_basis = [z^k for k in range(m)]
gens_powers = [Zm(power_basis.index(sigma(z))) for sigma in K.galois_group().gens()]
gens_powers_logs = matrix(ZZ, [e.generalised_log() for e in gens_powers]).transpose()
L_logs = [vector(ZZ, t.generalised_log()) for t in L]
L_exponents = [list(gens_powers_logs.solve_right(s).change_ring(ZZ)) for s in L_logs]
G_gens = [prod(sigma^k for (sigma,k) in zip(K.galois_group().gens(), L_exponent)) for L_exponent in L_exponents]
G = K.galois_group().subgroup(G_gens)
G.fixed_field()
To check that the group G
is correct, you can evaluate [power_basis.index(g(z)) for g in G]
.
The part with solve_right
should be improved, because we only want integer solutions.
2 | No.2 Revision |
Here you go:
m = 5
Zm = Zmod(m)
L = [Zm(1), Zm(-1)]
K.<z> = CyclotomicField(m)
power_basis power_list = [z^k for k in range(m)]
gens_powers = [Zm(power_basis.index(sigma(z))) [Zm(power_list.index(sigma(z))) for sigma in K.galois_group().gens()]
gens_powers_logs = matrix(ZZ, [e.generalised_log() for e in gens_powers]).transpose()
L_logs = [vector(ZZ, t.generalised_log()) for t in L]
L_exponents = [list(gens_powers_logs.solve_right(s).change_ring(ZZ)) for s in L_logs]
G_gens = [prod(sigma^k for (sigma,k) in zip(K.galois_group().gens(), L_exponent)) for L_exponent in L_exponents]
G = K.galois_group().subgroup(G_gens)
G.fixed_field()
To check that the group G
is correct, you can evaluate
.[power_basis.index(g(z)) [power_list.index(g(z)) for g in G]
The part with solve_right
should be improved, because we only want integer solutions.