Affine curves.

EXAMPLES:

We can construct curves in either an affine plane:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([y - x^2], A); C
Affine Plane Curve over Rational Field defined by -x^2 + y

or in higher dimensional affine space:

sage: A.<x,y,z,w> = AffineSpace(QQ, 4)
sage: C = Curve([y - x^2, z - w^3, w - y^4], A); C
Affine Curve over Rational Field defined by -x^2 + y, -w^3 + z, -y^4 + w

AUTHORS:

  • William Stein (2005-11-13)
  • David Joyner (2005-11-13)
  • David Kohel (2006-01)
class sage.schemes.curves.affine_curve.AffineCurve(A, X)

Bases: sage.schemes.curves.curve.Curve_generic, sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme_affine

Initialization function.

EXAMPLES:

sage: R.<v> = QQ[]
sage: K.<u> = NumberField(v^2 + 3)
sage: A.<x,y,z> = AffineSpace(K, 3)
sage: C = Curve([z - u*x^2, y^2], A); C
Affine Curve over Number Field in u with defining polynomial v^2 + 3
defined by (-u)*x^2 + z, y^2
sage: A.<x,y,z> = AffineSpace(GF(7), 3)
sage: C = Curve([x^2 - z, z - 8*x], A); C
Affine Curve over Finite Field of size 7 defined by x^2 - z, -x + z
projective_closure(i=0, PP=None)

Return the projective closure of this affine curve.

INPUT:

  • i – (default: 0) the index of the affine coordinate chart of the projective space that the affine ambient space of this curve embeds into.
  • PP – (default: None) ambient projective space to compute the projective closure in. This is constructed if it is not given.

OUTPUT:

  • a curve in projective space.

EXAMPLES:

sage: A.<x,y,z> = AffineSpace(QQ, 3)
sage: C = Curve([y-x^2,z-x^3], A)
sage: C.projective_closure()
Projective Curve over Rational Field defined by x1^2 - x0*x2,
x1*x2 - x0*x3, x2^2 - x1*x3
sage: A.<x,y,z> = AffineSpace(QQ, 3)
sage: C = Curve([y - x^2, z - x^3], A)
sage: C.projective_closure()
Projective Curve over Rational Field defined by
x1^2 - x0*x2, x1*x2 - x0*x3, x2^2 - x1*x3
sage: A.<x,y> = AffineSpace(CC, 2)
sage: C = Curve(y - x^3 + x - 1, A)
sage: C.projective_closure(1)
Projective Plane Curve over Complex Field with 53 bits of precision defined by
x0^3 - x0*x1^2 + x1^3 - x1^2*x2
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: P.<u,v,w> = ProjectiveSpace(QQ, 2)
sage: C = Curve([y - x^2], A)
sage: C.projective_closure(1, P).ambient_space() == P
True
class sage.schemes.curves.affine_curve.AffinePlaneCurve(A, f)

Bases: sage.schemes.curves.affine_curve.AffineCurve

Initialization function.

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([x^3 - y^2], A); C
Affine Plane Curve over Rational Field defined by x^3 - y^2
sage: A.<x,y> = AffineSpace(CC, 2)
sage: C = Curve([y^2 + x^2], A); C
Affine Plane Curve over Complex Field with 53 bits of precision defined
by x^2 + y^2
divisor_of_function(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)]]
is_ordinary_singularity(P)

Return whether the singular point P of this affine plane curve is an ordinary singularity.

The point P is an ordinary singularity of this curve if it is a singular point, and if the tangents of this curve at P are distinct.

INPUT:

  • P – a point on this curve.

OUTPUT:

  • Boolean. True or False depending on whether P is or is not an ordinary singularity of this curve, respectively. An error is raised if P is not a singular point of this curve.

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([y^2 - x^3], A)
sage: Q = A([0,0])
sage: C.is_ordinary_singularity(Q)
False
sage: R.<a> = QQ[]
sage: K.<b> = NumberField(a^2 - 3)
sage: A.<x,y> = AffineSpace(K, 2)
sage: C = Curve([(x^2 + y^2 - 2*x)^2 - x^2 - y^2], A)
sage: Q = A([0,0])
sage: C.is_ordinary_singularity(Q)
True
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = A.curve([x^2*y - y^2*x + y^2 + x^3])
sage: Q = A([-1,-1])
sage: C.is_ordinary_singularity(Q)
Traceback (most recent call last):
...
TypeError: (=(-1, -1)) is not a singular point of (=Affine Plane Curve
over Rational Field defined by x^3 + x^2*y - x*y^2 + y^2)
is_transverse(C, P)

Return whether the intersection of this curve with the curve C at the point P is transverse.

