示例#1
0
    def example(self):
        """
        EXAMPLES::

            sage: Groups().example()
            General Linear Group of degree 4 over Rational Field
        """
        from sage.rings.rational_field import QQ
        from sage.groups.matrix_gps.linear import GL
        return GL(4, QQ)
示例#2
0
    def example(self):
        """
        Returns an example of finite group, as per
        :meth:`Category.example`.

        EXAMPLES::

            sage: G = FiniteGroups().example(); G
            General Linear Group of degree 2 over Finite Field of size 3
        """
        from sage.groups.matrix_gps.linear import GL
        return GL(2, 3)
示例#3
0
    def __setstate__(self, state):
        """
        Restore from old pickle.

        EXAMPLES::

            sage: from sage.groups.group import Group
            sage: from sage.groups.matrix_gps.pickling_overrides import LegacyGeneralLinearGroup
            sage: state = dict()
            sage: state['_MatrixGroup_gap__n'] = 2
            sage: state['_MatrixGroup_gap__R'] = ZZ
            sage: M = Group.__new__(LegacyGeneralLinearGroup)
            sage: M.__setstate__(state)
            sage: M
            General Linear Group of degree 2 over Integer Ring
        """
        ring = state['_MatrixGroup_gap__R']
        n = state['_MatrixGroup_gap__n']
        G = GL(n, ring)
        self.__init__(G.degree(), G.base_ring(), G._special, G._name_string, G._latex_string)
示例#4
0
    def __init__(self, degree, ring):
        """
        Initialize ``self``.

        INPUT:

        - ``degree`` -- integer. The degree of the affine group, that
          is, the dimension of the affine space the group is acting on
          naturally.

        - ``ring`` -- a ring. The base ring of the affine space.

        EXAMPLES::

            sage: Aff6 = AffineGroup(6, QQ)
            sage: Aff6 == Aff6
            True
            sage: Aff6 != Aff6
            False

        TESTS::

            sage: G = AffineGroup(2, GF(5)); G
            Affine Group of degree 2 over Finite Field of size 5
            sage: TestSuite(G).run()
            sage: G.category()
            Category of finite groups

            sage: Aff6 = AffineGroup(6, QQ)
            sage: Aff6.category()
            Category of infinite groups
        """
        self._degree = degree
        cat = Groups()
        if degree == 0 or ring in Rings().Finite():
            cat = cat.Finite()
        elif ring in Rings().Infinite():
            cat = cat.Infinite()
        self._GL = GL(degree, ring)
        Group.__init__(self, base=ring, category=cat)
示例#5
0
    def ProjectiveLine(p, r=None, u=None):
        r"""
        Return the projective line with action given by the matrices ``r``
        and ``u`` on the projective line over the field with ``p`` elements.

        If ``r`` and ``u`` are None, then r and u are choosen to be

        .. MATH::

            r: z \mapsto z+1   \qquad    u: z \mapsto 1/z

        The monodromy of this origami is included in `PGL(2,\ZZ/p\ZZ)`.

        EXAMPLES::

            sage: from surface_dynamics.all import *

        By default, the matrix used to generate the projective line origami are
        given by `z -> z+1` and `z -> 1/z` which gives a family of origamis
        which belongs to the strata ``H(2^k)``::

            sage: o = origamis.ProjectiveLine(3); o
            Projective line origami on GF(3)
             r = [1 1]    u = [0 1]
                 [0 1]        [1 0]
            sage: o.stratum()
            H_2(2)
            sage: o.veech_group().index()
            9
            sage: o.sum_of_lyapunov_exponents()
            4/3

            sage: o = origamis.ProjectiveLine(5); o
            Projective line origami on GF(5)
             r = [1 1]    u = [0 1]
                 [0 1]        [1 0]
            sage: o.stratum()
            H_3(2^2)
            sage: o.veech_group().index()
            9
            sage: o.sum_of_lyapunov_exponents()
            5/3

            sage: o = origamis.ProjectiveLine(7); o
            Projective line origami on GF(7)
             r = [1 1]    u = [0 1]
                 [0 1]        [1 0]
            sage: o.stratum()
            H_3(2^2)
            sage: o.veech_group().index()
            45
            sage: o.sum_of_lyapunov_exponents()
            5/3

        Any invertible matrix mod p can be choosed to generate the origami::

            sage: r = matrix([[1,3],[0,1]])
            sage: u = matrix([[1,0],[3,1]])
            sage: o = origamis.ProjectiveLine(5,r,u); o
            Projective line origami on GF(5)
             r = [1 3]    u = [1 0]
                 [0 1]        [3 1]
            sage: o.veech_group().index()
            10
            sage: o.sum_of_lyapunov_exponents()
            9/5
            sage: o.stratum_component()
            H_3(4)^hyp
        """
        from sage.arith.all import is_prime
        from sage.rings.finite_rings.finite_field_constructor import GF
        from sage.groups.matrix_gps.linear import GL
        from sage.modules.free_module import VectorSpace

        p = ZZ(p)
        if not p.is_prime():
            raise ValueError("p (={}) must be a prime number".format(p))

        G = GL(2,GF(p))
        V = VectorSpace(GF(p),2)

        if r is None:
            mr = G([[1,1],[0,1]])
        else:
            mr = G(r)
        if u is None:
            mu = G([[0,1],[1,0]])
        else:
            mu = G(u)

        sr = str(mr).split('\n')
        su = str(mu).split('\n')

        mr = mr
        mu = mu

        if r is None and u is None:
            positions = [(i,0) for i in xrange(p+1)]
        else:
            positions = None

        r = []
        u = []
        for i in xrange(p):
            v = V((i,1)) * mr
            if v[1]:
                r.append(int(v[0]/v[1]))
            else:
                r.append(p)

            v = V((i,1)) * mu
            if v[1]:
                u.append(int(v[0]/v[1]))
            else:
                u.append(p)

        v = V((1,0)) * mr
        if v[1]:
            r.append(int(v[0]/v[1]))
        else:
            r.append(p)

        v = V((1,0)) * mu
        if v[1]:
            u.append(int(v[0]/v[1]))
        else:
            u.append(p)

        o = Origami(r,u,
            as_tuple=True,
            positions=positions,
            name="Projective line origami on GF(%d)\n r = %s    u = %s\n     %s        %s"%(p,sr[0],su[0],sr[1],su[1]))
        return o