Пример #1
0
    def cusps(self, algorithm='default'):
        r"""
        Return a sorted list of inequivalent cusps for self, i.e. a set of
        representatives for the orbits of self on `\mathbb{P}^1(\QQ)`.
        These should be returned in a reduced form where this makes sense.

        INPUTS:

        - ``algorithm`` -- which algorithm to use to compute the cusps of self.
          ``'default'`` finds representatives for a known complete set of
          cusps. ``'modsym'`` computes the boundary map on the space of weight
          two modular symbols associated to self, which finds the cusps for
          self in the process.

        EXAMPLES::

            sage: Gamma0(36).cusps()
            [0, 1/18, 1/12, 1/9, 1/6, 1/4, 1/3, 5/12, 1/2, 2/3, 5/6, Infinity]
            sage: Gamma0(36).cusps(algorithm='modsym') == Gamma0(36).cusps()
            True
            sage: GammaH(36, [19,29]).cusps() == Gamma0(36).cusps()
            True
            sage: Gamma0(1).cusps()
            [Infinity]
        """
        try:
            return copy(self._cusp_list[algorithm])
        except (AttributeError, KeyError):
            self._cusp_list = {}

        from congroup_sl2z import is_SL2Z
        if is_SL2Z(self):
            from sage.modular.cusps import Cusp
            s = [Cusp(1, 0)]

        if algorithm == 'default':
            s = self._find_cusps()
        elif algorithm == 'modsym':
            s = sorted(
                [self.reduce_cusp(c) for c in self.modular_symbols().cusps()])
        else:
            raise ValueError, "unknown algorithm: %s" % algorithm

        self._cusp_list[algorithm] = s
        return copy(s)
Пример #2
0
    def cusps(self, algorithm='default'):
        r"""
        Return a sorted list of inequivalent cusps for self, i.e. a set of
        representatives for the orbits of self on `\mathbb{P}^1(\QQ)`.
        These should be returned in a reduced form where this makes sense.

        INPUTS:
        
        - ``algorithm`` -- which algorithm to use to compute the cusps of self.
          ``'default'`` finds representatives for a known complete set of
          cusps. ``'modsym'`` computes the boundary map on the space of weight
          two modular symbols associated to self, which finds the cusps for
          self in the process.

        EXAMPLES::

            sage: Gamma0(36).cusps()
            [0, 1/18, 1/12, 1/9, 1/6, 1/4, 1/3, 5/12, 1/2, 2/3, 5/6, Infinity]
            sage: Gamma0(36).cusps(algorithm='modsym') == Gamma0(36).cusps()
            True
            sage: GammaH(36, [19,29]).cusps() == Gamma0(36).cusps()
            True
            sage: Gamma0(1).cusps()
            [Infinity]
        """
        try:
            return copy(self._cusp_list[algorithm])
        except (AttributeError,KeyError):
            self._cusp_list = {}
        
        from congroup_sl2z import is_SL2Z
        if is_SL2Z(self):
            from sage.modular.cusps import Cusp
            s = [Cusp(1,0)]

        if algorithm == 'default':
            s = self._find_cusps()
        elif algorithm == 'modsym':
            s = sorted([self.reduce_cusp(c) for c in self.modular_symbols().cusps()])
        else:
            raise ValueError, "unknown algorithm: %s"%algorithm

        self._cusp_list[algorithm] = s
        return copy(s)