Use precomputed table of marks for functorial composition of species#42443
Open
mwhansen wants to merge 2 commits into
Open
Use precomputed table of marks for functorial composition of species#42443mwhansen wants to merge 2 commits into
mwhansen wants to merge 2 commits into
Conversation
The subgroup-based algorithm for functorial composition of species computes the table of marks of the symmetric group `S_n` for each coefficient. Computing it from the group is expensive and quickly becomes the limiting factor (and is infeasible past degree ~10). GAP's `tomlib` package ships precomputed tables of marks for the symmetric groups, which are essentially free to look up and available for a much larger range of degrees. Add a cached helper `_table_of_marks_symmetric_group` that uses the library table when available and falls back to computing it from the group otherwise, and use it in `_coefficient_subgroups`.
|
Documentation preview for this PR (built with commit ea38b53; changes) is ready! 🎉 |
`libgap.TableOfMarks("Sn")` raises a GAPError when the GAP tomlib
package is not installed, rather than returning `fail`. Catch the
error so we fall back to computing the table from the symmetric group,
as we already do for degrees that are not in the library.
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.
Summary
The subgroup-based algorithm for functorial composition of species$S_n$ for every coefficient.
(
LazyCombinatorialSpeciesElement.functorial_composition(..., algorithm="subgroups"))computes the table of marks of the symmetric group
Currently this is computed from the group via
libgap.TableOfMarks(S_n), which isexpensive and quickly becomes the limiting factor — it is effectively infeasible
past degree ~10.
GAP's
tomlibpackage ships precomputed tables of marks for the symmetric groups,which are essentially free to look up and available for a much larger range of degrees.
Measured cost of obtaining the table of marks of$S_n$ :
tomliblookupThis PR adds a cached helper
${1, \dots, n}$ , and
_table_of_marks_symmetric_group(n)that looks up thelibrary table when available and falls back to computing it from the group otherwise,
and uses it in
_coefficient_subgroups. The library tables are representation-compatiblewith the existing code (their underlying group is the natural symmetric group on
RepresentativeTomreturns subgroups of it), so the change istransparent.
Effect
feasible degree for the
"subgroups"algorithm from ~10 to ~13.sage/rings/lazy_species.pypass, and thecoefficients are identical to those computed from the group.
Notes
tomlibcovers a range of small degrees (roughlyTableOfMarksreturnsfailand we fall back to computing from the group, so there isno behavioural regression for any degree.