Exemplo n.º 1
0
    def conjugacy_classes(self):
        r"""
        Return a list with all the conjugacy classes of ``self``.

        EXAMPLES::

            sage: G = SL(2, GF(2))
            sage: G.conjugacy_classes()
            (Conjugacy class of [1 0]
             [0 1] in Special Linear Group of degree 2 over Finite Field of size 2,
             Conjugacy class of [0 1]
             [1 0] in Special Linear Group of degree 2 over Finite Field of size 2,
             Conjugacy class of [0 1]
             [1 1] in Special Linear Group of degree 2 over Finite Field of size 2)

        ::

            sage: GL(2,ZZ).conjugacy_classes()
            Traceback (most recent call last):
            ...
            NotImplementedError: only implemented for finite groups
        """
        if not self.is_finite():
            raise NotImplementedError("only implemented for finite groups")
        from sage.groups.conjugacy_classes import ConjugacyClassGAP
        return tuple(
            ConjugacyClassGAP(self, self(g))
            for g in self.conjugacy_classes_representatives())
Exemplo n.º 2
0
    def __init__(self, group, part):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: G = SymmetricGroup(5)
            sage: g = G([(1,2), (3,4,5)])
            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, PermutationGroupElement) and part.parent() is group:
            elt = part
            part = sorted([len(x) for x in part.cycle_tuples(True)], reverse=True)
        else:
            elt = default_representative(part, group)
        SymmetricGroupConjugacyClassMixin.__init__(self, group.domain(), part)
        ConjugacyClassGAP.__init__(self, group, elt)
Exemplo n.º 3
0
    def conjugacy_class(self):
        r"""
        Return the conjugacy class of ``self``.

        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 ConjugacyClassGAP
        return ConjugacyClassGAP(self.parent(), self)
Exemplo n.º 4
0
    def __init__(self, group, part):
        """
        Initialize ``self``.

        EXAMPLES::

            sage: G = SymmetricGroup(5)
            sage: g = G([(1,2), (3,4,5)])
            sage: C = G.conjugacy_class(g)
            sage: TestSuite(C).run()
            sage: C = G.conjugacy_class(Partition([3,2]))
            sage: TestSuite(C).run()
        """
        P = Partitions_n( len(group.domain()) )
        if isinstance(part, PermutationGroupElement) and part.parent() is group:
            elt = part
            part = P( sorted(map(len, part.cycle_tuples(True)), reverse=True) )
        else:
            part = P(part)
            elt = default_representative(part, group)
        self._part = part
        self._set = None
        ConjugacyClassGAP.__init__(self, group, elt)
Exemplo n.º 5
0
    def conjugacy_classes(self):
        r"""
        Return a list with all the conjugacy classes of ``self``.

        EXAMPLES::

            sage: G = SL(2, GF(2))
            sage: G.conjugacy_classes()
            (Conjugacy class of [1 0]
             [0 1] in Special Linear Group of degree 2 over Finite Field of size 2,
             Conjugacy class of [0 1]
             [1 0] in Special Linear Group of degree 2 over Finite Field of size 2,
             Conjugacy class of [0 1]
             [1 1] in Special Linear Group of degree 2 over Finite Field of size 2)
        """
        from sage.groups.conjugacy_classes import ConjugacyClassGAP
        return tuple(
            ConjugacyClassGAP(self, self(g))
            for g in self.conjugacy_class_representatives())
Exemplo n.º 6
0
    def conjugacy_class(self, g):
        r"""
        Return the conjugacy class of ``g``.

        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, QQ)
            sage: g = G([[1,1],[0,1]])
            sage: G.conjugacy_class(g)
            Conjugacy class of [1 1]
            [0 1] in Special Linear Group of degree 2 over Rational Field
        """
        from sage.groups.conjugacy_classes import ConjugacyClassGAP
        return ConjugacyClassGAP(self, self(g))
Exemplo n.º 7
0
    def conjugacy_classes(self):
        r"""
        Return a list with all the conjugacy classes of ``self``.

        EXAMPLES::

            sage: G = SL(2, GF(2))
            sage: G.conjugacy_classes()
            [Conjugacy class of [1 0]
            [0 1] in Special Linear Group of degree 2 over Finite Field of size 2, Conjugacy class of [0 1]
            [1 0] in Special Linear Group of degree 2 over Finite Field of size 2, Conjugacy class of [0 1]
            [1 1] in Special Linear Group of degree 2 over Finite Field of size 2]
        """
        CC = self._gap_().ConjugacyClasses()
        reps = list(gap.List(CC, 'x -> Representative(x)'))
        return [
            ConjugacyClassGAP(self,
                              self(g._matrix_(self.field_of_definition())))
            for g in reps
        ]
Exemplo n.º 8
0
    def conjugacy_class(self, g):
        r"""
        Return the conjugacy class of ``g`` inside of ``self``.

        INPUT:

        - ``g`` -- an element 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(3, GF(3))
            sage: g = G.gens()[0]
            sage: G.conjugacy_class(g)
            Conjugacy class of [1 1 0]
            [0 1 0]
            [0 0 1] in Special Linear Group of degree 3 over Finite Field of size 3
        """
        return ConjugacyClassGAP(self, g)