def __init__(self, P, part): """ Initialize ``self``. EXAMPLES:: sage: G = Permutations(5) sage: g = G([2, 1, 4, 5, 3]) sage: C = G.conjugacy_class(g) sage: TestSuite(C).run() sage: C = G.conjugacy_class(Partition([3,2])) sage: TestSuite(C).run() """ if isinstance(part, Permutation) and part.parent() is P: elt = part part = elt.cycle_type() else: elt = P.element_in_conjugacy_classes(part) SymmetricGroupConjugacyClassMixin.__init__(self, range(1, P.n+1), part) ConjugacyClass.__init__(self, P, elt)
def conjugacy_class(self, g): r""" Return the conjugacy class of the element ``g``. This is a fall-back method for groups not defined over GAP. EXAMPLES:: sage: A = AbelianGroup([2,2]) sage: c = A.conjugacy_class(A.an_element()) sage: type(c) <class 'sage.groups.conjugacy_classes.ConjugacyClass_with_category'> """ from sage.groups.conjugacy_classes import ConjugacyClass return ConjugacyClass(self, g)
def conjugacy_class(self): r""" Return the conjugacy class of ``self``. OUTPUT: The conjugacy class of ``g`` in the group ``self``. If ``self`` is the group denoted by `G`, this method computes the set `\{x^{-1}gx\ \vert\ x\in G\}`. EXAMPLES:: sage: G = SL(2, GF(2)) sage: g = G.gens()[0] sage: g.conjugacy_class() Conjugacy class of [1 1] [0 1] in Special Linear Group of degree 2 over Finite Field of size 2 """ from sage.groups.conjugacy_classes import ConjugacyClass return ConjugacyClass(self.parent(), self)