Skip to content

Commit

Permalink
take domain into account when conjugating a group
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Dec 18, 2023
1 parent 266285c commit deb50e2
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/sage/groups/perm_gps/permgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2622,12 +2622,32 @@ def conjugate(self, g):
Traceback (most recent call last):
...
TypeError: junk does not convert to a permutation group element
The domain is taken into account properly::
sage: G = PermutationGroup([['b','c','a']], domain=['a','b','c'])
sage: G.conjugate([('a', 'b')])
Permutation Group with generators [('a','c','b')] and domain {'a', 'b', 'c'}
"""
if self._has_natural_domain():
try:
g = PermutationConstructor(g)
except Exception:
raise TypeError("{0} does not convert to a permutation group element".format(g))
return PermutationGroup(gap_group=libgap.ConjugateGroup(self, g))

try:
g = PermutationConstructor(g)
except Exception:
raise TypeError("{0} does not convert to a permutation group element".format(g))
return PermutationGroup(gap_group=libgap.ConjugateGroup(self, g))
g = self(g)
except (ValueError, KeyError):
try:
H = PermutationGroup(gens=[g], domain=self.domain())
g = H.gen(0)
except Exception:
gens = [tuple([g(e) for e in x.tuple()]) for x in self.gens()]
return PermutationGroup(gens=gens)

return PermutationGroup(gap_group=libgap.ConjugateGroup(self, g._gap_()),
domain=self.domain())

def direct_product(self, other, maps=True):
"""
Expand Down

0 comments on commit deb50e2

Please sign in to comment.