Skip to content

Commit 9204328

Browse files
allow to give known lattices to oscar_genus_representatives (#5568)
* allow to give known lattices to oscar_genus_representatives * a bit of documentation
1 parent b4b1b06 commit 9204328

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/NumberTheory/QuadFormAndIsom/enumeration.jl

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ _roger_upper_bound_test(G::ZZGenus) =_packing_density_test(G)
26262626

26272627
@doc raw"""
26282628
oscar_genus_representatives(
2629-
G::ZZGenus,
2629+
G::Union{ZZGenus,Vector{ZZLat}},
26302630
algorithm::Symbol = :default;
26312631
rand_neigh::Int = 10,
26322632
invariant_function::Function=Hecke.default_invariant_function,
@@ -2675,7 +2675,11 @@ There are possible extra optional arguments:
26752675
stops after the specified amount of vain iterations without finding a new
26762676
isometry class is reached;
26772677
* `max_lat::IntExt` (default = `inf`) -> the algorithm stops after finding
2678-
`max` isometry classes.
2678+
`max` isometry classes
2679+
* `_local::Bool` (default= `false`);
2680+
* `distinct::Bool` (default= `false`) if set to true, believe blindly that all elements
2681+
of `G::Vector{ZZLat}` are pairwise non-isometric;
2682+
* `add_spinor_generators::Bool` add spinor generators to the given list of known lattices.
26792683
26802684
!!! warning
26812685
The algorithm uses the mass by default, in order to use the codes of
@@ -2709,7 +2713,7 @@ The `default_invariant_function` currently computes:
27092713
case, the enumeration is skipped.
27102714
"""
27112715
function oscar_genus_representatives(
2712-
G::ZZGenus,
2716+
known::Vector{ZZLat},
27132717
algorithm::Symbol = :default;
27142718
rand_neigh::Int=10,
27152719
invariant_function::Function=Hecke.default_invariant_function,
@@ -2720,8 +2724,11 @@ function oscar_genus_representatives(
27202724
genusDB::Union{Nothing, Dict{ZZGenus, Vector{ZZLat}}}=nothing,
27212725
root_test::Bool=false,
27222726
info_depth::Int=1,
2723-
_local::Bool=false
2727+
_local::Bool=false,
2728+
distinct::Bool=false,
2729+
add_spinor_generators::Bool=true,
27242730
)
2731+
G = genus(known[1])
27252732
if _local
27262733
return [representative(G)]
27272734
end
@@ -2756,11 +2763,11 @@ function oscar_genus_representatives(
27562763
# where after `stop_after` vain iterations we do not find any new isometry
27572764
# class, we stop Kneser's algorithm and we start isometry enumeration instead.
27582765
allow_info && println("Definite genus of rank bigger than 2")
2759-
l = enumerate_definite_genus(G, algorithm; rand_neigh, invariant_function, save_partial, save_path, stop_after, max=max_lat)
2766+
l, mm = enumerate_definite_genus(known, algorithm; rand_neigh, invariant_function, save_partial, save_path, stop_after, max=max_lat, distinct, add_spinor_generators)
27602767
length(l) == max_lat && return l
27612768

27622769
# Part of the mass of G which is missing
2763-
mm = mass(G) - sum(1//automorphism_group_order(LL) for LL in l; init=QQ(0))
2770+
@assert mm == mass(G) - sum(1//automorphism_group_order(LL) for LL in l; init=QQ(0))
27642771

27652772
# If `mm` is nonzero, we are missing some isometry classes
27662773
if !iszero(mm)
@@ -2876,6 +2883,8 @@ function oscar_genus_representatives(
28762883
end
28772884
return l
28782885
end
2886+
2887+
oscar_genus_representatives(G::ZZGenus, algorithm::Symbol=:default;kwargs...) = oscar_genus_representatives([representative(G)], algorithm; kwargs...)
28792888

28802889
###############################################################################
28812890
#

0 commit comments

Comments
 (0)