Skip to content

Commit

Permalink
Add is_modular(L, p) for ZZLat (#1081)
Browse files Browse the repository at this point in the history
* Add is_modular(L, p) for ZZLat

Co-authored-by: Stevell Muller <[email protected]>
  • Loading branch information
thofma and StevellM authored May 24, 2023
1 parent 0d501e2 commit bc4f3c4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/QuadForm/Lattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/QuadForm/Quad/GenusRep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 16 additions & 1 deletion src/QuadForm/Quad/ZLattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/QuadForm/Quad/ZLattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bc4f3c4

Please sign in to comment.