The intersection at P is transverse if P is a nonsingular point of both curves, and if the tangents of the curves at P are distinct.

INPUT:

  • C – a curve in the ambient space of this curve.
  • P – a point in the intersection of both curves.

OUPUT: Boolean.

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([x^2 + y^2 - 1], A)
sage: D = Curve([x - 1], A)
sage: Q = A([1,0])
sage: C.is_transverse(D, Q)
False
sage: R.<a> = QQ[]
sage: K.<b> = NumberField(a^3 + 2)
sage: A.<x,y> = AffineSpace(K, 2)
sage: C = A.curve([x*y])
sage: D = A.curve([y - b*x])
sage: Q = A([0,0])
sage: C.is_transverse(D, Q)
False
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([y - x^3], A)
sage: D = Curve([y + x], A)
sage: Q = A([0,0])
sage: C.is_transverse(D, Q)
True
local_coordinates(pt, n)

Return local coordinates to precision n at the given point.

Behaviour is flaky - some choices of n are worst that others.

INPUT:

  • pt - an F-rational point on X which is not a point of ramification for the projection (x,y) - x.
  • n - the number of terms desired

OUTPUT: x = x0 + t y = y0 + power series in t

EXAMPLES:

sage: F = GF(5)
sage: pt = (2,3)
sage: R = PolynomialRing(F,2, names = ['x','y'])
sage: x,y = R.gens()
sage: f = y^2-x^9-x
sage: C = Curve(f)
sage: C.local_coordinates(pt, 9)
[t + 2, -2*t^12 - 2*t^11 + 2*t^9 + t^8 - 2*t^7 - 2*t^6 - 2*t^4 + t^3 - 2*t^2 - 2]
multiplicity(P)

Return the multiplicity of this affine plane curve at the point P.

In the special case of affine plane curves, the multiplicity of an affine plane curve at the point (0,0) can be computed as the minimum of the degrees of the homogeneous components of its defining polynomial. To compute the multiplicity of a different point, a linear change of coordinates is used.

This curve must be defined over a field. An error if raised if P is not a point on this curve.

INPUT:

  • P – a point in the ambient space of this curve.

OUTPUT:

An integer.

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([y^2 - x^3], A)
sage: Q1 = A([1,1])
sage: C.multiplicity(Q1)
1
sage: Q2 = A([0,0])
sage: C.multiplicity(Q2)
2
sage: A.<x,y> = AffineSpace(QQbar,2)
sage: C = Curve([-x^7 + (-7)*x^6 + y^6 + (-21)*x^5 + 12*y^5 + (-35)*x^4 + 60*y^4 +\
(-35)*x^3 + 160*y^3 + (-21)*x^2 + 240*y^2 + (-7)*x + 192*y + 63], A)
sage: Q = A([-1,-2])
sage: C.multiplicity(Q)
6
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = A.curve([y^3 - x^3 + x^6])
sage: Q = A([1,1])
sage: C.multiplicity(Q)
Traceback (most recent call last):
...
TypeError: (=(1, 1)) is not a point on (=Affine Plane Curve over
Rational Field defined by x^6 - x^3 + y^3)
plot(*args, **kwds)

Plot the real points on this affine plane curve.

INPUT:

  • self - an affine plane curve
  • *args - optional tuples (variable, minimum, maximum) for plotting dimensions
  • **kwds - optional keyword arguments passed on to implicit_plot

EXAMPLES:

A cuspidal curve:

sage: R.<x, y> = QQ[]
sage: C = Curve(x^3 - y^2)
sage: C.plot()
Graphics object consisting of 1 graphics primitive

A 5-nodal curve of degree 11. This example also illustrates some of the optional arguments:

sage: R.<x, y> = ZZ[]
sage: C = Curve(32*x^2 - 2097152*y^11 + 1441792*y^9 - 360448*y^7 + 39424*y^5 - 1760*y^3 + 22*y - 1)
sage: C.plot((x, -1, 1), (y, -1, 1), plot_points=400)
Graphics object consisting of 1 graphics primitive

A line over \mathbf{RR}:

sage: R.<x, y> = RR[]
sage: C = Curve(R(y - sqrt(2)*x))
sage: C.plot()
Graphics object consisting of 1 graphics primitive
tangents(P)

Return the tangents of this affine plane curve at the point P.

The point P must be a point on this curve.

INPUT:

  • P – a point on this curve.

OUTPUT:

  • a list of polynomials in the coordinate ring of the ambient space of this curve.

EXAMPLES:

