From 07b864b016643c133b43384332285ea2dff14b87 Mon Sep 17 00:00:00 2001 From: simonbrandhorst <51749255+simonbrandhorst@users.noreply.github.com> Date: Wed, 16 Feb 2022 17:24:48 +0100 Subject: [PATCH] fix preimage for TorQuadModMor (#603) Co-authored-by: Simon Brandhorst --- src/QuadForm/Torsion.jl | 2 +- test/QuadForm/Torsion.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/QuadForm/Torsion.jl b/src/QuadForm/Torsion.jl index 2c3974e3fe..f106f6dcd4 100644 --- a/src/QuadForm/Torsion.jl +++ b/src/QuadForm/Torsion.jl @@ -507,7 +507,7 @@ function image(f::TorQuadModMor, a::TorQuadModElem) end function preimage(f::TorQuadModMor, a::TorQuadModElem) - A = abelian_group(domain(f)) + A = abelian_group(codomain(f)) return domain(f)(f.map_ab\(A(a))) end diff --git a/test/QuadForm/Torsion.jl b/test/QuadForm/Torsion.jl index e40687a622..5f7e6b785d 100644 --- a/test/QuadForm/Torsion.jl +++ b/test/QuadForm/Torsion.jl @@ -39,7 +39,6 @@ T, i = primary_part(q1, 3) @test order(T) == 1 - Ld = dual(L) T = @inferred torsion_quadratic_module(Ld, L, snf = false) @@ -76,7 +75,8 @@ #orthogonal submodule to a TorQuadMod L = Zlattice(matrix(ZZ, [[2,0,0],[0,2,0],[0,0,2]])) T = Hecke.discriminant_group(L) - S, _ = sub(T, gens(T)) + S, i = sub(T, gens(T)) + @test all([preimage(i,i(s))==s for s in gens(S)]) @test basis_matrix(Hecke.cover(Hecke.orthogonal_submodule_to(T, S)[1])) == basis_matrix(L) L1 = Zlattice(identity_matrix(ZZ,10)) T1 = torsion_quadratic_module(L1, 3*L1)