Skip to content

Commit 944282a

Browse files
authored
Merge pull request #6423 from jenpaulhus/gap_subs
Fixing issue with Magma groups that are not Ids in Gap
2 parents 98447b2 + edffa4f commit 944282a

2 files changed

Lines changed: 41 additions & 9 deletions

File tree

lmfdb/groups/abstract/main.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
abstract_group_display_knowl,
6868
cc_data_to_gp_label,
6969
gp_label_to_cc_data,
70+
missing_subs,
7071
)
7172
from .stats import GroupStats
7273

@@ -994,7 +995,7 @@ def get_trans_url(label):
994995
return url_for("galois_groups.by_label", label=trans_gp(label))
995996

996997
def display_url(label, tex):
997-
if label is None:
998+
if label is None or missing_subs(label):
998999
if tex is None:
9991000
return ''
10001001
return f'${tex}$'
@@ -1396,7 +1397,7 @@ def gp_link(gp_order,gp_counter, tex_cache):
13961397
MultiProcessedCol("label", "group.label_conjugacy_class", "Label",["group_order", "group_counter", "label","highlight_col"],get_cc_url, download_col="label"),
13971398
MathCol("order", "group.order_conjugacy_class", "Order"),
13981399
MathCol("size", "group.size_conjugacy_class", "Size"),
1399-
MultiProcessedCol("center", "group.subgroup.centralizer", "Centralizer", ["centralizer", "group", "sub_latex"], char_to_sub, download_col="centralizer"),
1400+
MultiProcessedCol("center", "group.centralizer", "Centralizer", ["centralizer", "group", "sub_latex"], char_to_sub, download_col="centralizer"),
14001401
ColGroup("power_cols","group.conjugacy_class.power_classes", "Powers",
14011402
lambda info: [Power_col(i, info["group_factors"]) for i in range(len(info["group_factors"]))],
14021403
contingent=lambda info: info.get("group_factors",True), # group_factors not present when downloading
@@ -1786,7 +1787,7 @@ def subinfo_getsub(title, knowlid, lab):
17861787
ans += subinfo_getsub(
17871788
"Normal closure", "group.subgroup.normal_closure", wsg.normal_closure
17881789
)
1789-
ans += subinfo_getsub("Centralizer", "group.subgroup.centralizer", wsg.centralizer)
1790+
ans += subinfo_getsub("Centralizer", "group.centralizer", wsg.centralizer)
17901791
ans += subinfo_getsub("Core", "group.core", wsg.core)
17911792
# ans += '<tr><td>Coset action</td><td>%s</td></tr>\n' % wsg.coset_action_label
17921793
## There was a bug in the Magma code computing generators, so we disable this for the moment
@@ -2925,8 +2926,8 @@ def group_data(label, ambient=None, aut=False, profiledata=None):
29252926
if profiledata[1] is None:
29262927
ans += "Isomorphism class has not been identified<br />"
29272928
else:
2928-
# TODO: add hash knowl and search link to groups with this order and hash
2929-
ans += f"Hash: {profiledata[1]}<br />"
2929+
# TODO: add search link to groups with this order and hash
2930+
ans += f"{display_knowl('group.hash', 'Hash')} : {profiledata[1]}<br />"
29302931
isomorphism_label = "Subgroups with this data:"
29312932
else:
29322933
if label.startswith("ab/"):
@@ -2936,9 +2937,14 @@ def group_data(label, ambient=None, aut=False, profiledata=None):
29362937
data = None
29372938
url = url_for("abstract.by_label", label=label)
29382939
gp = WebAbstractGroup(label, data=data)
2939-
#GAP doesn't have groups of order 3^8 so if not in db, can't be live
2940-
if label.startswith("6561.") and gp.source == "Missing":
2941-
return Markup("No additional information for this group of order 6561 is available.")
2940+
# dealing with groups identified in magma but not in gap so can't do live pages˚
2941+
ord = label.split(".")[0]
2942+
if missing_subs(label) and gp.source == "Missing":
2943+
ans = 'The group {} is not available in GAP, but see the list of <a href="{}">{}</a>.'.format(
2944+
label,
2945+
f"/Groups/Abstract/?subgroup_order={ord}&ambient={ambient}&search_type=Subgroups",
2946+
"subgroups with this order")
2947+
return Markup(ans)
29422948
ans = f"Group ${gp.tex_name}$: "
29432949
ans += create_boolean_string(gp, type="knowl")
29442950
ans += f"<br />Label: {gp.label}<br />"

lmfdb/groups/abstract/web_groups.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from lmfdb import db
66
from flask import url_for
77
from urllib.parse import quote_plus
8+
from psycopg2.sql import SQL, Identifier
89

910
from sage.all import (
1011
Permutations,
@@ -194,6 +195,30 @@ def in_small_gp_db(order):
194195
return True
195196
return False
196197

198+
@cached_function
199+
def groups_from_missing_orders():
200+
# There was a casting problem comparing smallint[] and the arrays
201+
return set(x[0] for x in db._execute(SQL("SELECT label, factors_of_order, exponents_of_order FROM gps_groups WHERE {0} > 2000 AND (exponents_of_order = %s::smallint[] OR exponents_of_order = %s::smallint [] OR exponents_of_order = %s::smallint[] OR exponents_of_order = %s::smallint[] OR exponents_of_order = %s::smallint[] OR exponents_of_order = %s::smallint[] OR exponents_of_order = %s::smallint[])").format(Identifier("order")), [[8],[7],[4],[3,1],[2,2],[2,1,1],[1,1,1,1]]) if (x[1] == [3] and x[2] == [8] or x[1][0] > 11 and x[2] == [7] or x[2] == [4] or len(x[2]) > 1))
202+
203+
# determine groups which are identified in Magma but not Gap
204+
@cached_function
205+
def missing_subs(n_or_label):
206+
if isinstance(n_or_label, str):
207+
if n_or_label in groups_from_missing_orders():
208+
return False
209+
n = ZZ(n_or_label.split(".")[0])
210+
else:
211+
n = ZZ(n_or_label)
212+
if n == 6561:
213+
return True
214+
f = factor(n)
215+
if n > 2000:
216+
if sum(e for p,e in f) == 4:
217+
return True
218+
if len(f) == 1 and f[0][1] == 7 and f[0][0] > 11:
219+
return True
220+
return False
221+
197222

198223
def cc_data_to_gp_label(order,counter):
199224
if in_small_gp_db(order):
@@ -3133,7 +3158,8 @@ def sub(self):
31333158
'aut_group': self.aut_label, 'aut_order': None,
31343159
'pgroup':len(ZZ(order).abs().factor()) == 1})
31353160
return newgroup
3136-
if self.subgroup_order == 6561:
3161+
# issue with groups identifiable in magma but not gap
3162+
if missing_subs(self.subgroup):
31373163
gp = WebAbstractGroup(self.subgroup, None)
31383164
if gp.source == "Missing":
31393165
order = self.subgroup_order

0 commit comments

Comments
 (0)