Skip to content

Commit 83f49f5

Browse files
authored
feat: add C2xC2 extension with given discriminant (#1712)
1 parent 7344274 commit 83f49f5

File tree

2 files changed

+67
-3
lines changed

2 files changed

+67
-3
lines changed

src/FieldFactory/ab_exts.jl

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,16 +625,13 @@ end
625625
###############################################################################
626626

627627
function C22_extensions(bound::Int)
628-
629-
630628
Qx, x=polynomial_ring(ZZ, "x")
631629
K, _=number_field(x-1, cached = false)
632630
Kx,x=polynomial_ring(K,"x", cached=false)
633631
b1=ceil(Int,Base.sqrt(bound))
634632
n=2*b1+1
635633
pairs = _find_pairs(bound)
636634
return (_ext(Kx,x,i,j) for (i, j) in pairs)
637-
638635
end
639636

640637
function _ext(Ox,x,i,j)
@@ -868,7 +865,66 @@ function _find_pairs(bound::Int, only_real::Bool = false; unramified_outside::Ve
868865
return vcat(res, real_exts)
869866
end
870867

868+
# Compute C2xC2 extensions of Q with given discriminant
869+
# The criterion for the discriminant is from
870+
# "On the density of discriminants of quartic fields", Baily
871+
function C22_extensions_with_given_disc(d::Int; only_real = false)
872+
res = AbsSimpleNumField[]
873+
if d < 2
874+
return res
875+
end
876+
877+
e, n = remove(d, 2)
878+
879+
if !(e in [0, 4, 6, 8])
880+
return res
881+
end
882+
883+
fl, m = is_square_with_sqrt(n)
884+
885+
if !is_squarefree(m)
886+
return res
887+
end
888+
889+
if !fl
890+
return res
891+
end
892+
893+
wm = length(prime_divisors(m))
871894

895+
if e == 0
896+
nu = divexact(3^(wm - 1) - 1, 2)
897+
elseif e == 4
898+
nu = divexact(3^wm - 1, 2)
899+
elseif e == 6
900+
nu = 3^wm - 1
901+
else
902+
@assert e == 8
903+
nu = 3^wm
904+
end
905+
906+
# d is the discriminant, and a multiple of the conductor
907+
K, = rationals_as_number_field()
908+
O = maximal_order(K)
909+
910+
r, mr = ray_class_groupQQ(O, Int(d), !only_real, 2)
911+
if !has_quotient(r, [2, 2])
912+
return res
913+
end
914+
fun = (x, y) -> quo(x, y, false)[2]
915+
ls = subgroups(r, quotype = [2, 2], fun = fun)
916+
for s in ls
917+
C = ray_class_field(mr, s)
918+
_d = discriminantQQ(O, C, d)
919+
if _d == d
920+
push!(res, absolute_simple_field(number_field(C); simplify = true, cached = false)[1])
921+
end
922+
if !only_real && length(res) == nu
923+
return res
924+
end
925+
end
926+
return res
927+
end
872928

873929
function _from_relative_to_abs(L::RelNonSimpleNumField{T}, auts::Vector{<: NumFieldHom{RelNonSimpleNumField{T}, RelNonSimpleNumField{T}}}) where T
874930

test/FieldFactory/FieldFactory.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,12 @@
208208
k, _ = number_field(x^4-11*x^2+9)
209209
L = abelian_extensions(k, [3], ZZRingElem(10)^16)
210210
@test length(L) == 2
211+
212+
let
213+
l = Hecke.C22_extensions_with_given_disc(7056)
214+
flds = first.(number_field.(Hecke.Globals.Qx.([[1, 0, -5, 0, 1], [25, 0, 11, 0, 1], [22, 2, -1, -2, 1], [49, 0, 7, 0, 1]])))
215+
@test all(x -> any(y -> is_isomorphic(x, y), flds), l)
216+
l = Hecke.C22_extensions_with_given_disc(7056; only_real = true)
217+
@test length(l) == 1 && is_isomorphic(l[1], flds[1])
218+
end
211219
end

0 commit comments

Comments
 (0)