Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuadFormAndIsom: small optimizations after users' feedbacks #3575

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions experimental/QuadFormAndIsom/src/embeddings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -640,16 +640,27 @@ function _primitive_extensions_generic(
prN, pN = is_primary_with_prime(N)
elN = is_elementary(N, pN)

# We do everything in the good elementary parts
all_elem = (elM && pM != 1) || (elN && pN != 1)

# We do everything in the good primary parts
all_prim = (prM && pM != 1) || (prN && pN != 1)

for k in pos_ord
ok, ek, pk = is_prime_power_with_data(k)
@vprintln :ZZLatWithIsom 1 "Glue order: $(k)"
# If k is a prime power, then we check whether any of the pk-primary part
# of qM or qN is elementary (to make things faster)
if ok
flag_elem = (ek == 1) || (valuation(elementary_divisors(qM)[end], pk) == 1) || (valuation(elementary_divisors(qN)[end], pk) == 1)
end

if (elM && pM != 1) || (elN && pN != 1) || (ok && ek == 1)
if all_elem || (ok && flag_elem)
# We look for a glue kernel which is an elementary p-group
_p = max(pM, pN, pk)
_, VMinqM = _get_V(id_hom(qM), minimal_polynomial(identity_matrix(QQ, 1)), _p)
subsM = _subgroups_orbit_representatives_and_stabilizers_elementary(VMinqM, GM, k, _p, fqM)
elseif (prM && pM != 1) || (prN && pN != 1) || ok
elseif all_prim || ok
# We look for a glue kernel which is a p-group
_, VMinqM = primary_part(qM, max(pM, pN, pk))
subsM = _subgroups_orbit_representatives_and_stabilizers(VMinqM, GM, k, fqM)
Expand Down Expand Up @@ -705,7 +716,7 @@ function _primitive_extensions_generic(
stabHMphi, _ = sub(OHN, _stabHMphi)
SM, _ = intersect(C, stabHMphi)

if length(elementary_divisors(HN)) == 1
if allequal(elementary_divisors(HN))
StevellM marked this conversation as resolved.
Show resolved Hide resolved
iso = isomorphism(PermGroup, C)
else
iso = id_hom(C)
Expand Down Expand Up @@ -982,7 +993,7 @@ function _classes_isomorphic_subgroups(q::TorQuadModule,
# Trivial case: we look for subgroups in a given primary part of q
ok, e, p = is_prime_power_with_data(ordH)
if ok
if e == 1
if (e == 1) || (!isnothing(H) && is_elementary(H, p))
_, Vinq = _get_V(id_hom(q), minimal_polynomial(identity_matrix(QQ, 1)), p)
sors = _subgroups_orbit_representatives_and_stabilizers_elementary(Vinq, O, ordH, p, f)
else
Expand Down Expand Up @@ -1027,7 +1038,7 @@ function _classes_isomorphic_subgroups(q::TorQuadModule,
end
Oqp, _ = restrict_automorphism_group(O, qpinq; check = false)
fqp = restrict_endomorphism(f, qpinq; check = false)
if ordHp == p || (!isnothing(H) && is_elementary(T, p))
if (ordHp == p) || (is_elementary(qp, p)) || (!isnothing(H) && is_elementary(T, p))
_, j = _get_V(id_hom(qp), minimal_polynomial(identity_matrix(QQ, 1)), p)
sors = _subgroups_orbit_representatives_and_stabilizers_elementary(j, Oqp, ordHp, p, fqp)
else
Expand Down
Loading