From abb8fd98056e38970928371e3d81e8755738efba Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Thu, 21 Sep 2023 05:41:36 +0200 Subject: [PATCH] Fix automorphism group of non-simple field --- src/Map/automorphisms.jl | 4 ++-- test/NumField/NfAbs/NfAbs.jl | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Map/automorphisms.jl b/src/Map/automorphisms.jl index 07bd180f77..d8d550fba7 100644 --- a/src/Map/automorphisms.jl +++ b/src/Map/automorphisms.jl @@ -10,7 +10,7 @@ export absolute_automorphism_list, absolute_automorphism_group function _automorphisms(K::NfAbsNS; is_abelian::Bool = false) - pols = QQPolyRingElem[is_univariate(x)[2] for x in K.pol] + pols = QQPolyRingElem[to_univariate(Globals.Qx, x) for x in K.pol] rt = Vector{Vector{NfAbsNSElem}}(undef, length(pols)) for i = 1:length(pols) rt[i] = roots(K, pols[i]) @@ -19,7 +19,7 @@ function _automorphisms(K::NfAbsNS; is_abelian::Bool = false) ind = 1 I = cartesian_product_iterator([1:length(x) for x in rt], inplace = true) for i in I - auts[ind] = hom(K, K, elem_type(K)[rt[i[j]] for j = 1:length(pols)]) + auts[ind] = hom(K, K, elem_type(K)[rt[j][i[j]] for j = 1:length(pols)]) ind += 1 end return auts diff --git a/test/NumField/NfAbs/NfAbs.jl b/test/NumField/NfAbs/NfAbs.jl index d4cc4a8af3..7d6248e073 100644 --- a/test/NumField/NfAbs/NfAbs.jl +++ b/test/NumField/NfAbs/NfAbs.jl @@ -66,3 +66,13 @@ end K, a = number_field(f) @test length(factor(K, f).fac) == 4 end + +@testset "automorphisms" begin + Qx, x = QQ["x"] + K, a = number_field([x^2 - 2, x^2 - 3], "a", cached = false) + @test is_normal(K) + @test length(automorphism_list(K)) == 4 + K, a = number_field([x^2 - 2, x^3 - 2], "a", cached = false) + @test !is_normal(K) + @test length(automorphism_list(K)) == 2 +end