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

group theory: more efficient Sylow subgroups for Sym and Alt groups #13150

Merged
merged 7 commits into from Aug 27, 2017

Conversation

Projects
None yet
2 participants
@valglad
Contributor

valglad commented Aug 18, 2017

This PR adds a separate method _sylow_alt_sym for computation of Sylow subgroups of symmetric and alternating groups, to be used as part of the main sylow_subgroup method. This is much more efficient than the general approach, so that for example, a 3-Sylow subgroup of SymmetricGroup(100) can be found within a hundredth of a second compared to more than a minute that it currently takes (probably much more, I stopped waiting).

Additionally, is_alt_sym is slightly modified to handle the case of permutation groups of degree less than 8.

Show outdated Hide outdated sympy/combinatorics/perm_groups.py
# subgroup on [0..p**(i-1)-1]
for i in range(1, power+1):
gen = Permutation([(j + p**(i-1)) % p**i for j in range(p**i)])
if alt and gen == Permutation(0, 1):

This comment has been minimized.

@jksuom

jksuom Aug 18, 2017

Member

Could the test be if i == 1 and alt: (before gen is created)?

@jksuom

jksuom Aug 18, 2017

Member

Could the test be if i == 1 and alt: (before gen is created)?

This comment has been minimized.

@valglad

valglad Aug 18, 2017

Contributor

Yes, that would be better.

@valglad

valglad Aug 18, 2017

Contributor

Yes, that would be better.

Show outdated Hide outdated sympy/combinatorics/perm_groups.py
# shift the generator to the start of the
# partition part
gen = shift*gen*shift
gens.append(gen)

This comment has been minimized.

@jksuom

jksuom Aug 24, 2017

Member

It seems that this is not necessary when start == 0 (no shift).

@jksuom

jksuom Aug 24, 2017

Member

It seems that this is not necessary when start == 0 (no shift).

valglad added some commits Aug 24, 2017

better generators for alt and change alt check
This commit rearranges and modifies the code related to generators
of alternating groups so that they are consistent with those
desribed in the docstring. Also, the check for whether a group is
alternating is replaced by considering its order: checking if (0 1)
is contained in the group takes far too long for large degrees.

@jksuom jksuom merged commit 6d502a6 into sympy:master Aug 27, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@valglad valglad deleted the valglad:alt_sym_sylow branch Aug 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment