Skip to content

Display group hashes and identify groups from a description (LMFDB#5556)#44

Open
roed-math wants to merge 1 commit into
mainfrom
ai/t23-group-hashes
Open

Display group hashes and identify groups from a description (LMFDB#5556)#44
roed-math wants to merge 1 commit into
mainfrom
ai/t23-group-hashes

Conversation

@roed-math

Copy link
Copy Markdown
Owner

Surfaces the isomorphism-invariant group hash in the finite groups interface and adds a
group-identification tool. Abstract group homepages now show the stored hash (with a search
link) whenever it is informative (present and unequal to the label counter), there is an
optional off-by-default "Hash" search column, and the two hash placeholders in the subgroup
data popups are linkified. A new /Groups/Abstract/identify endpoint (with a form on the index
page and jump-box wiring for permutation input) lets a user enter permutation generators, a PC
code, or matrix generators; the server computes the LMFDB (Magma) hash in-process via libgap —
a faithful port of the FiniteGroups Hash.m — using strict parsers that never eval user input,
a 10^6 order cap, and alarm() timeouts. Results go through GAP identification (a proof), the
complete gps_smallhash tables (a unique match is a proof), then an (order, hash) lookup in
gps_groups, always with mathematically honest messaging that a hash match alone does not prove
isomorphism. Verified by reproducing many stored hashes against the database, exercising every
input/lookup/error/timeout path through the Flask test client, and running the abstract-groups
and browse-page test suites (pyflakes clean). Subgroup homepages are unchanged because the
subgroup/quotient hash columns are entirely NULL in the current data.
Addresses LMFDB#5556.

🤖 Generated with Claude Code

Part (a): surface the isomorphism-invariant hash in the finite groups
interface. Abstract group homepages show the stored hash (with a search
link) whenever it is informative, i.e. hash is present and differs from
the label counter; add an optional, off-by-default "Hash" search column;
and linkify the two hash TODO popups in group_data. Subgroup pages get
nothing (subgroup_hash/quotient_hash are entirely NULL in the DB).

Part (b): new /Groups/Abstract/identify endpoint plus a form on the index
page and jump-box wiring for permutation input. The server computes the
LMFDB (Magma) hash in-process via libgap -- a faithful port of Hash.m in
new file identify.py -- with strict, no-eval parsers for permutation
generators, PC codes and matrices, a 10^6 order cap, and cysignals
alarm() timeouts. Lookup goes IdGroup (proof) -> gps_smallhash (complete
tables) -> (order, hash) on gps_groups, with mathematically honest
messaging (a hash match is not an isomorphism proof).

Verified: libgap hash port reproduces every stored value tested (512.11,
1536.947, 2016.i, 6561.4, 5120.cs, 1024.a, M11, Sp(4,3), abelian cases);
identify redirects/lists/errors and the alarm timeout+recovery exercised
via the Flask test client; new pytest cases and the full
test_abstract_groups.py (12) and test_browse_page.py (71) pass; pyflakes
clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants