Esempio n. 1
0
    def valuation_divisor(self, proof=False, **kwds):
        r"""Returns the valuation divisor of the Abelian differential of the first kind.

        Because Abelian differentials of the first kind are holomorphic on the
        Riemann surface, the valuation divisor is of the form

        .. math::

            (\omega)_{val} = p_1 P_1 + \cdots + p_m P_m

        where :math:`\omega` has a zero of multiplicity :math:`p_k` at the
        place :math:`P_k`.

        Parameters
        ----------
        proof : bool
            If set to `True`, will provably return the valuation divisor by
            computing the valuation at every necessary place on `X`. Slow.

        Notes
        -----
        This valuation divisor overload takes advantage of the fact that the
        differential admits no poles. Therefore, as places on the Riemann
        surface are checked, the degree of the valuation divisor is
        non-decreasing. We can terminate the search the moment the degree
        reaches :math:`2g-2`. If `proof=True` then ignore this trick and
        compute over every possible place.

        """
        xvalues = self._find_necessary_xvalues()

        # for each xvalue, compute the places above it and determine valuation
        # of the differential over each of these places.
        D = Divisor(self.RS,0)
        genus = self.RS.genus()
        target_genus = 2*genus - 2
        for alpha in xvalues:
            places_above_alpha = self.RS(alpha)
            for P in places_above_alpha:
                n = P.valuation(self)
                D += n*P

                # abelian differentials of the first kind should have no poles
                if n < 0:
                    raise ValueError(
                        'Could not compute valuation divisor of %s: '
                        'found a pole of differential of first kind.'%self)

                # break out if the target degree is met
                if (D.degree == target_genus) and (not proof):
                    return D

        if D.degree != target_genus:
            raise ValueError('Could not compute valuation divisor of %s: '
                             'did not reach genus requirement.'%self)
        return D
Esempio n. 2
0
    def valuation_divisor(self, **kwds):
        r"""Returns the valuation divisor of the Abelian differential of the second
        kind.

        Parameters
        ----------
        none

        Returns
        -------
        Divisor

        """
        xvalues = self._find_necessary_xvalues()

        # for each xvalue, compute the places above it and determine valuation
        # of the differential over each of these places.
        D = Divisor(self.RS,0)
        genus = self.RS.genus()
        target_genus = 2*genus - 2
        num_poles = 0
        for alpha in xvalues:
            places_above_alpha = self.RS(alpha)
            for P in places_above_alpha:
                n = P.valuation(self)
                D += n*P

                # differentials of the second kind should have a single
                # pole. raise an error if more are found
                if n < 0: num_poles += 1
                if num_poles > 1:
                    raise ValueError(
                        'Could not compute valuation divisor of %s: '
                        'found more than one pole.'%self)

                # break out if (a) the degree requirement is met and (b) the
                # pole was found.
                if (D.degree == target_genus) and (num_poles):
                    return D

        if D.degree != target_genus:
            raise ValueError('Could not compute valuation divisor of %s: '
                             'did not reach genus requirement.'%self)
        return D
Esempio n. 3
0
    def valuation_divisor(self, **kwds):
        r"""Returns the valuation divisor of the differential.

        This is a generic algorithm for computing valuation divisors and should
        only be used if nothing is known about the differential in question.

        If the differential is Abelian of the first kind (holomorphic) then
        create an instance of :class:`AbelianDifferentialFirstKind`. Similarly,
        if the differential is Abelian of the second kind then create an
        instance of :class:`AbelianDifferentialSecondKind`. These implement
        versions of :meth:`valuation_divisor` that use properties of the
        differential to save on time.

        Parameters
        ----------
        none

        Returns
        -------
        Divisor

        """
        xvalues = self._find_necessary_xvalues()

        # for each xvalue, compute the places above it and determine the
        # valuation of the differential over each of these places
        D = Divisor(self.RS,0)
        genus = self.RS.genus()
        for alpha in xvalues:
            places_above_alpha = self.RS(alpha)
            for P in places_above_alpha:
                n = P.valuation(self)
                D += n*P

        # the valuation divisor of a generic meromorphic differential is still
        # canonical. check the degree condition
        target_genus = 2*genus - 2
        if D.degree != target_genus:
            raise ValueError(
                'Could not compute valuation divisor of %s: '
                'did not reach genus requirement.'%self)
        return D
Esempio n. 4
0
    def test_zero(self):
        D = Divisor(None,0)
        self.assertTrue(D.is_zero())

        D = self.P - self.P
        self.assertTrue(D.is_zero())