def divisor_of_function(self, r): """ Return the divisor of a function on a curve. INPUT: r is a rational function on X OUTPUT: - ``list`` - The divisor of r represented as a list of coefficients and points. (TODO: This will change to a more structural output in the future.) EXAMPLES:: sage: F = GF(5) sage: P2 = AffineSpace(2, F, names = 'xy') sage: R = P2.coordinate_ring() sage: x, y = R.gens() sage: f = y^2 - x^9 - x sage: C = Curve(f) sage: K = FractionField(R) sage: r = 1/x sage: C.divisor_of_function(r) # todo: not implemented (broken) [[-1, (0, 0, 1)]] sage: r = 1/x^3 sage: C.divisor_of_function(r) # todo: not implemented (broken) [[-3, (0, 0, 1)]] """ F = self.base_ring() f = self.defining_polynomial() pts = self.places_on_curve() numpts = len(pts) R = f.parent() x, y = R.gens() R0 = PolynomialRing(F, 3, names=[str(x), str(y), "t"]) vars0 = R0.gens() t = vars0[2] divf = [] for pt0 in pts: if pt0[2] != F(0): lcs = self.local_coordinates(pt0, 5) yt = lcs[1] xt = lcs[0] ldg = degree_lowest_rational_function(r(xt, yt), t) if ldg[0] != 0: divf.append([ldg[0], pt0]) return divf
def divisor_of_function(self, r): """ Return the divisor of a function on a curve. INPUT: r is a rational function on X OUTPUT: - ``list`` - The divisor of r represented as a list of coefficients and points. (TODO: This will change to a more structural output in the future.) EXAMPLES:: sage: F = GF(5) sage: P2 = AffineSpace(2, F, names = 'xy') sage: R = P2.coordinate_ring() sage: x, y = R.gens() sage: f = y^2 - x^9 - x sage: C = Curve(f) sage: K = FractionField(R) sage: r = 1/x sage: C.divisor_of_function(r) # todo: not implemented (broken) [[-1, (0, 0, 1)]] sage: r = 1/x^3 sage: C.divisor_of_function(r) # todo: not implemented (broken) [[-3, (0, 0, 1)]] """ F = self.base_ring() f = self.defining_polynomial() pts = self.places_on_curve() numpts = len(pts) R = f.parent() x,y = R.gens() R0 = PolynomialRing(F,3,names = [str(x),str(y),"t"]) vars0 = R0.gens() t = vars0[2] divf = [] for pt0 in pts: if pt0[2] != F(0): lcs = self.local_coordinates(pt0,5) yt = lcs[1] xt = lcs[0] ldg = degree_lowest_rational_function(r(xt,yt),t) if ldg[0] != 0: divf.append([ldg[0],pt0]) return divf
def divisor_of_function(self, r): """ Return the divisor of a function on a curve. INPUT: r is a rational function on X OUTPUT: - ``list`` - The divisor of r represented as a list of coefficients and points. (TODO: This will change to a more structural output in the future.) EXAMPLES:: sage: FF = FiniteField(5) sage: P2 = ProjectiveSpace(2, FF, names = ['x','y','z']) sage: R = P2.coordinate_ring() sage: x, y, z = R.gens() sage: f = y^2*z^7 - x^9 - x*z^8 sage: C = Curve(f) sage: K = FractionField(R) sage: r = 1/x sage: C.divisor_of_function(r) # todo: not implemented !!!! [[-1, (0, 0, 1)]] sage: r = 1/x^3 sage: C.divisor_of_function(r) # todo: not implemented !!!! [[-3, (0, 0, 1)]] """ F = self.base_ring() f = self.defining_polynomial() x, y, z = f.parent().gens() pnts = self.rational_points() divf = [] for P in pnts: if P[2] != F(0): # What is the '5' in this line and the 'r()' in the next??? lcs = self.local_coordinates(P,5) ldg = degree_lowest_rational_function(r(lcs[0],lcs[1]),z) if ldg[0] != 0: divf.append([ldg[0],P]) return divf
def divisor_of_function(self, r): """ Return the divisor of a function on a curve. INPUT: r is a rational function on X OUTPUT: - ``list`` - The divisor of r represented as a list of coefficients and points. (TODO: This will change to a more structural output in the future.) EXAMPLES:: sage: FF = FiniteField(5) sage: P2 = ProjectiveSpace(2, FF, names = ['x','y','z']) sage: R = P2.coordinate_ring() sage: x, y, z = R.gens() sage: f = y^2*z^7 - x^9 - x*z^8 sage: C = Curve(f) sage: K = FractionField(R) sage: r = 1/x sage: C.divisor_of_function(r) # todo: not implemented !!!! [[-1, (0, 0, 1)]] sage: r = 1/x^3 sage: C.divisor_of_function(r) # todo: not implemented !!!! [[-3, (0, 0, 1)]] """ F = self.base_ring() f = self.defining_polynomial() x, y, z = f.parent().gens() pnts = self.rational_points() divf = [] for P in pnts: if P[2] != F(0): # What is the '5' in this line and the 'r()' in the next??? lcs = self.local_coordinates(P, 5) ldg = degree_lowest_rational_function(r(lcs[0], lcs[1]), z) if ldg[0] != 0: divf.append([ldg[0], P]) return divf