diff --git a/src/NumberTheory/NmbThy.jl b/src/NumberTheory/NmbThy.jl index 7f8921b85823..badcf4297192 100644 --- a/src/NumberTheory/NmbThy.jl +++ b/src/NumberTheory/NmbThy.jl @@ -129,7 +129,7 @@ norm_equation(R::AbsNumFieldOrder, k::Base.Integer; abs::Bool = false) = norm_eq function norm_equation_fac_elem(R::Hecke.RelNumFieldOrder{AbsSimpleNumFieldElem,Hecke.AbsSimpleNumFieldOrderFractionalIdeal}, a::AbsNumFieldOrderElem{AbsSimpleNumField,AbsSimpleNumFieldElem}) @assert Hecke.is_maximal(R) - Ka, mKa, mkK = absolute_field(Hecke.nf(R)) + Ka, mKa, mkK = Hecke.absolute_field(Hecke.nf(R)) Ra = maximal_order(Ka) class_group(Ra) k = Hecke.nf(parent(a)) diff --git a/test/NumberTheory/nmbthy.jl b/test/NumberTheory/nmbthy.jl index f4e628df5ccc..8783aa38596a 100644 --- a/test/NumberTheory/nmbthy.jl +++ b/test/NumberTheory/nmbthy.jl @@ -4,7 +4,8 @@ using Test function evalu(x::Fac) return x.unit * prod(p*k for (p,k) = x.fac) end -@testset "Polymake.factorizations" begin + +@testset "factorizations" begin k, a = quadratic_field(-5) zk = maximal_order(k) f = factorizations(zk(6)) @@ -12,7 +13,7 @@ end @test all(x -> evalu(x) == 6, f) end -@testset "Polymake.norm_equation" begin +@testset "norm_equation.absolute" begin k, a = wildanger_field(3, 13) zk = maximal_order(k) na = norm(rand(zk, 1:10)) @@ -20,6 +21,18 @@ end @test all(x->norm(x) == na, s) end +@testset "norm_equation.relative" begin + L, _ = quadratic_field(-1) + _, x = L[:x] + f = x^12 - 34734*x^11 + 401000259*x^10 - 1456627492885*x^9 - 2537142937228035*x^8 + 18762072755679375516*x^7 - 812368636358864062944*x^6 - 70132863629758257512231931*x^5 + 25834472514893102332821062085*x^4 + 76623280610352450247247939584745*x^3 - 45080885015422662132515763499758450*x^2 - 2070499552240812214288316981071818900*x - 550505759097778545485364826246753544; + k, _ = number_field(f) + + zk = maximal_order(k) + na = norm(rand(zk, 10)) + s = norm_equation(zk, na) + @test all(x->norm(x) == na, s) +end + @testset "DiscreteLog" begin F = GF(3,4);