sage: R.<a> = QQ[]
sage: K.<b> = NumberField(a^2 - 3)
sage: A.<x,y> = AffineSpace(K, 2)
sage: C = Curve([(x^2 + y^2 - 2*x)^2 - x^2 - y^2], A)
sage: Q = A([0,0])
sage: C.tangents(Q)
[x + (-1/3*b)*y, x + (1/3*b)*y]
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = A.curve([y^2 - x^3 - x^2])
sage: Q = A([0,0])
sage: C.tangents(Q)
[x - y, x + y]
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = A.curve([y*x - x^4 + 2*x^2])
sage: Q = A([1,1])
sage: C.tangents(Q)
Traceback (most recent call last):
...
TypeError: (=(1, 1)) is not a point on (=Affine Plane Curve over
Rational Field defined by -x^4 + 2*x^2 + x*y)
class sage.schemes.curves.affine_curve.AffinePlaneCurve_finite_field(A, f)

Bases: sage.schemes.curves.affine_curve.AffinePlaneCurve

Initialization function.

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([x^3 - y^2], A); C
Affine Plane Curve over Rational Field defined by x^3 - y^2
sage: A.<x,y> = AffineSpace(CC, 2)
sage: C = Curve([y^2 + x^2], A); C
Affine Plane Curve over Complex Field with 53 bits of precision defined
by x^2 + y^2
rational_points(algorithm='enum')

Return sorted list of all rational points on this curve.

Use very naive point enumeration to find all rational points on this curve over a finite field.

EXAMPLE:

sage: A.<x,y> = AffineSpace(2,GF(9,'a'))
sage: C = Curve(x^2 + y^2 - 1)
sage: C
Affine Plane Curve over Finite Field in a of size 3^2 defined by x^2 + y^2 - 1
sage: C.rational_points()
[(0, 1), (0, 2), (1, 0), (2, 0), (a + 1, a + 1), (a + 1, 2*a + 2), (2*a + 2, a + 1), (2*a + 2, 2*a + 2)]
class sage.schemes.curves.affine_curve.AffinePlaneCurve_prime_finite_field(A, f)

Bases: sage.schemes.curves.affine_curve.AffinePlaneCurve_finite_field

Initialization function.

EXAMPLES:

sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([x^3 - y^2], A); C
Affine Plane Curve over Rational Field defined by x^3 - y^2
sage: A.<x,y> = AffineSpace(CC, 2)
sage: C = Curve([y^2 + x^2], A); C
Affine Plane Curve over Complex Field with 53 bits of precision defined
by x^2 + y^2
rational_points(algorithm='enum')

Return sorted list of all rational points on this curve.

INPUT:

  • algorithm - string:
    • 'enum' - straightforward enumeration
    • 'bn' - via Singular’s Brill-Noether package.
    • 'all' - use all implemented algorithms and verify that they give the same answer, then return it

Note

The Brill-Noether package does not always work. When it fails a RuntimeError exception is raised.

EXAMPLE:

sage: x, y = (GF(5)['x,y']).gens()
sage: f = y^2 - x^9 - x
sage: C = Curve(f); C
Affine Plane Curve over Finite Field of size 5 defined by -x^9 + y^2 - x
sage: C.rational_points(algorithm='bn')
[(0, 0), (2, 2), (2, 3), (3, 1), (3, 4)]
sage: C = Curve(x - y + 1)
sage: C.rational_points()
[(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)]

We compare Brill-Noether and enumeration:

sage: x, y = (GF(17)['x,y']).gens()
sage: C = Curve(x^2 + y^5 + x*y - 19)
sage: v = C.rational_points(algorithm='bn')
sage: w = C.rational_points(algorithm='enum')
sage: len(v)
20
sage: v == w
True
riemann_roch_basis(D)

Interfaces with Singular’s BrillNoether command.

INPUT:

  • self - a plane curve defined by a polynomial eqn f(x,y) = 0 over a prime finite field F = GF(p) in 2 variables x,y representing a curve X: f(x,y) = 0 having n F-rational points (see the Sage function places_on_curve)
  • D - an n-tuple of integers (d1, ..., dn) representing the divisor Div = d1*P1+...+dn*Pn, where X(F) = \{P1,...,Pn\}. The ordering is that dictated by places_on_curve.

OUTPUT: basis of L(Div)

EXAMPLE:

sage: R = PolynomialRing(GF(5),2,names = ["x","y"])
sage: x, y = R.gens()
sage: f = y^2 - x^9 - x
sage: C = Curve(f)
sage: D = [6,0,0,0,0,0]
sage: C.riemann_roch_basis(D)
[1, (y^2*z^4 - x*z^5)/x^6, (y^2*z^5 - x*z^6)/x^7, (y^2*z^6 - x*z^7)/x^8]