Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-36814: Fast cardinality method for IntegerVectorsModPermut…
…ationGroup # Fast cardinality method for IntegerVectorsModPermutationGroup This patch fixes sagemath#36787 by implementing a `cardinality` method for `IntegerVectorsModPermutationGroup_with_constraints`. The method calculates the cardinality using the the [Polya enumeration theorem](https://en.wikipedia.org/wiki/P%C3%B3lya_enumeration_theorem) (also known as the cycle index theorem). It is faster than the the default implementation, which iterates through the full set to find the cardinality. Incidentally this PR fixes also sagemath#36681 so that cardinality and iter no longer crash in empty-domain situations. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies - sagemath#36873: we can use `is_trivial` from that PR <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36814 Reported by: Jukka Kohonen Reviewer(s): Dima Pasechnik, Jukka Kohonen, Martin Rubey, Travis Scrimshaw
- Loading branch information