Skip to content

Add a maximal subgroups mode to the subgroup diagram and profile - #7171

Open
roed-math wants to merge 4 commits into
LMFDB:mainfrom
roed-math:ai/t35-maximal-subgroups-mode
Open

Add a maximal subgroups mode to the subgroup diagram and profile#7171
roed-math wants to merge 4 commits into
LMFDB:mainfrom
roed-math:ai/t35-maximal-subgroups-mode

Conversation

@roed-math

Copy link
Copy Markdown
Contributor

Closes #6891.

Adds a "maximal subgroups" button next to "all subgroups"/"normal subgroups" on abstract group pages, as suggested in the issue. The new mode works for both the diagram and the profile views, crossed with the existing up-to-conjugacy/up-to-automorphism toggle, and gets its own fullpage diagram routes.

The diagram shows the whole group on top with the classes of maximal subgroups below it, built directly from the stored maximal column, so it displays even for groups whose full subgroup diagram is disabled for size (e.g. 32.45, 1024.dke). For groups where inclusions were never computed (e.g. 1024.dip) the profile still lists all maximal subgroup classes.

Verified on S4, PGL(2,7), p-groups with huge/partial/missing lattices, and the trivial group; the abstract-groups test suite passes and a new test covers the mode.


Ported from roed-math#37, where the full write-up and comment history live.

🤖 Generated with Claude Code

roed314 and others added 3 commits July 19, 2026 13:41
Adds a "maximal subgroups" button next to "all subgroups" and "normal
subgroups" on abstract group pages, working for both the diagram and the
profile views and crossed with the up-to-conjugacy/up-to-automorphism
toggle. The diagram shows the whole group above the classes of maximal
subgroups, built from the stored maximal column, so it displays even for
groups whose full subgroup diagram is disabled for size (32.45,
1024.dke), and the profile lists maximal subgroups even when inclusions
were never computed (1024.dip). Adds /maximal_diagram/<label> and
/maximal_autdiagram/<label> fullpage routes and generalizes the
mode-toggle javascript from pairs to option groups.

Verified with the abstract groups test suites (test_abstract_groups.py 8
passed including a new test, test_browse_page.py 71 passed), pyflakes, and
by exercising all mode combinations in a browser on 24.12, 32.45,
1024.dke, 1024.dip, 128.2328, 336.208 and 1.1 with no JS console errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The added tests could pass with no maximal graph generated: they matched
the header divs that abstract-show-group.html emits for every group, empty
slot or not, and the fullpage route titles, which render even when
diagram_js_string() returns "".

Test the graphs instead.  A helper parses the make_sdiagram payload out of
a page, so a test can assert which of the six graph slots is filled and
with which nodes and edges.  We now check the node and edge sets of
subgroup_lattice("maximal", "") and ("maximal", "aut") for 32.45, where 15
classes of maximal subgroups fuse into 2 up to automorphism while the
118-class subgroup diagram is suppressed; the slots embedded in the group
page; the payload of both fullpage routes for 24.12 and 32.45; and the
maximal profile of 1024.dip, whose subgroup inclusions were never computed.

Verified by mutation: ten deliberate defects (maximal slots never filled,
whole group dropped, a maximal class omitted, a nonmaximal class included,
a missing star edge, reversed star edges, no deduplication by aut_label, a
fullpage title with no payload, the profile lost when inclusions are
unknown, altered 24.12 profile contents) each make the tests fail.  The
button matrix was also exercised in a browser on all three groups.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jenpaulhus

Copy link
Copy Markdown
Contributor

If I click on "maximal subgroups", it gives them as a vertical line which suggest they are contained in each other. Here's D20:

Screenshot 2026-08-06 at 17 50 23

The maximal subgroup diagram is a star: n classes of maximal subgroups plus
the whole group give n+1 nodes and n edges, which is exactly the test that
Layout.islinear() used to decide a diagram is a chain and lay it out in a
single column.  Every maximal diagram was therefore drawn as a vertical line,
suggesting that each class is contained in the one above it, and classes
sharing a row landed on top of each other (D_20, reported on the pull
request, drew three classes of order 20 at one point).

islinear() now also requires that the nodes, sorted by height, are joined
consecutively by edges, which is when a single column is honest.

The stored diagramx lays out the full subgroup lattice and says nothing about
the maximal star, leaving the whole group off center (at 6587 in a 3020-9234
span for 40.6) or right on top of one of its maximal subgroups (32.45), so
maximal_diagram_x now computes the coordinates for that diagram: the classes
fan out in decreasing order of size with the whole group centered above them.
They have to be spread even when they sit on different rows, since the three
classes of S4 have three different orders and would otherwise stack up again.

Verified in a browser on 40.6, 24.12, 32.45 and the fullpage routes, in both
conj/aut and both height modes, and on the one-class and no-class ends (5.1,
1.1).  test_maximal_subgroups_layout covers the coordinates and fails against
the old main.py.  Replaying the two islinear rules over every graph emitted on
406 group pages and 250 modular curve pages, which share graph.js, the only
diagrams they disagree on are the maximal ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@roed-math

Copy link
Copy Markdown
Contributor Author

Good catch, thank you. That was not just D20: every maximal subgroups diagram was drawn as a
vertical line.

The layout code in static/graphs/graph.js decided a diagram was a chain, and so laid it out in a
single column, whenever it had one more node than edge. The maximal subgroups diagram is a star, so n
classes plus the whole group give n+1 nodes and n edges and it always tripped that test. On D20 the
three classes of order 20 share a row too, so they were all drawn at the same point, which is the
smudged D_10 in your screenshot.

islinear() now also asks that the nodes, sorted by height, be joined consecutively by edges, which is
when a single column is honest. I also had to compute the x coordinates for this diagram rather than
reuse the ones stored for the full subgroup lattice, which say nothing about the star: they left the
whole group off center for D20, and directly on top of one of its maximal subgroups for 32.45. The
classes now fan out in decreasing order of size with the whole group centered above them. They have to
be spread even when they land on different rows, since the three maximal subgroups of S4 have three
different orders, one per row, and would otherwise stack right back up into a column.

Checked in a browser on 40.6, 24.12 and 32.45 (15 classes), on the fullpage routes, and in both the
conjugacy/automorphism and both height modes, plus the small ends 5.1 and 1.1. test_maximal_subgroups_layout
covers the coordinates. Since graph.js is shared with the modular curve diagrams, I also replayed the
old and new rules over every graph emitted on 406 group pages and 250 modular curve pages: the only
diagrams they disagree about are the maximal ones.

@roed314

roed314 commented Aug 7, 2026

Copy link
Copy Markdown
Member

I put this up on pink (click Maximal subgroups to see it).

@jwj61

jwj61 commented Aug 7, 2026

Copy link
Copy Markdown
Member

I looked at the link to the diagram for $$D_20$$. Why does it include the group itself -- it is not a maximal subgroup?

I also don't see the utility in a graph of the poset of maximal subgroups; it is always just $$k$$ points with no inclusions.

@jenpaulhus

Copy link
Copy Markdown
Contributor

The "graph" does put them in relative vertical position based on order or # of prime divisors which could be valuable info. (More useful for larger groups with more obscure subgroup names, see 1440.383 for example.)

It also does give a visual sense of the collapse of particular groups when moving from classifying up to conjugation to automorphism.

Perhaps we can make the full group not clickable in the minimal subgroup diagram? Or additionally make it a lighter color?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maximal subgroups

4 participants