From bc4f3c45f42a90fee9605d7ad2f7bb6b123df96b Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Wed, 24 May 2023 10:50:40 +0200 Subject: [PATCH] Add is_modular(L, p) for ZZLat (#1081) * Add is_modular(L, p) for ZZLat Co-authored-by: Stevell Muller <78619134+StevellM@users.noreply.github.com> --- src/QuadForm/Lattices.jl | 8 ++++---- src/QuadForm/Quad/GenusRep.jl | 4 ++-- src/QuadForm/Quad/ZLattices.jl | 17 ++++++++++++++++- test/QuadForm/Quad/ZLattices.jl | 9 +++++++++ 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/QuadForm/Lattices.jl b/src/QuadForm/Lattices.jl index 8bd235a493..26f49fa601 100644 --- a/src/QuadForm/Lattices.jl +++ b/src/QuadForm/Lattices.jl @@ -834,11 +834,11 @@ function is_modular(L::AbstractLat) end @doc raw""" - is_modular(L::AbstractLat, p::NfOrdIdl) -> Bool, Int + is_modular(L::AbstractLat, p) -> Bool, Int -Return whether the completion $L_{p}$ of the lattice `L` at the prime ideal `p` -is modular. If it is the case the second returned value is an integer `v` such -that $L_{p}$ is $p^v$-modular. +Return whether the completion $L_{p}$ of the lattice `L` at the prime ideal or +integer `p` is modular. If it is the case the second returned value is an +integer `v` such that $L_{p}$ is $p^v$-modular. """ is_modular(::AbstractLat, p) diff --git a/src/QuadForm/Quad/GenusRep.jl b/src/QuadForm/Quad/GenusRep.jl index 77d8153789..4bd6831d34 100644 --- a/src/QuadForm/Quad/GenusRep.jl +++ b/src/QuadForm/Quad/GenusRep.jl @@ -71,13 +71,13 @@ end ################################################################################ @doc raw""" - genus_representatives(L::QuadLat; max = inf, use_auto = false) + genus_representatives(L::QuadLat; max = inf, use_auto = true) -> Vector{QuadLat} Computes representatives for the isometry classes in the genus of $L$. At most `max` representatives are returned. The use of automorphims can be -disabled by +disabled by setting `use_auto = false`. """ function genus_representatives(L::QuadLat; max = inf, use_auto = true, use_mass = true) # Otherwise the isomorphism to the class group fails, cf. ยง102 in O'Meara. diff --git a/src/QuadForm/Quad/ZLattices.jl b/src/QuadForm/Quad/ZLattices.jl index cd3368be58..148cac0a65 100644 --- a/src/QuadForm/Quad/ZLattices.jl +++ b/src/QuadForm/Quad/ZLattices.jl @@ -919,6 +919,22 @@ Return the number of (positive, zero, negative) inertia of `L`. """ signature_tuple(L::ZZLat) = signature_tuple(rational_span(L)) +################################################################################ +# +# Modularity +# +################################################################################ + +function is_modular(L::ZZLat, p::IntegerUnion) + a = scale(L) + v = valuation(a, p) + if v * rank(L) == valuation(volume(L), p) + return true, v + else + return false, 0 + end +end + ################################################################################ # # Local basis matrix @@ -1080,7 +1096,6 @@ function _maximal_integral_lattice(L::ZZLat) return _to_ZLat(M, V = ambient_space(L)) end - @doc raw""" maximal_even_lattice(L::ZZLat, p) -> ZZLat diff --git a/test/QuadForm/Quad/ZLattices.jl b/test/QuadForm/Quad/ZLattices.jl index 82124da9c3..f9728f2654 100644 --- a/test/QuadForm/Quad/ZLattices.jl +++ b/test/QuadForm/Quad/ZLattices.jl @@ -725,3 +725,12 @@ end L = @inferred quadratic_lattice(QQ, [B[i,:] for i in 1:nrows(B)], gram = gram_matrix(E8)) @test genus(L) == genus(E8) end + +let + L = integer_lattice(; gram = ZZ[3 0; 0 1]) + fl, v = @inferred is_modular(L, 3) + @test !fl + L = integer_lattice(; gram = ZZ[3 0; 0 3]) + fl, v = @inferred is_modular(L, 3) + @test fl && v == 1 +end