Skip to content

Commit

Permalink
Commutator of two subgroups, derived series.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandar Makelov committed Aug 20, 2012
1 parent fe7270a commit 8050c65
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sympy/combinatorics/perm_groups.py
Expand Up @@ -907,6 +907,18 @@ def prop(g):
elif hasattr(other, 'array_form'):
return self.centralizer(PermutationGroup([other]))

def commutator(self, G, H):
ggens = G.generators
hgens = H.generators
commutators = []
for ggen in ggens:
for hgen in hgens:
commutator = hgen*ggen*(~hgen)*(~ggen)
if commutator not in commutators:
commutators.append(commutator)
res = self.normal_closure(commutators)
return res

def coset_decomposition(self, g):
"""
Decompose `g` as h_0*...*h_{len(u)}
Expand Down Expand Up @@ -1086,6 +1098,16 @@ def degree(self):
"""
return self._degree

def derived_series(self):
res = [self]
current = self
next = self.derived_subgroup()
while current != next:
res.append(next)
current = next
next = next.derived_subgroup()
return res

def derived_subgroup(self):
"""
Compute the derived subgroup.
Expand Down

0 comments on commit 8050c65

Please sign in to comment.