-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Improve is_cyclic #17781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve is_cyclic #17781
Conversation
|
✅ Hi, I am the SymPy bot (v149). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
|
Would it be expensive to check first that the group is abelian? Then, I think, |
|
This case takes I just added the suggestion as a trivial case when the cache is warm. |
|
Then this looks like a good method. Still, I wonder why checking commutativity is so expensive. Maybe that could be improved. |
References to other Issues or PRs
Brief description of what is fixed or changed
is_cyclicbecause of
if not self._is_abelian:which gives a false positive forNoneI've made
is_abeliancache to update wheneveris_cyclicholdsTrue.I've also added an additional lemma when the order is square-free.
Other comments
I've also updated the documentation

Release Notes
PermutationGroup.is_cyclicgiving wrong result for the cyclic groups created with explicitly specified generators.PermutationGroup.is_cyclicautomatically updates the cache foris_abelian.PermutationGroup.is_cyclicto detect some trivial cases like the group order of15,35, etc.