AUTHORS:
Bases: sage.groups.conjugacy_classes.ConjugacyClassGAP
A conjugacy class of the symmetric group.
INPUT:
Return the partition of self.
EXAMPLES:
sage: G = SymmetricGroup(5)
sage: g = G([(1,2), (3,4,5)])
sage: C = G.conjugacy_class(g)
The set of all elements in the conjugacy class self.
EXAMPLES:
sage: G = SymmetricGroup(3)
sage: g = G((1,2))
sage: C = G.conjugacy_class(g)
sage: S = [(2,3), (1,2), (1,3)]
sage: C.set() == Set(G(x) for x in S)
True
Return an iterator over the conjugacy class associated to the partition part.
The elements are given as a list of tuples, each tuple being a cycle.
INPUT:
EXAMPLES:
sage: from sage.groups.perm_gps.symgp_conjugacy_class import conjugacy_class_iterator
sage: for p in conjugacy_class_iterator([2,2]): print p
[(1, 2), (3, 4)]
[(1, 3), (2, 4)]
[(1, 4), (2, 3)]
In order to get permutations, one can use imap from the Python module itertools:
sage: from itertools import imap
sage: S = SymmetricGroup(5)
sage: for p in imap(S, conjugacy_class_iterator([3,2])): print p
(1,2)(3,4,5)
(1,2)(3,5,4)
(1,3)(2,4,5)
(1,3)(2,5,4)
...
(1,4,2)(3,5)
(1,2,3)(4,5)
(1,3,2)(4,5)
Check that the number of elements correspond to the number of elements in the conjugacy class
sage: s = lambda p: sum(1 for _ in conjugacy_class_iterator(p)) sage: all(s(p) == p.conjugacy_class_size() for p in Partitions(5)) True
It is also possible to specify any underlying set:
sage: it = conjugacy_class_iterator([2,2,2], 'abcdef')
sage: next(it)
[('a', 'c'), ('b', 'e'), ('d', 'f')]
sage: next(it)
[('a', 'c'), ('b', 'd'), ('e', 'f')]
Construct the default representative for the conjugacy class of cycle type part of a symmetric group G.
Let be a partition of
. We pick a representative by
where is the length (or number of parts) of
.
INPUT:
EXAMPLES:
sage: from sage.groups.perm_gps.symgp_conjugacy_class import default_representative
sage: S = SymmetricGroup(4)
sage: for p in Partitions(4):
....: print default_representative(p, S)
(1,2,3,4)
(1,2,3)
(1,2)(3,4)
(1,2)
()