Skip to content

Accept the family names printed on group pages in the abstract groups jump box - #7182

Merged
roed314 merged 5 commits into
LMFDB:mainfrom
roed-math:ai/t09b-family-name-aliases
Aug 7, 2026
Merged

Accept the family names printed on group pages in the abstract groups jump box#7182
roed314 merged 5 commits into
LMFDB:mainfrom
roed-math:ai/t09b-family-name-aliases

Conversation

@roed-math

Copy link
Copy Markdown
Contributor

Follow-up to #7149, and stacked on it: this branch has #7149's commit as its parent, so the second commit is the change to review here. Once #7149 merges, this diff reduces to that commit.

Reported by @jenpaulhus in #7149 (comment): typing GO(5,3) into the abstract groups jump box says "is not a valid name for a group or subgroup", even though 103680.a is in the database and its own page prints that name.

What was wrong

group_jump matches the input against the input regexes in gps_families, which spell each family the way it is stored. Neither name printed on a group page always agrees with that spelling:

  • the Groups of Lie type row prints the family's tex_name. For the orthogonal and unitary families that uses other letters (Orth prints as O, GOrth as GO, Unitary as U, GUnitary as GU), and the Plus and Minus families print with a +/- exponent.
  • the Magma/GAP/Sage/Oscar snippets print magma_cmd, which differs again: Orth is Magma's GO, GOrth is Magma's CO, GSO is CSO, GSp is CSp, PO is PGO, PU is PGU.

So https://www.lmfdb.org/Groups/Abstract/103680.a displays O(5,3) and GO(5,3) in its Lie type row, and G := GO(5,3); and G := CO(5,3); in its code snippets. Before this change none of those four strings could be pasted into the jump box:

O(5,3)      -> rejected        Orth(5,3)      -> 103680.a
GO(5,3)     -> rejected        GOrth(5,3)     -> 103680.a
U(3,3)      -> rejected        Unitary(3,3)   -> 24192.a
GU(3,3)     -> rejected        GUnitary(3,3)  -> 48384.a

What this does

Adds FAMILY_NAME_ALIASES, which rewrites the family part of a Fam(n,q) name onto the stored spelling before the gps_families regexes are tried:

  • the printed names O, O+, O-, GO, GO+, GO-, U, GU, and +/- in place of Plus/Minus for SO, GSO, PSO, PO, Omega, POmega and Spin;
  • the Magma names CO, COPlus, COMinus, CSO, CSOPlus, CSOMinus, CSp, CSU, CU, PGO, PGOPlus, PGOMinus, PGU, where that spelling is not already in use.

GO(5,3) and O(5,3) now both reach 103680.a.

The one judgment call

Magma's GO, GOPlus, GOMinus and GU are deliberately not accepted. We use the G prefix for similitude groups, consistently across Sp/GSp, SO/GSO, SU/GSU, U/GU and O/GO, whereas Magma uses G for isometries and C for similitudes. So LMFDB's GO(n,q) is Magma's CO(n,q), and reading GO Magma's way would silently return a different group from the one the page shows under that name. GO therefore resolves to GOrth.

For n = 5, q = 3 the two readings coincide anyway: for odd n every similitude factor is a square, so CO(n,q) = F_q^* . GO(n,q) with intersection {+/-1} and |CO| = |GO| . (q-1)/2, which at q = 3 is |GO|. That is why 103680.a is stored under both Orth and GOrth. Happy to flip the convention if the group folks would rather match Magma.

Notes

  • Purely additive: no alias is an existing family name (asserted in test_family_name_aliases_are_unclaimed), so every input accepted today matches exactly as before, and the error messages keep the user's own spelling rather than the rewritten one.
  • Tested by test_family_name_alias_lookup, with one stored example per alias, kept in sync with the table by an assertion.
  • Not covered here, because they need argument rewriting rather than a prefix substitution: Magma's constructor-style names (Sym(n), AlternatingGroup(n), CyclicGroup(n), DihedralGroup(n), DicyclicGroup(n), ChevalleyGroup(...)).

🤖 Generated with Claude Code

roed314 and others added 5 commits July 19, 2026 01:21
…MFDB#6654)

