Skip to content

Commit

Permalink
Merge pull request #5726 from roed314/groups_fixes
Browse files Browse the repository at this point in the history
Groups fixes
  • Loading branch information
AndrewVSutherland authored Nov 8, 2023
2 parents 9de82b4 + 4cdd690 commit e7e3433
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
18 changes: 13 additions & 5 deletions lmfdb/groups/abstract/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,10 @@ def group_jump(info):
# )

def show_factor(n):
if n is None:
if n is None or n == "":
return ""
if n == 0:
return "$0$"
return f"${latex(ZZ(n).factor())}$"

def get_url(label):
Expand Down Expand Up @@ -1468,10 +1470,16 @@ def picture(label):
flash_error("No group with label %s was found in the database.", label)
return redirect(url_for(".index"))
# The user specifically requested the image, so we don't impose a limit on the number of conjugacy classes
svg_io = BytesIO()
svg_io.write(gp.image().encode("utf-8"))
svg_io.seek(0)
return send_file(svg_io, mimetype='image/svg+xml')
try:
img = gp.image()
except Exception:
flash_error("Error generating image for %s.", label)
return redirect(url_for(".index"))
else:
svg_io = BytesIO()
svg_io.write(img.encode("utf-8"))
svg_io.seek(0)
return send_file(svg_io, mimetype='image/svg+xml')
else:
flash_error("The label %s is invalid.", label)
return redirect(url_for(".index"))
Expand Down
6 changes: 3 additions & 3 deletions lmfdb/groups/abstract/templates/abstract-show-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ <h3>Special subgroups</h3>
<td><span class="subgp chargp" data-sgid="{{gp.cent()}}">$Z \simeq$ {{gp.cent_label()|safe}}</span></td>
<td>{{gp.subgroups[gp.cent()].display_quotient("Z")|safe}}</td>
{% elif gp.center_label %}
<td>a subgroup isomorphic to <a href="{{url_for('.by_label', label=gp.center_label)}}">${{gp.special_subs_label(gp.center_label)}}$</td>
<td>a subgroup isomorphic to <a href="{{url_for('.by_label', label=gp.center_label)}}">{{gp.special_subs_label(gp.center_label)}}</td>
{% else %}
<td>not computed</td>
{% endif %}
Expand All @@ -358,7 +358,7 @@ <h3>Special subgroups</h3>
<td><span class="subgp chargp" data-sgid="{{gp.comm()}}">$G' \simeq$ {{gp.subgroups[gp.comm()].knowl()|safe}}</span></td> {# match single quote for code highlighting purposes: ' #}
<td>{{gp.subgroups[gp.comm()].display_quotient("G'", ab_invs=gp.smith_abelian_invariants)|safe}}</td>
{% elif gp.commutator_label %}
<td>a subgroup isomorphic to <a href="{{url_for('.by_label', label=gp.comutator_label)}}">${{gp.special_subs_label(gp.commutator_label)}}$</td>
<td>a subgroup isomorphic to <a href="{{url_for('.by_label', label=gp.commutator_label)}}">{{gp.special_subs_label(gp.commutator_label)}}</td>
{% else %}
<td>not computed</td>
{% endif %}
Expand All @@ -369,7 +369,7 @@ <h3>Special subgroups</h3>
<td><span class="subgp chargp" data-sgid="{{gp.fratt()}}">$\Phi \simeq$ {{gp.subgroups[gp.fratt()].knowl()|safe}}</span></td>
<td>{{gp.subgroups[gp.fratt()].display_quotient("\\Phi")|safe}} </td>
{% elif gp.frattini_label %}
<td>a subgroup isomorphic to <a href="{{url_for('.by_label', label=gp.frattini_label)}}">${{gp.special_subs_label(gp.frattini_label)}}$</td>
<td>a subgroup isomorphic to <a href="{{url_for('.by_label', label=gp.frattini_label)}}">{{gp.special_subs_label(gp.frattini_label)}}</td>
{% else %}
<td> not computed</td>
{% endif %}
Expand Down
9 changes: 6 additions & 3 deletions lmfdb/groups/abstract/web_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __init__(self, label, data=None):
if libgap.SmallGroupsAvailable(n):
maxi = libgap.NrSmallGroups(n)
i = ZZ(m.group(2))
if i <= maxi:
if 0 < i <= maxi:
self._data = (n, i)
self.source = "GAP"
if isinstance(self._data, list): # live abelian group
Expand Down Expand Up @@ -1995,8 +1995,11 @@ def exp(n):

#first function is if we only know special subgroups as abstract groups
def special_subs_label(self,label):
info=db.gps_groups.lucky({"label": label})
return info['tex_name']
info = db.gps_groups.lucky({"label": label})
if info is None:
return label
else:
return f"${info['tex_name']}$"

def cent(self):
return self.special_search("Z")
Expand Down
8 changes: 6 additions & 2 deletions lmfdb/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
"\\PGOPlus": '{\\textrm{PGO}^+}',
"\\PGU": '{\\textrm{PGU}}',
"\\PSOMinus": '{\\textrm{PSO}^-}',
"\\PGOMinus": '{\\textrm{PGO}^-}',
"\\POmega": '{\\textrm{P}\\Omega}',
"\\PGOMinus": '{\\textrm{PGO}^-}',
"\\POmega": '{\\textrm{P}\\Omega}',
"\\POmegaPlus": '{\\textrm{P}\\Omega^+}',
"\\POmegaMinus": '{\\textrm{P}\\Omega^-}',
"\\PGammaL": '{\\textrm{P}\\Gamma\\textrm{L}}',
Expand All @@ -125,6 +125,10 @@
"\\SD": '{\\textrm{SD}}',
"\\OD": '{\\textrm{OD}}',
"\\He": '{\\textrm{He}}',
"\\HS": '{\\textrm{HS}}',
"\\McL": '{\\textrm{McL}}',
"\\Ru": '{\\textrm{Ru}}',
"\\Co": '{\\textrm{Co}}',
"\\Aut": '\\operatorname{Aut}',
"\\End": '\\operatorname{End}',
"\\Gal": '\\operatorname{Gal}',
Expand Down

0 comments on commit e7e3433

Please sign in to comment.