Skip to content

Commit

Permalink
small improvement in genus symbol enumerations (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
StevellM authored May 30, 2024
1 parent b8b8e29 commit 7a5bac9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/QuadForm/Herm/Genus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,8 @@ function hermitian_genera(E::Hecke.RelSimpleNumField, rank::Int, signatures::Dic
@req rank >= 0 "Rank must be a non-negative integer"
K = base_field(E)
OE = maximal_order(E)
bd = union!(support(2*maximal_order(K)), support(discriminant(OE)))
bds = union!(support(2*maximal_order(K)), support(discriminant(OE)))
bd = deepcopy(bds)
@req !iszero(max_scale) "max_scale must be a non-zero fractional ideal"
@req !iszero(min_scale) "min_scale must be a non-zero fractional ideal"
@req all(v -> 0 <= v <= rank, values(signatures)) "Incompatible signatures and rank"
Expand All @@ -1844,6 +1845,7 @@ function hermitian_genera(E::Hecke.RelSimpleNumField, rank::Int, signatures::Dic
union!(bd, support(norm(determinant)))
sort!(bd; by = (x -> minimum(x)))
local_symbols = Vector{local_genus_herm_type(E)}[]
res = genus_herm_type(E)[]

mins = norm(min_scale)
maxs = norm(max_scale)
Expand All @@ -1858,16 +1860,15 @@ function hermitian_genera(E::Hecke.RelSimpleNumField, rank::Int, signatures::Dic
maxscale_p = div(maxscale_p, 2)
end
lgh = hermitian_local_genera(E, p, rank, det_val, minscale_p, maxscale_p)
!isempty(lgh) && push!(local_symbols, lgh)
isempty(lgh) && return res
push!(local_symbols, lgh)
end

res = genus_herm_type(E)[]
it = cartesian_product_iterator(local_symbols)
for gs in it
c = copy(gs)
b = _check_global_genus(c, signatures)
if b
filter!(g -> (prime(g) in bd) || (scales(g) != Int[0]), c)
filter!(g -> (prime(g) in bds) || (scales(g) != Int[0]), c)
push!(res, HermGenus(E, rank, c, signatures))
end
end
Expand Down
3 changes: 2 additions & 1 deletion src/QuadForm/Quad/ZGenus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ function integer_genera(sig_pair::Tuple{Int,Int}, _determinant::RationalUnion;
maxscale_p = valuation(_max_scale, p)
local_symbol_p = _local_genera(p, rank, det_val, minscale_p, maxscale_p, even)
filter!(s -> (prime(s) == 2) || (length(symbol(s)) > 1) || (symbol(s)[1][1] != 0), local_symbol_p)
!is_empty(local_symbol_p) && push!(local_symbols, local_symbol_p)
isempty(local_symbol_p) && return out
push!(local_symbols, local_symbol_p)
end
# take the cartesian product of the collection of all possible
# local genus symbols one for each prime
Expand Down

0 comments on commit 7a5bac9

Please sign in to comment.