Skip to content

Commit

Permalink
Merge pull request #5764 from jwj61/groupnilplines
Browse files Browse the repository at this point in the history
Move nilpotency class and derived length out of sentence
  • Loading branch information
AndrewVSutherland authored Dec 12, 2023
2 parents fcf875c + 895b875 commit 2c14c8a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 46 deletions.
42 changes: 3 additions & 39 deletions lmfdb/groups/abstract/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def find_props(
overall_order,
impl_order,
overall_display,
impl_display,
implications,
hence_str,
show,
Expand All @@ -198,7 +197,7 @@ def find_props(
cur += 1
noted.update(impl)
impl = [
impl_display.get(B, overall_display.get(B))
overall_display.get(B)
for B in impl_order
if B in impl and B in show
]
Expand Down Expand Up @@ -259,24 +258,14 @@ def get_group_prop_display(gp):
hyperelementaryp = f" (also for $p = {hyperelementaryp}$)"
elif hasattr(gp, 'hyperelementary') and gp.hyperelementary: # Now hyperelementary is a top level implication
hyperelementaryp = f" for $p = {hyperelementaryp}$"
nilp_class = getattr(gp, 'nilpotency_class', None)
if nilp_class is not None:
nilp_phrase = f"{display_knowl('group.nilpotent', 'nilpotent')} of class {nilp_class}"
else:
nilp_phrase = f"{display_knowl('group.nilpotent', 'nilpotent')} of uncomputed class"
solv_length = getattr(gp, 'derived_length', None)
if solv_length is not None:
solv_phrase = f"{display_knowl('group.solvable', 'solvable')} of {display_knowl('group.derived_series', 'length')} {solv_length}"
else:
solv_phrase = f"{display_knowl('group.solvable', 'solvable')} of uncomputed length"
overall_display = {
"cyclic": display_knowl("group.cyclic", "cyclic"),
"abelian": display_knowl("group.abelian", "abelian"),
"nonabelian": display_knowl("group.abelian", "nonabelian"),
"nilpotent": nilp_phrase,
"nilpotent": display_knowl('group.nilpotent', 'nilpotent'),
"supersolvable": display_knowl("group.supersolvable", "supersolvable"),
"monomial": display_knowl("group.monomial", "monomial"),
"solvable": solv_phrase,
"solvable": display_knowl("group.solvable", "solvable"),
"nonsolvable": display_knowl("group.solvable", "nonsolvable"),
"Zgroup": f"a {display_knowl('group.z_group', 'Z-group')}",
"Agroup": f"an {display_knowl('group.a_group', 'A-group')}",
Expand All @@ -299,25 +288,6 @@ def get_group_prop_display(gp):
overall_display["pgroup"] += " (for every $p$)"
return overall_display


def get_group_impl_display(gp):
# Mostly we display things the same in implication lists, but there are a few extra parentheses
nilp_class = getattr(gp, 'nilpotency_class', None)
if nilp_class is not None:
nilp_phrase = f"{display_knowl('group.nilpotent', 'nilpotent')} of class {nilp_class}"
else:
nilp_phrase = f"{display_knowl('group.nilpotent', 'nilpotent')} of uncomputed class"
solv_length = getattr(gp, 'derived_length', None)
if solv_length is not None:
solv_phrase = f"{display_knowl('group.solvable', 'solvable')} of {display_knowl('group.derived_series', 'length')} {solv_length}"
else:
solv_phrase = f"{display_knowl('group.solvable', 'solvable')} of uncomputed length"
return {
"nilpotent": f"{display_knowl('group.nilpotent', 'nilpotent')} ({nilp_phrase})",
"solvable": f"{display_knowl('group.solvable', 'solvable')} ({solv_phrase})",
}


def create_boolean_subgroup_string(sgp, type="normal"):
# We put direct and semidirect after normal since (hence normal) seems weird there, even if correct
implications = {
Expand Down Expand Up @@ -469,9 +439,6 @@ def create_boolean_subgroup_string(sgp, type="normal"):
}
if type == "normal":
overall_display.update(get_group_prop_display(sgp.sub))
impl_display = get_group_impl_display(sgp.sub)
else:
impl_display = {}

assert set(overall_display) == set(overall_order)
hence_str = display_knowl(
Expand All @@ -482,7 +449,6 @@ def create_boolean_subgroup_string(sgp, type="normal"):
overall_order,
impl_order,
overall_display,
impl_display,
implications,
hence_str,
show=overall_display,
Expand Down Expand Up @@ -570,7 +536,6 @@ def create_boolean_string(gp, type="normal"):
assert B in impl_order

overall_display = get_group_prop_display(gp)
impl_display = get_group_impl_display(gp)
assert set(overall_display) == set(overall_order)

hence_str = display_knowl("group.properties_interdependencies", "hence")
Expand All @@ -579,7 +544,6 @@ def create_boolean_string(gp, type="normal"):
overall_order,
impl_order,
overall_display,
impl_display,
implications,
hence_str,
show=(short_show if short_string else overall_display),
Expand Down
8 changes: 5 additions & 3 deletions lmfdb/groups/abstract/templates/abstract-show-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ <h2> Group information</h2>
{% if not gp.live() %}
<tr><td>{{KNOWL('group.chief_series', 'Composition factors')}}:</td><td>{{gp.show_composition_factors()|safe}}</td></tr>
{% endif %}

{% if gp.nilpotent %}
<tr><td>{{KNOWL('group.nilpotent', title='Nilpotency class:')}}</td><td>${{gp.nilpotency_class}}$ </td></tr>
{% endif %}
<tr><td>{{KNOWL('group.derived_series', title='Derived length:')}}</td><td>${{gp.derived_length}}$ </td></tr>
</table>
</p>


<p>
{{info.boolean_characteristics_string | safe}}

</p>

<h2>Group statistics</h2>
Expand Down
51 changes: 49 additions & 2 deletions lmfdb/groups/abstract/templates/abstract-show-subgroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,30 @@ <h2> Subgroup ($H$) information</h2>
not computed
{% endif %}
</td></tr>
{% if seq.amb.show_subgroup_flag() %}<tr><td>{{KNOWL('group.generators', 'Generators:')}}</td><td> ${{seq.amb.show_subgroup_generators(seq)}}$</td></tr>{% endif %}
{% if seq.amb.show_subgroup_flag() %}
<tr><td>{{KNOWL('group.generators', 'Generators:')}}</td><td>
${{seq.amb.show_subgroup_generators(seq)}}$</td></tr>
{% endif %}
{% if seq.nilpotent %}
<tr><td>{{KNOWL('group.nilpotent', title='Nilpotency
class:')}}</td>
<td>
{% if seq.sub.G %}
${{seq.sub.nilpotency_class}}$
{% else %}
not computed
{% endif %}
</td></tr>
{% endif %}
<tr><td>{{KNOWL('group.derived_series', title='Derived
length:')}}</td><td>
{% if seq.sub.G %}
${{seq.sub.derived_length}}$
{% else %}
not computed
{% endif %}
</td></tr>

</table>
</p>

Expand Down Expand Up @@ -50,7 +73,12 @@ <h2> {{KNOWL('group.ambient', 'Ambient group ($G$) information')}} </h2>
<td>{% if seq.amb.solvable %}{{KNOWL('group.presentation', 'Presentation:')}}{% else %}{{KNOWL('group.permutation_gens', 'Generators:')}}{% endif %}</td>
<td>{% if seq.amb.abelian and not seq.amb.cyclic %}Abelian group {% endif %}${{seq.amb.presentation()}}$</td>
</tr>
#}
#}
{% if seq.amb.nilpotent %}
<tr><td>{{KNOWL('group.nilpotent', title='Nilpotency
class:')}}</td><td>${{seq.amb.nilpotency_class}}$ </td></tr>
{% endif %}
<tr><td>{{KNOWL('group.derived_series', title='Derived length:')}}</td><td>${{seq.amb.derived_length}}$ </td></tr>
</table>
</p>

Expand Down Expand Up @@ -87,6 +115,25 @@ <h2> Quotient group ($Q$) structure </h2>
not computed
{% endif %}
</td></tr>
{% if seq.nilpotent %}
<tr><td>{{KNOWL('group.nilpotent', title='Nilpotency
class:')}}</td>
<td>
{% if seq.quo.G %}
${{seq.quo.nilpotency_class}}$
{% else %}
not computed
{% endif %}
</td></tr>
{% endif %}
<tr><td>{{KNOWL('group.derived_series', title='Derived length:')}}</td><td>
{% if seq.quo.G %}
${{seq.quo.derived_length}}$
{% else %}
not computed
{% endif %}
</td></tr>

</table>
</p>

Expand Down
4 changes: 2 additions & 2 deletions lmfdb/groups/abstract/web_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,8 @@ def show(sname, name=None):
return ans

def properties(self):
nilp_str = f"yes, of class {self.nilpotency_class}" if self.nilpotent else "no"
solv_str = f"yes, of length {self.derived_length}" if self.solvable else "no"
nilp_str = "yes" if self.nilpotent else "no"
solv_str = "yes" if self.solvable else "no"
props = [
("Label", self.label),
("Order", web_latex(factor(self.order))),
Expand Down

0 comments on commit 2c14c8a

Please sign in to comment.