Accept the family names printed on group pages in the abstract groups jump box - #7182
Merged
Merged
Conversation
…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>
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_jumpmatches the input against theinputregexes ingps_families, which spell each family the way it is stored. Neither name printed on a group page always agrees with that spelling:tex_name. For the orthogonal and unitary families that uses other letters (Orthprints as O,GOrthas GO,Unitaryas U,GUnitaryas GU), and the Plus and Minus families print with a +/- exponent.magma_cmd, which differs again:Orthis Magma'sGO,GOrthis Magma'sCO,GSOisCSO,GSpisCSp,POisPGO,PUisPGU.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);andG := CO(5,3);in its code snippets. Before this change none of those four strings could be pasted into the jump box:What this does
Adds
FAMILY_NAME_ALIASES, which rewrites the family part of aFam(n,q)name onto the stored spelling before thegps_familiesregexes are tried:O,O+,O-,GO,GO+,GO-,U,GU, and+/-in place ofPlus/MinusforSO,GSO,PSO,PO,Omega,POmegaandSpin;CO,COPlus,COMinus,CSO,CSOPlus,CSOMinus,CSp,CSU,CU,PGO,PGOPlus,PGOMinus,PGU, where that spelling is not already in use.GO(5,3)andO(5,3)now both reach 103680.a.The one judgment call
Magma's
GO,GOPlus,GOMinusandGUare deliberately not accepted. We use theGprefix for similitude groups, consistently across Sp/GSp, SO/GSO, SU/GSU, U/GU and O/GO, whereas Magma usesGfor isometries andCfor similitudes. So LMFDB's GO(n,q) is Magma's CO(n,q), and readingGOMagma's way would silently return a different group from the one the page shows under that name.GOtherefore resolves toGOrth.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
OrthandGOrth. Happy to flip the convention if the group folks would rather match Magma.Notes
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.test_family_name_alias_lookup, with one stored example per alias, kept in sync with the table by an assertion.Sym(n),AlternatingGroup(n),CyclicGroup(n),DihedralGroup(n),DicyclicGroup(n),ChevalleyGroup(...)).🤖 Generated with Claude Code