From 1ebaeffe52bb5a68d016eb4883a8f5bc2f3664ac Mon Sep 17 00:00:00 2001
From: John Jones
Date: Tue, 5 Dec 2023 13:58:02 -0500
Subject: [PATCH 1/4] Move nilpotency class and derived length out of sentence
---
lmfdb/groups/abstract/main.py | 42 +------------
.../templates/abstract-show-group.html | 12 +++-
.../templates/abstract-show-subgroup.html | 59 ++++++++++++++++++-
lmfdb/groups/abstract/web_groups.py | 4 +-
4 files changed, 71 insertions(+), 46 deletions(-)
diff --git a/lmfdb/groups/abstract/main.py b/lmfdb/groups/abstract/main.py
index a32bc03cf7..4875f08d5c 100644
--- a/lmfdb/groups/abstract/main.py
+++ b/lmfdb/groups/abstract/main.py
@@ -174,7 +174,6 @@ def find_props(
overall_order,
impl_order,
overall_display,
- impl_display,
implications,
hence_str,
show,
@@ -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
]
@@ -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')}",
@@ -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 = {
@@ -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(
@@ -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,
@@ -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")
@@ -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),
diff --git a/lmfdb/groups/abstract/templates/abstract-show-group.html b/lmfdb/groups/abstract/templates/abstract-show-group.html
index 2d0fbedc30..ad6ff329e1 100644
--- a/lmfdb/groups/abstract/templates/abstract-show-group.html
+++ b/lmfdb/groups/abstract/templates/abstract-show-group.html
@@ -26,13 +26,19 @@ Group information
{% if not gp.live() %}
{{KNOWL('group.chief_series', 'Composition factors')}}: | {{gp.show_composition_factors()|safe}} |
{% endif %}
+
+ {% if gp.nilpotent %}
+ {{KNOWL('group.nilpotent', title='Nilpotency
+ class:')}} | ${{gp.nilpotency_class}}$ |
+ {% endif %}
+ {% if gp.solvable %}
+ {{KNOWL('group.derived_series', title='Solvable
+ length:')}} | ${{gp.derived_length}}$ |
+ {% endif %}
-
-
{{info.boolean_characteristics_string | safe}}
-
Group statistics
diff --git a/lmfdb/groups/abstract/templates/abstract-show-subgroup.html b/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
index 90e000cc92..fc66dd48b7 100644
--- a/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
+++ b/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
@@ -20,7 +20,32 @@ Subgroup ($H$) information
not computed
{% endif %}
- {% if seq.amb.show_subgroup_flag() %}{{KNOWL('group.generators', 'Generators:')}} | ${{seq.amb.show_subgroup_generators(seq)}}$ |
{% endif %}
+ {% if seq.amb.show_subgroup_flag() %}
+ {{KNOWL('group.generators', 'Generators:')}} |
+ ${{seq.amb.show_subgroup_generators(seq)}}$ |
+ {% endif %}
+ {% if seq.nilpotent %}
+ {{KNOWL('group.nilpotent', title='Nilpotency
+ class:')}} |
+
+ {% if seq.sub.G %}
+ ${{seq.sub.nilpotency_class}}$
+ {% else %}
+ not computed
+ {% endif %}
+ |
+ {% endif %}
+ {% if seq.solvable %}
+ {{KNOWL('group.derived_series', title='Solvable
+ length:')}} |
+ {% if seq.sub.G %}
+ ${{seq.sub.derived_length}}$
+ {% else %}
+ not computed
+ {% endif %}
+ |
+ {% endif %}
+
@@ -50,7 +75,15 @@ {{KNOWL('group.ambient', 'Ambient group ($G$) information')}}
{% if seq.amb.solvable %}{{KNOWL('group.presentation', 'Presentation:')}}{% else %}{{KNOWL('group.permutation_gens', 'Generators:')}}{% endif %} |
{% if seq.amb.abelian and not seq.amb.cyclic %}Abelian group {% endif %}${{seq.amb.presentation()}}$ |
-#}
+ #}
+ {% if seq.amb.nilpotent %}
+ {{KNOWL('group.nilpotent', title='Nilpotency
+ class:')}} | ${{seq.amb.nilpotency_class}}$ |
+ {% endif %}
+ {% if seq.amb.solvable %}
+ {{KNOWL('group.derived_series', title='Solvable
+ length:')}} | ${{seq.amb.derived_length}}$ |
+ {% endif %}
@@ -87,6 +120,28 @@ Quotient group ($Q$) structure
not computed
{% endif %}
+ {% if seq.nilpotent %}
+ {{KNOWL('group.nilpotent', title='Nilpotency
+ class:')}} |
+
+ {% if seq.quo.G %}
+ ${{seq.quo.nilpotency_class}}$
+ {% else %}
+ not computed
+ {% endif %}
+ |
+ {% endif %}
+ {% if seq.solvable %}
+ {{KNOWL('group.derived_series', title='Solvable
+ length:')}} |
+ {% if seq.quo.G %}
+ ${{seq.quo.derived_length}}$
+ {% else %}
+ not computed
+ {% endif %}
+ |
+ {% endif %}
+
diff --git a/lmfdb/groups/abstract/web_groups.py b/lmfdb/groups/abstract/web_groups.py
index b094480090..2264726d1e 100644
--- a/lmfdb/groups/abstract/web_groups.py
+++ b/lmfdb/groups/abstract/web_groups.py
@@ -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 = f"yes" if self.nilpotent else "no"
+ solv_str = f"yes" if self.solvable else "no"
props = [
("Label", self.label),
("Order", web_latex(factor(self.order))),
From ee589bd0a4b8b7f7e8645cb3f5a79aa35ca55c59 Mon Sep 17 00:00:00 2001
From: John Jones
Date: Tue, 5 Dec 2023 14:36:50 -0500
Subject: [PATCH 2/4] Pyflakes
---
lmfdb/groups/abstract/web_groups.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lmfdb/groups/abstract/web_groups.py b/lmfdb/groups/abstract/web_groups.py
index 2264726d1e..a853fb5897 100644
--- a/lmfdb/groups/abstract/web_groups.py
+++ b/lmfdb/groups/abstract/web_groups.py
@@ -750,8 +750,8 @@ def show(sname, name=None):
return ans
def properties(self):
- nilp_str = f"yes" if self.nilpotent else "no"
- solv_str = f"yes" 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))),
From 814d6b4cd8ac935bd1b9e00ff1d22960d00c4597 Mon Sep 17 00:00:00 2001
From: John Jones
Date: Wed, 6 Dec 2023 11:16:41 -0500
Subject: [PATCH 3/4] Show derived length in all cases
---
lmfdb/groups/abstract/templates/abstract-show-group.html | 8 ++------
.../abstract/templates/abstract-show-subgroup.html | 9 +--------
2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/lmfdb/groups/abstract/templates/abstract-show-group.html b/lmfdb/groups/abstract/templates/abstract-show-group.html
index ad6ff329e1..72f7a6bd75 100644
--- a/lmfdb/groups/abstract/templates/abstract-show-group.html
+++ b/lmfdb/groups/abstract/templates/abstract-show-group.html
@@ -28,13 +28,9 @@ Group information
{% endif %}
{% if gp.nilpotent %}
- {{KNOWL('group.nilpotent', title='Nilpotency
- class:')}} | ${{gp.nilpotency_class}}$ |
- {% endif %}
- {% if gp.solvable %}
- {{KNOWL('group.derived_series', title='Solvable
- length:')}} | ${{gp.derived_length}}$ |
+ {{KNOWL('group.nilpotent', title='Nilpotency class:')}} | ${{gp.nilpotency_class}}$ |
{% endif %}
+ {{KNOWL('group.derived_series', title='Solvable length:')}} | ${{gp.derived_length}}$ |
diff --git a/lmfdb/groups/abstract/templates/abstract-show-subgroup.html b/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
index fc66dd48b7..52906271a6 100644
--- a/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
+++ b/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
@@ -35,7 +35,6 @@
Subgroup ($H$) information
{% endif %}
{% endif %}
- {% if seq.solvable %}
{{KNOWL('group.derived_series', title='Solvable
length:')}} |
{% if seq.sub.G %}
@@ -44,7 +43,6 @@ Subgroup ($H$) information
not computed
{% endif %}
|
- {% endif %}
@@ -80,10 +78,7 @@ {{KNOWL('group.ambient', 'Ambient group ($G$) information')}}
{{KNOWL('group.nilpotent', title='Nilpotency
class:')}} | ${{seq.amb.nilpotency_class}}$ |
{% endif %}
- {% if seq.amb.solvable %}
- {{KNOWL('group.derived_series', title='Solvable
- length:')}} | ${{seq.amb.derived_length}}$ |
- {% endif %}
+ {{KNOWL('group.derived_series', title='Solvable length:')}} | ${{seq.amb.derived_length}}$ |
@@ -131,7 +126,6 @@ Quotient group ($Q$) structure
{% endif %}
{% endif %}
- {% if seq.solvable %}
{{KNOWL('group.derived_series', title='Solvable
length:')}} |
{% if seq.quo.G %}
@@ -140,7 +134,6 @@ Quotient group ($Q$) structure
not computed
{% endif %}
|
- {% endif %}
From 895b875d9517c715207a4e112fc97c152966f83c Mon Sep 17 00:00:00 2001
From: John Jones
Date: Wed, 6 Dec 2023 13:40:15 -0500
Subject: [PATCH 4/4] Change solvable length to derived length.
---
lmfdb/groups/abstract/templates/abstract-show-group.html | 2 +-
.../groups/abstract/templates/abstract-show-subgroup.html | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lmfdb/groups/abstract/templates/abstract-show-group.html b/lmfdb/groups/abstract/templates/abstract-show-group.html
index 72f7a6bd75..0245cc095e 100644
--- a/lmfdb/groups/abstract/templates/abstract-show-group.html
+++ b/lmfdb/groups/abstract/templates/abstract-show-group.html
@@ -30,7 +30,7 @@ Group information
{% if gp.nilpotent %}
{{KNOWL('group.nilpotent', title='Nilpotency class:')}} | ${{gp.nilpotency_class}}$ |
{% endif %}
- {{KNOWL('group.derived_series', title='Solvable length:')}} | ${{gp.derived_length}}$ |
+ {{KNOWL('group.derived_series', title='Derived length:')}} | ${{gp.derived_length}}$ |
diff --git a/lmfdb/groups/abstract/templates/abstract-show-subgroup.html b/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
index 52906271a6..54ae0af516 100644
--- a/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
+++ b/lmfdb/groups/abstract/templates/abstract-show-subgroup.html
@@ -35,7 +35,7 @@
Subgroup ($H$) information
{% endif %}
{% endif %}
- {{KNOWL('group.derived_series', title='Solvable
+ |
{{KNOWL('group.derived_series', title='Derived
length:')}} |
{% if seq.sub.G %}
${{seq.sub.derived_length}}$
@@ -78,7 +78,7 @@ {{KNOWL('group.ambient', 'Ambient group ($G$) information')}}
|
{{KNOWL('group.nilpotent', title='Nilpotency
class:')}} | ${{seq.amb.nilpotency_class}}$ |
{% endif %}
- {{KNOWL('group.derived_series', title='Solvable length:')}} | ${{seq.amb.derived_length}}$ |
+ {{KNOWL('group.derived_series', title='Derived length:')}} | ${{seq.amb.derived_length}}$ |
@@ -126,8 +126,7 @@ Quotient group ($Q$) structure
{% endif %}
{% endif %}
- {{KNOWL('group.derived_series', title='Solvable
- length:')}} |
+ |
{{KNOWL('group.derived_series', title='Derived length:')}} |
{% if seq.quo.G %}
${{seq.quo.derived_length}}$
{% else %}
|