-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
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_cyclic
because of
if not self._is_abelian:
which gives a false positive forNone
I've made
is_abelian
cache to update wheneveris_cyclic
holdsTrue
.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_cyclic
giving wrong result for the cyclic groups created with explicitly specified generators.PermutationGroup.is_cyclic
automatically updates the cache foris_abelian
.PermutationGroup.is_cyclic
to detect some trivial cases like the group order of15
,35
, etc.