Jump-box searches for family names that coincide with a stored family,
e.g. Sp(2,5)=SL(2,5) or PSp(2,5)=PSL(2,5), flashed "has not yet been
added" although the groups are in the database under the other name.
Add a FAMILY_ALIASES table used by group_jump to translate the
gps_special_names lookup for the exact coincidences Sp/PSp/GSp/ASp/
PSigmaSp/ASigmaSp in dimension 2 and Spin in dimension 3; the
valid_params fallback still sees the family the user typed so error
messages stay accurate.  Also refresh stale family names in
valid_params (CSp->GSp, GO->Orth, PGO->PO, CSO->GSO, CO->GOrth, add
ASp) to match current gps_families, as already done in web_groups.py.

Verified with a test-client script (Sp(2,5) and Sp(2, 5) -> 120.5,
PSp(2,5) -> 60.5, GSp(2,7) -> 2016.a, Spin(3,4) -> 60.5, stored
families such as Sp(4,3) unchanged) and new checks in
test_browse_page.py::test_lookup; pytest -k "lookup or famly" passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…DB#6654)

The jump-box tests only exercised four of the seven FAMILY_ALIASES entries,
and none of them reached valid_params, so the refreshed family names there
were untested.

- test_family_alias_lookup: a stored example for each FAMILY_ALIASES entry,
  including the previously untested ASp(2,2), PSigmaSp(2,5) and
  ASigmaSp(2,2), plus an assertion that the case list and FAMILY_ALIASES
  stay in sync.
- test_absent_family_lookup: valid but absent groups in both parity branches
  of valid_params, covering the newly accepted GSp/ASp and the renamed
  Orth*/PO*/GSO*/GOrth* identifiers, and two wrong-parity names that must
  still be reported as invalid.

Targets verified against gps_special_names (ASL(2,2)=ASigmaL(2,2)=24.12,
PSigmaL(2,5)=60.5) and every identifier in the two valid_params lists
checked against the distinct family values in gps_families.
Verified with sage -python -m pytest
lmfdb/groups/abstract/test_browse_page.py -k 'lookup or family or famly':
5 passed, 68 deselected; pyflakes clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
group_jump matches the input against the regexes in gps_families, which
spell each family the way it is stored, but neither name printed on a group
page always agrees with that spelling.  The "Groups of Lie type" row prints
the family's tex_name, and for the orthogonal and unitary families that uses
other letters (Orth prints as O, GOrth as GO, Unitary as U, GUnitary as GU)
and a +/- exponent for the Plus and Minus families; the code snippets print
magma_cmd, which differs again (Orth is Magma's GO, GOrth is Magma's CO).
So 103680.a shows O(5,3) and GO(5,3) in its Lie type row and GO(5,3) and
CO(5,3) in its snippets, and none of those four could be pasted into the
jump box.

Add FAMILY_NAME_ALIASES, rewriting the family part of a Fam(n,q) name onto
the stored spelling before the gps_families regexes are tried.  Magma's GO,
GOPlus, GOMinus and GU are left out: we print GO and GU for the conformal
groups Magma calls CO and CU, so honoring Magma's reading would return a
different group from the one shown under that name.  No alias is an existing
family name, so every input accepted today still matches as before, and the
error messages keep the user's own spelling.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The redirect tests could not catch a wrong target on their own: families
such as Orth and GOrth agree for many small parameters, so a typo like
"CO": "Orth" still redirected to the expected group.

Pull the rewrite out of group_jump into normalize_family_jump, so it can be
tested as a pure function, and add three tests that fix the meaning of the
table rather than just exercising it: an independently written copy of the
expected mapping, a check that each +/- alias agrees with the alias it is
the exponent form of, and a check of the Magma half against the magma_cmd
column the code snippets are generated from, which also asks for an alias
whenever a family's Magma name differs from its own.  Strengthen the
unclaimed-alias test to probe the gps_families input regexes at both
parities and two field sizes, since those regexes are what decides which
inputs are accepted.  Move the redirect examples to parameters where an
isometry group and its similitude group have different labels.

Deliberately mutating "CO", "GU" and "GO+" to Magma's reading now fails the
tests.

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

Copy link
Copy Markdown
Contributor

LGTM. I agree that we have decided not to default to Magma naming convention and so I agree with the choices Claude made here.

I do not think we should bother to accept magma commands like AlternatingGroup(n) in this box.

@roed314
roed314 merged commit 7b77062 into LMFDB:main Aug 7, 2026
13 checks passed
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.

3 participants