Skip to content

Commit

Permalink
feat: enumerate fields with given conductors (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Feb 22, 2024
1 parent 6d91263 commit 320cf85
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/FieldFactory/ab_exts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,39 @@ function abelian_extensions(O::Union{ZZRing, QQField},
return l
end

function abelian_extensions(gtype::Vector{Int}, conds::Vector{Int}; only_real::Bool = false)
K = rationals_as_number_field()[1]
O = maximal_order(K)
gtype = map(Int, snf(abelian_group(gtype))[1].snf)
n = prod(gtype)

#Getting conductors
@vprintln :AbExt 1 "Number of conductors: $(length(conds))"
fields = ClassField{MapRayClassGrp, FinGenAbGroupHom}[]

#Now, the big loop
fun = (x, y) -> quo(x, y, false)[2]
for (i, k) in enumerate(conds)
@vprintln :AbExt 1 "Conductor: $k"
if i % 10000 == 0
@vprintln :AbExt 1 "Left: $(length(conds) - i)"
end
r, mr = Hecke.ray_class_groupQQ(O, k, !only_real, gtype[end])
if !has_quotient(r, gtype)
continue
end
ls = subgroups(r, quotype = gtype, fun = fun)
for s in ls
C = ray_class_field(mr, s)
if Hecke._is_conductor_minQQ(C, n)
@vprintln :AbExt 1 "New Field"
push!(fields, C)
end
end
end
return fields
end

function abelian_extensions(gtype::Vector{Int}, conds::Vector{Int}, absolute_discriminant_bound::ZZRingElem; only_real::Bool = false)
K = rationals_as_number_field()[1]
O = maximal_order(K)
Expand Down
7 changes: 7 additions & 0 deletions test/RCF/rcf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,10 @@ end
I = Hecke.lorenz_module(k, 12)
@test Hecke.is_consistent(I)
end

@testset "Enumerate by conductor" begin
l = abelian_extensions([3], collect(1:10^3); only_real = true)
@test length(l) == 159
l = abelian_extensions([2], collect(1:10^3))
@test length(l) == 607
end

0 comments on commit 320cf85

Please sign in to comment.