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

groups: implemented .subgroup() method #12658

Merged
merged 15 commits into from Jun 13, 2017

Conversation

Projects
None yet
3 participants
@valglad
Contributor

valglad commented May 20, 2017

This PR implements a method .subgroup() for groups (both permutation and FpGroups) which takes the subgroup generators as the argument and returns another group whose parent is set to be the original group.

  • PermutationGroups: the method simply creates another PermutationGroup on the given generators. The use of .parent in the .is_subgroup() method allows for faster subgroup checking in some cases.

  • FpGroups: reidemeister_presentation() method returns the generators and relators for a presentation of the subgroup. These are instances of FreeGroupElement. To return an FpGroup based on them, it is necessary to create a FreeGroup on the generators first and make sure that the generators of this free group match up with those used in the relators. For this purpose I made it possible to create a FreeGroup by passing instances of FreeGroupElements to it.

The other changes are relatively minor and not directly relevant to the new method:

  • Generators of FpGroup are returned by the property .generators while a method .relators() has to be called for the relators. It feels a bit inconsistent so I made .relators a property.

  • Rearranged things in the file fp_groups.py to have properties all together near the top of the class definition.

  • Corrected a couple of typos, added a missing error message and slightly changed the description for the arguments of the FreeGroup class.

@@ -1712,6 +1726,19 @@ def reidemeister_presentation(fp_grp, H, elm_rounds=2, simp_rounds=2):
for i in range(20):
elimination_technique_1(C)
simplify_presentation(C)
syms = [g.array_form[0][0] for g in C._schreier_generators]
g = free_group(syms)[0]

This comment has been minimized.

@jksuom

jksuom Jun 10, 2017

Member

How is this related to C._schreier_free_group?

@jksuom

jksuom Jun 10, 2017

Member

How is this related to C._schreier_free_group?

This comment has been minimized.

@valglad

valglad Jun 10, 2017

Contributor

It's a free group on generators that have the same symbols as a subset of C._schreier_free_group's generators.

@valglad

valglad Jun 10, 2017

Contributor

It's a free group on generators that have the same symbols as a subset of C._schreier_free_group's generators.

@jksuom jksuom merged commit 1847ae9 into sympy:master Jun 13, 2017

1 check passed

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

@valglad valglad deleted the valglad:subgroups branch Jun 13, 2017

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