Skip to content

Commit

Permalink
Test and fix norm_equation for RelNumFieldOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Nov 6, 2024
1 parent e91af41 commit 5dd7539
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/NumberTheory/NmbThy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
17 changes: 15 additions & 2 deletions test/NumberTheory/nmbthy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,35 @@ 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))
@test length(f) == 2
@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))
s = norm_equation(zk, na)
@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);
Expand Down

0 comments on commit 5dd7539

Please sign in to comment.