Ejemplo n.º 1
0
 def base_place(self):
     alpha = self.base_point
     beta = self.base_sheets[0]
     return RegularPlace(self, alpha, beta)
Ejemplo n.º 2
0
 def setUp(self):
     # create some dummy places
     self.P = RegularPlace(None,0,1,name='P')
     self.Q = RegularPlace(None,2,3,name='Q')
     self.R = RegularPlace(None,4,5,name='R')
Ejemplo n.º 3
0
    def places(self, alpha, beta=None):
        r"""Returns a place or places on the Riemann surface with the given x-projection
        and, optionally, given y-projection.

        Parameters
        ----------
        alpha : complex
            The x-projection of the place.
        beta : complex
            If provided, will only return places with the given y-projection.
            There may be multiple places on the surface with the same x- and
            y-projections.

        Returns
        -------
        places : Place or list of Places
            Returns all places on the Riemann surface with x-projection `alpha`
            or x,y-projection `(alpha, beta)`, if `beta` is provided.

        """
        # alpha = infinity case
        infinities = [infinity, 'oo', numpy.Inf]
        if alpha in infinities:
            alpha = infinity
            p = puiseux(self.f, alpha)
            places = [DiscriminantPlace(self, pi) for pi in p]
            return places

        # if alpha is epsilon close to a discriminant point then set it exactly
        # equal to that discriminant point. there is usually no reason to
        # compute a puiseux series so close to a discriminant point
        try:
            alpha = QQbar(alpha)
            exact = True
        except TypeError:
            alpha = numpy.complex(alpha)
            exact = False
        b = self.path_factory.closest_discriminant_point(alpha, exact=exact)

        # if alpha is equal to or close to a discriminant point then return a
        # discriminant place
        if abs(alpha - b) < 1e-12:
            p = puiseux(self.f, b, beta)
            places = [DiscriminantPlace(self, pi) for pi in p]
            return places

        # otherwise, return a regular place if far enough away
        if not beta is None:
            curve_eval = self.f(alpha, beta)
            if abs(curve_eval) > 1e-8:
                raise ValueError(
                    'The place (%s, %s) does not lie on the curve '
                    '/ surface.' % (alpha, beta))
            place = RegularPlace(self, alpha, beta)
            return place

        # if a beta (y-coordinate) is not specified then return all places
        # lying above x=alpha
        R = self.f.parent()
        x, y = R.gens()
        falpha = self.f(alpha, y).univariate_polynomial()
        yroots = falpha.roots(ring=falpha.base_ring(), multiplicities=False)
        places = [RegularPlace(self, alpha, beta) for beta in yroots]
        return places
 def base_place(self):
     return RegularPlace(self, self.base_point, self.base_sheets[0])