Base class of curves

This module defines the base class of curves in Sage.

Curves in Sage are reduced subschemes of dimension 1 of an ambient space. The ambient space is either an affine space or a projective space.

EXAMPLES:

sage: A.<x,y,z> = AffineSpace(QQ, 3)
sage: C = Curve([x - y, z - 2])
sage: C
Affine Curve over Rational Field defined by x - y, z - 2
sage: C.dimension()
1
>>> from sage.all import *
>>> A = AffineSpace(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)
>>> C = Curve([x - y, z - Integer(2)])
>>> C
Affine Curve over Rational Field defined by x - y, z - 2
>>> C.dimension()
1
A.<x,y,z> = AffineSpace(QQ, 3)
C = Curve([x - y, z - 2])
C
C.dimension()

AUTHORS:

  • William Stein (2005)

class sage.schemes.curves.curve.Curve_generic(A, polynomials, category=None)[source]

Bases: AlgebraicScheme_subscheme

Generic curve class.

EXAMPLES:

sage: A.<x,y,z> = AffineSpace(QQ, 3)
sage: C = Curve([x - y, z - 2])
sage: loads(C.dumps()) == C
True
>>> from sage.all import *
>>> A = AffineSpace(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)
>>> C = Curve([x - y, z - Integer(2)])
>>> loads(C.dumps()) == C
True
A.<x,y,z> = AffineSpace(QQ, 3)
C = Curve([x - y, z - 2])
loads(C.dumps()) == C
change_ring(R)[source]

Return a new curve which is this curve coerced to R.

INPUT:

  • R – ring or embedding

OUTPUT: a new curve which is this curve coerced to R

EXAMPLES:

sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: C = Curve([x^2 - y^2, z*y - 4/5*w^2], P)
sage: C.change_ring(QuadraticField(-1))                                     # needs sage.rings.number_field
Projective Curve over Number Field in a with defining polynomial x^2 + 1
 with a = 1*I defined by x^2 - y^2, y*z - 4/5*w^2
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4)
>>> C = Curve([x**Integer(2) - y**Integer(2), z*y - Integer(4)/Integer(5)*w**Integer(2)], P)
>>> C.change_ring(QuadraticField(-Integer(1)))                                     # needs sage.rings.number_field
Projective Curve over Number Field in a with defining polynomial x^2 + 1
 with a = 1*I defined by x^2 - y^2, y*z - 4/5*w^2
P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
C = Curve([x^2 - y^2, z*y - 4/5*w^2], P)
C.change_ring(QuadraticField(-1))                                     # needs sage.rings.number_field
sage: # needs sage.rings.number_field
sage: R.<a> = QQ[]
sage: K.<b> = NumberField(a^3 + a^2 - 1)
sage: A.<x,y> = AffineSpace(K, 2)
sage: C = Curve([K.0*x^2 - x + y^3 - 11], A)
sage: L = K.embeddings(QQbar)
sage: set_verbose(-1)  # suppress warnings for slow computation
sage: C.change_ring(L[0])
Affine Plane Curve over Algebraic Field defined
 by y^3 + (-0.8774388331233464? - 0.744861766619745?*I)*x^2 - x - 11
>>> from sage.all import *
>>> # needs sage.rings.number_field
>>> R = QQ['a']; (a,) = R._first_ngens(1)
>>> K = NumberField(a**Integer(3) + a**Integer(2) - Integer(1), names=('b',)); (b,) = K._first_ngens(1)
>>> A = AffineSpace(K, Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([K.gen(0)*x**Integer(2) - x + y**Integer(3) - Integer(11)], A)
>>> L = K.embeddings(QQbar)
>>> set_verbose(-Integer(1))  # suppress warnings for slow computation
>>> C.change_ring(L[Integer(0)])
Affine Plane Curve over Algebraic Field defined
 by y^3 + (-0.8774388331233464? - 0.744861766619745?*I)*x^2 - x - 11
# needs sage.rings.number_field
R.<a> = QQ[]
K.<b> = NumberField(a^3 + a^2 - 1)
A.<x,y> = AffineSpace(K, 2)
C = Curve([K.0*x^2 - x + y^3 - 11], A)
L = K.embeddings(QQbar)
set_verbose(-1)  # suppress warnings for slow computation
C.change_ring(L[0])
>>> from sage.all import *
>>> # needs sage.rings.number_field
>>> R = QQ['a']; (a,) = R._first_ngens(1)
>>> K = NumberField(a**Integer(3) + a**Integer(2) - Integer(1), names=('b',)); (b,) = K._first_ngens(1)
>>> A = AffineSpace(K, Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([K.gen(0)*x**Integer(2) - x + y**Integer(3) - Integer(11)], A)
>>> L = K.embeddings(QQbar)
>>> set_verbose(-Integer(1))  # suppress warnings for slow computation
>>> C.change_ring(L[Integer(0)])
Affine Plane Curve over Algebraic Field defined
 by y^3 + (-0.8774388331233464? - 0.744861766619745?*I)*x^2 - x - 11
# needs sage.rings.number_field
R.<a> = QQ[]
K.<b> = NumberField(a^3 + a^2 - 1)
A.<x,y> = AffineSpace(K, 2)
C = Curve([K.0*x^2 - x + y^3 - 11], A)
L = K.embeddings(QQbar)
set_verbose(-1)  # suppress warnings for slow computation
C.change_ring(L[0])
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: C = P.curve([y*x - 18*x^2 + 17*z^2])
sage: C.change_ring(GF(17))
Projective Plane Curve over Finite Field of size 17 defined by -x^2 + x*y
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
>>> C = P.curve([y*x - Integer(18)*x**Integer(2) + Integer(17)*z**Integer(2)])
>>> C.change_ring(GF(Integer(17)))
Projective Plane Curve over Finite Field of size 17 defined by -x^2 + x*y
P.<x,y,z> = ProjectiveSpace(QQ, 2)
C = P.curve([y*x - 18*x^2 + 17*z^2])
C.change_ring(GF(17))
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
>>> C = P.curve([y*x - Integer(18)*x**Integer(2) + Integer(17)*z**Integer(2)])
>>> C.change_ring(GF(Integer(17)))
Projective Plane Curve over Finite Field of size 17 defined by -x^2 + x*y
P.<x,y,z> = ProjectiveSpace(QQ, 2)
C = P.curve([y*x - 18*x^2 + 17*z^2])
C.change_ring(GF(17))
defining_polynomial()[source]

Return the defining polynomial of the curve.

EXAMPLES:

sage: x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
sage: C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
sage: C.defining_polynomial()
-x^3 + y^2*z - 17*x*z^2 + y*z^2
>>> from sage.all import *
>>> x,y,z = PolynomialRing(QQ, Integer(3), names='x,y,z').gens()
>>> C = Curve(y**Integer(2)*z - x**Integer(3) - Integer(17)*x*z**Integer(2) + y*z**Integer(2))
>>> C.defining_polynomial()
-x^3 + y^2*z - 17*x*z^2 + y*z^2
x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
C.defining_polynomial()
dimension()[source]

Return the dimension of the curve.

Curves have dimension one by definition.

EXAMPLES:

sage: x = polygen(QQ)
sage: C = HyperellipticCurve(x^7 + x^4 + x)
sage: C.dimension()
1
sage: from sage.schemes.projective.projective_subscheme import AlgebraicScheme_subscheme_projective
sage: AlgebraicScheme_subscheme_projective.dimension(C)
1
>>> from sage.all import *
>>> x = polygen(QQ)
>>> C = HyperellipticCurve(x**Integer(7) + x**Integer(4) + x)
>>> C.dimension()
1
>>> from sage.schemes.projective.projective_subscheme import AlgebraicScheme_subscheme_projective
>>> AlgebraicScheme_subscheme_projective.dimension(C)
1
x = polygen(QQ)
C = HyperellipticCurve(x^7 + x^4 + x)
C.dimension()
from sage.schemes.projective.projective_subscheme import AlgebraicScheme_subscheme_projective
AlgebraicScheme_subscheme_projective.dimension(C)
divisor(v, base_ring=None, check=True, reduce=True)[source]

Return the divisor specified by v.

Warning

The coefficients of the divisor must be in the base ring and the terms must be reduced. If you set check=False and/or reduce=False it is your responsibility to pass a valid object v.

EXAMPLES:

sage: x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
sage: C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
sage: p1 = C(0, -1, 1)
sage: p2 = C(0, 0, 1)
sage: p3 = C(0, 1, 0)
sage: C.divisor([(1, p1), (-1, p2), (2, p3)])
(x, y + z) - (x, y) + 2*(x, z)
>>> from sage.all import *
>>> x,y,z = PolynomialRing(QQ, Integer(3), names='x,y,z').gens()
>>> C = Curve(y**Integer(2)*z - x**Integer(3) - Integer(17)*x*z**Integer(2) + y*z**Integer(2))
>>> p1 = C(Integer(0), -Integer(1), Integer(1))
>>> p2 = C(Integer(0), Integer(0), Integer(1))
>>> p3 = C(Integer(0), Integer(1), Integer(0))
>>> C.divisor([(Integer(1), p1), (-Integer(1), p2), (Integer(2), p3)])
(x, y + z) - (x, y) + 2*(x, z)
x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
p1 = C(0, -1, 1)
p2 = C(0, 0, 1)
p3 = C(0, 1, 0)
C.divisor([(1, p1), (-1, p2), (2, p3)])
divisor_group(base_ring=None)[source]

Return the divisor group of the curve.

INPUT:

  • base_ring – the base ring of the divisor group; usually, this is \(\ZZ\) (default) or \(\QQ\)

OUTPUT: the divisor group of the curve

EXAMPLES:

sage: x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
sage: C  = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
sage: Cp = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
sage: C.divisor_group() is Cp.divisor_group()
True
>>> from sage.all import *
>>> x,y,z = PolynomialRing(QQ, Integer(3), names='x,y,z').gens()
>>> C  = Curve(y**Integer(2)*z - x**Integer(3) - Integer(17)*x*z**Integer(2) + y*z**Integer(2))
>>> Cp = Curve(y**Integer(2)*z - x**Integer(3) - Integer(17)*x*z**Integer(2) + y*z**Integer(2))
>>> C.divisor_group() is Cp.divisor_group()
True
x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
C  = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
Cp = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
C.divisor_group() is Cp.divisor_group()
genus()[source]

Return the geometric genus of the curve.

EXAMPLES:

sage: x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
sage: C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
sage: C.genus()
1
>>> from sage.all import *
>>> x,y,z = PolynomialRing(QQ, Integer(3), names='x,y,z').gens()
>>> C = Curve(y**Integer(2)*z - x**Integer(3) - Integer(17)*x*z**Integer(2) + y*z**Integer(2))
>>> C.genus()
1
x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
C.genus()
geometric_genus()[source]

Return the geometric genus of the curve.

EXAMPLES:

Examples of projective curves:

sage: P2 = ProjectiveSpace(2, GF(5), names=['x','y','z'])
sage: x, y, z = P2.coordinate_ring().gens()
sage: C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
sage: C.geometric_genus()
1
sage: C = Curve(y^2*z - x^3)
sage: C.geometric_genus()
0
sage: C = Curve(x^10 + y^7*z^3 + z^10)
sage: C.geometric_genus()
3
>>> from sage.all import *
>>> P2 = ProjectiveSpace(Integer(2), GF(Integer(5)), names=['x','y','z'])
>>> x, y, z = P2.coordinate_ring().gens()
>>> C = Curve(y**Integer(2)*z - x**Integer(3) - Integer(17)*x*z**Integer(2) + y*z**Integer(2))
>>> C.geometric_genus()
1
>>> C = Curve(y**Integer(2)*z - x**Integer(3))
>>> C.geometric_genus()
0
>>> C = Curve(x**Integer(10) + y**Integer(7)*z**Integer(3) + z**Integer(10))
>>> C.geometric_genus()
3
P2 = ProjectiveSpace(2, GF(5), names=['x','y','z'])
x, y, z = P2.coordinate_ring().gens()
C = Curve(y^2*z - x^3 - 17*x*z^2 + y*z^2)
C.geometric_genus()
C = Curve(y^2*z - x^3)
C.geometric_genus()
C = Curve(x^10 + y^7*z^3 + z^10)
C.geometric_genus()

Examples of affine curves:

sage: x, y = PolynomialRing(GF(5), 2, 'xy').gens()
sage: C = Curve(y^2 - x^3 - 17*x + y)
sage: C.geometric_genus()
1
sage: C = Curve(y^2 - x^3)
sage: C.geometric_genus()
0
sage: C = Curve(x^10 + y^7 + 1)
sage: C.geometric_genus()
3
>>> from sage.all import *
>>> x, y = PolynomialRing(GF(Integer(5)), Integer(2), 'xy').gens()
>>> C = Curve(y**Integer(2) - x**Integer(3) - Integer(17)*x + y)
>>> C.geometric_genus()
1
>>> C = Curve(y**Integer(2) - x**Integer(3))
>>> C.geometric_genus()
0
>>> C = Curve(x**Integer(10) + y**Integer(7) + Integer(1))
>>> C.geometric_genus()
3
x, y = PolynomialRing(GF(5), 2, 'xy').gens()
C = Curve(y^2 - x^3 - 17*x + y)
C.geometric_genus()
C = Curve(y^2 - x^3)
C.geometric_genus()
C = Curve(x^10 + y^7 + 1)
C.geometric_genus()

Warning

Geometric genus is only defined for geometrically irreducible curve. This method does not check the condition. You may get a nonsensical result if the curve is not geometrically irreducible:

sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: C = Curve(x^2 + y^2, P2)
sage: C.geometric_genus()  # nonsense!
-1
>>> from sage.all import *
>>> P2 = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> C = Curve(x**Integer(2) + y**Integer(2), P2)
>>> C.geometric_genus()  # nonsense!
-1
P2.<x,y,z> = ProjectiveSpace(QQ, 2)
C = Curve(x^2 + y^2, P2)
C.geometric_genus()  # nonsense!
intersection_points(C, F=None)[source]

Return the points in the intersection of this curve and the curve C.

If the intersection of these two curves has dimension greater than zero, and if the base ring of this curve is not a finite field, then an error is returned.

INPUT:

  • C – a curve in the same ambient space as this curve

  • F – (default: None) field over which to compute the intersection points; if not specified, the base ring of this curve is used

OUTPUT: list of points in the ambient space of this curve

EXAMPLES:

sage: # needs sage.rings.number_field
sage: R.<a> = QQ[]
sage: K.<b> = NumberField(a^2 + a + 1)
sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: C = Curve([y^2 - w*z, w^3 - y^3], P)
sage: D = Curve([x*y - w*z, z^3 - y^3], P)
sage: C.intersection_points(D, F=K)
[(-b - 1 : -b - 1 : b : 1), (b : b : -b - 1 : 1),
 (1 : 0 : 0 : 0), (1 : 1 : 1 : 1)]
>>> from sage.all import *
>>> # needs sage.rings.number_field
>>> R = QQ['a']; (a,) = R._first_ngens(1)
>>> K = NumberField(a**Integer(2) + a + Integer(1), names=('b',)); (b,) = K._first_ngens(1)
>>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4)
>>> C = Curve([y**Integer(2) - w*z, w**Integer(3) - y**Integer(3)], P)
>>> D = Curve([x*y - w*z, z**Integer(3) - y**Integer(3)], P)
>>> C.intersection_points(D, F=K)
[(-b - 1 : -b - 1 : b : 1), (b : b : -b - 1 : 1),
 (1 : 0 : 0 : 0), (1 : 1 : 1 : 1)]
# needs sage.rings.number_field
R.<a> = QQ[]
K.<b> = NumberField(a^2 + a + 1)
P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
C = Curve([y^2 - w*z, w^3 - y^3], P)
D = Curve([x*y - w*z, z^3 - y^3], P)
C.intersection_points(D, F=K)
sage: A.<x,y> = AffineSpace(GF(7), 2)
sage: C = Curve([y^3 - x^3], A)
sage: D = Curve([-x*y^3 + y^4 - 2*x^3 + 2*x^2*y], A)
sage: C.intersection_points(D)
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 3), (5, 5), (5, 6), (6, 6)]
>>> from sage.all import *
>>> A = AffineSpace(GF(Integer(7)), Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y**Integer(3) - x**Integer(3)], A)
>>> D = Curve([-x*y**Integer(3) + y**Integer(4) - Integer(2)*x**Integer(3) + Integer(2)*x**Integer(2)*y], A)
>>> C.intersection_points(D)
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 3), (5, 5), (5, 6), (6, 6)]
A.<x,y> = AffineSpace(GF(7), 2)
C = Curve([y^3 - x^3], A)
D = Curve([-x*y^3 + y^4 - 2*x^3 + 2*x^2*y], A)
C.intersection_points(D)
>>> from sage.all import *
>>> A = AffineSpace(GF(Integer(7)), Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y**Integer(3) - x**Integer(3)], A)
>>> D = Curve([-x*y**Integer(3) + y**Integer(4) - Integer(2)*x**Integer(3) + Integer(2)*x**Integer(2)*y], A)
>>> C.intersection_points(D)
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 3), (5, 5), (5, 6), (6, 6)]
A.<x,y> = AffineSpace(GF(7), 2)
C = Curve([y^3 - x^3], A)
D = Curve([-x*y^3 + y^4 - 2*x^3 + 2*x^2*y], A)
C.intersection_points(D)
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: C = Curve([y^3 - x^3], A)
sage: D = Curve([-x*y^3 + y^4 - 2*x^3 + 2*x^2*y], A)
sage: C.intersection_points(D)
Traceback (most recent call last):
...
NotImplementedError: the intersection must have dimension zero or
(=Rational Field) must be a finite field
>>> from sage.all import *
>>> A = AffineSpace(QQ, Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y**Integer(3) - x**Integer(3)], A)
>>> D = Curve([-x*y**Integer(3) + y**Integer(4) - Integer(2)*x**Integer(3) + Integer(2)*x**Integer(2)*y], A)
>>> C.intersection_points(D)
Traceback (most recent call last):
...
NotImplementedError: the intersection must have dimension zero or
(=Rational Field) must be a finite field
A.<x,y> = AffineSpace(QQ, 2)
C = Curve([y^3 - x^3], A)
D = Curve([-x*y^3 + y^4 - 2*x^3 + 2*x^2*y], A)
C.intersection_points(D)
>>> from sage.all import *
>>> A = AffineSpace(QQ, Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y**Integer(3) - x**Integer(3)], A)
>>> D = Curve([-x*y**Integer(3) + y**Integer(4) - Integer(2)*x**Integer(3) + Integer(2)*x**Integer(2)*y], A)
>>> C.intersection_points(D)
Traceback (most recent call last):
...
NotImplementedError: the intersection must have dimension zero or
(=Rational Field) must be a finite field
A.<x,y> = AffineSpace(QQ, 2)
C = Curve([y^3 - x^3], A)
D = Curve([-x*y^3 + y^4 - 2*x^3 + 2*x^2*y], A)
C.intersection_points(D)
intersects_at(C, P)[source]

Return whether the point P is or is not in the intersection of this curve with the curve C.

INPUT:

  • C – a curve in the same ambient space as this curve

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

EXAMPLES:

sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: C = Curve([x^2 - z^2, y^3 - w*x^2], P)
sage: D = Curve([w^2 - 2*x*y + z^2, y^2 - w^2], P)
sage: Q1 = P([1,1,-1,1])
sage: C.intersects_at(D, Q1)
True
sage: Q2 = P([0,0,1,-1])
sage: C.intersects_at(D, Q2)
False
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4)
>>> C = Curve([x**Integer(2) - z**Integer(2), y**Integer(3) - w*x**Integer(2)], P)
>>> D = Curve([w**Integer(2) - Integer(2)*x*y + z**Integer(2), y**Integer(2) - w**Integer(2)], P)
>>> Q1 = P([Integer(1),Integer(1),-Integer(1),Integer(1)])
>>> C.intersects_at(D, Q1)
True
>>> Q2 = P([Integer(0),Integer(0),Integer(1),-Integer(1)])
>>> C.intersects_at(D, Q2)
False
P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
C = Curve([x^2 - z^2, y^3 - w*x^2], P)
D = Curve([w^2 - 2*x*y + z^2, y^2 - w^2], P)
Q1 = P([1,1,-1,1])
C.intersects_at(D, Q1)
Q2 = P([0,0,1,-1])
C.intersects_at(D, Q2)
sage: A.<x,y> = AffineSpace(GF(13), 2)
sage: C = Curve([y + 12*x^5 + 3*x^3 + 7], A)
sage: D = Curve([y^2 + 7*x^2 + 8], A)
sage: Q1 = A([9,6])
sage: C.intersects_at(D, Q1)
True
sage: Q2 = A([3,7])
sage: C.intersects_at(D, Q2)
False
>>> from sage.all import *
>>> A = AffineSpace(GF(Integer(13)), Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y + Integer(12)*x**Integer(5) + Integer(3)*x**Integer(3) + Integer(7)], A)
>>> D = Curve([y**Integer(2) + Integer(7)*x**Integer(2) + Integer(8)], A)
>>> Q1 = A([Integer(9),Integer(6)])
>>> C.intersects_at(D, Q1)
True
>>> Q2 = A([Integer(3),Integer(7)])
>>> C.intersects_at(D, Q2)
False
A.<x,y> = AffineSpace(GF(13), 2)
C = Curve([y + 12*x^5 + 3*x^3 + 7], A)
D = Curve([y^2 + 7*x^2 + 8], A)
Q1 = A([9,6])
C.intersects_at(D, Q1)
Q2 = A([3,7])
C.intersects_at(D, Q2)
>>> from sage.all import *
>>> A = AffineSpace(GF(Integer(13)), Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y + Integer(12)*x**Integer(5) + Integer(3)*x**Integer(3) + Integer(7)], A)
>>> D = Curve([y**Integer(2) + Integer(7)*x**Integer(2) + Integer(8)], A)
>>> Q1 = A([Integer(9),Integer(6)])
>>> C.intersects_at(D, Q1)
True
>>> Q2 = A([Integer(3),Integer(7)])
>>> C.intersects_at(D, Q2)
False
A.<x,y> = AffineSpace(GF(13), 2)
C = Curve([y + 12*x^5 + 3*x^3 + 7], A)
D = Curve([y^2 + 7*x^2 + 8], A)
Q1 = A([9,6])
C.intersects_at(D, Q1)
Q2 = A([3,7])
C.intersects_at(D, Q2)
is_singular(P=None)[source]

Return whether P is a singular point of this curve, or if no point is passed, whether this curve is singular or not.

This just uses the is_smooth function for algebraic subschemes.

INPUT:

  • P – (default: None) a point on this curve

OUTPUT:

boolean; if a point P is provided, and if P lies on this curve, returns True if P is a singular point of this curve, and False otherwise. If no point is provided, returns True or False depending on whether this curve is or is not singular, respectively.

EXAMPLES:

sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: C = P.curve([y^2 - x^2 - z^2, z - w])
sage: C.is_singular()
False
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4)
>>> C = P.curve([y**Integer(2) - x**Integer(2) - z**Integer(2), z - w])
>>> C.is_singular()
False
P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
C = P.curve([y^2 - x^2 - z^2, z - w])
C.is_singular()
sage: A.<x,y,z> = AffineSpace(GF(11), 3)
sage: C = A.curve([y^3 - z^5, x^5 - y + 1])
sage: Q = A([7,0,0])
sage: C.is_singular(Q)
True
>>> from sage.all import *
>>> A = AffineSpace(GF(Integer(11)), Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)
>>> C = A.curve([y**Integer(3) - z**Integer(5), x**Integer(5) - y + Integer(1)])
>>> Q = A([Integer(7),Integer(0),Integer(0)])
>>> C.is_singular(Q)
True
A.<x,y,z> = AffineSpace(GF(11), 3)
C = A.curve([y^3 - z^5, x^5 - y + 1])
Q = A([7,0,0])
C.is_singular(Q)
>>> from sage.all import *
>>> A = AffineSpace(GF(Integer(11)), Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)
>>> C = A.curve([y**Integer(3) - z**Integer(5), x**Integer(5) - y + Integer(1)])
>>> Q = A([Integer(7),Integer(0),Integer(0)])
>>> C.is_singular(Q)
True
A.<x,y,z> = AffineSpace(GF(11), 3)
C = A.curve([y^3 - z^5, x^5 - y + 1])
Q = A([7,0,0])
C.is_singular(Q)
singular_points(F=None)[source]

Return the set of singular points of this curve.

INPUT:

  • F – (default: None) field over which to find the singular points; if not given, the base ring of this curve is used

OUTPUT: list of points in the ambient space of this curve

EXAMPLES:

sage: A.<x,y,z> = AffineSpace(QQ, 3)
sage: C = Curve([y^2 - x^5, x - z], A)
sage: C.singular_points()
[(0, 0, 0)]
>>> from sage.all import *
>>> A = AffineSpace(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)
>>> C = Curve([y**Integer(2) - x**Integer(5), x - z], A)
>>> C.singular_points()
[(0, 0, 0)]
A.<x,y,z> = AffineSpace(QQ, 3)
C = Curve([y^2 - x^5, x - z], A)
C.singular_points()
sage: # needs sage.rings.number_field
sage: R.<a> = QQ[]
sage: K.<b> = NumberField(a^8 - a^4 + 1)
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: C = Curve([359/12*x*y^2*z^2 + 2*y*z^4 + 187/12*y^3*z^2 + x*z^4
....:            + 67/3*x^2*y*z^2 + 117/4*y^5 + 9*x^5 + 6*x^3*z^2
....:            + 393/4*x*y^4 + 145*x^2*y^3 + 115*x^3*y^2 + 49*x^4*y], P)
sage: sorted(C.singular_points(K), key=str)
[(-1/2*b^5 - 1/2*b^3 + 1/2*b - 1 : 1 : 0),
 (-2/3*b^4 + 1/3 : 0 : 1),
 (-b^6 : b^6 : 1),
 (1/2*b^5 + 1/2*b^3 - 1/2*b - 1 : 1 : 0),
 (2/3*b^4 - 1/3 : 0 : 1),
 (b^6 : -b^6 : 1)]
>>> from sage.all import *
>>> # needs sage.rings.number_field
>>> R = QQ['a']; (a,) = R._first_ngens(1)
>>> K = NumberField(a**Integer(8) - a**Integer(4) + Integer(1), names=('b',)); (b,) = K._first_ngens(1)
>>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
>>> C = Curve([Integer(359)/Integer(12)*x*y**Integer(2)*z**Integer(2) + Integer(2)*y*z**Integer(4) + Integer(187)/Integer(12)*y**Integer(3)*z**Integer(2) + x*z**Integer(4)
...            + Integer(67)/Integer(3)*x**Integer(2)*y*z**Integer(2) + Integer(117)/Integer(4)*y**Integer(5) + Integer(9)*x**Integer(5) + Integer(6)*x**Integer(3)*z**Integer(2)
...            + Integer(393)/Integer(4)*x*y**Integer(4) + Integer(145)*x**Integer(2)*y**Integer(3) + Integer(115)*x**Integer(3)*y**Integer(2) + Integer(49)*x**Integer(4)*y], P)
>>> sorted(C.singular_points(K), key=str)
[(-1/2*b^5 - 1/2*b^3 + 1/2*b - 1 : 1 : 0),
 (-2/3*b^4 + 1/3 : 0 : 1),
 (-b^6 : b^6 : 1),
 (1/2*b^5 + 1/2*b^3 - 1/2*b - 1 : 1 : 0),
 (2/3*b^4 - 1/3 : 0 : 1),
 (b^6 : -b^6 : 1)]
# needs sage.rings.number_field
R.<a> = QQ[]
K.<b> = NumberField(a^8 - a^4 + 1)
P.<x,y,z> = ProjectiveSpace(QQ, 2)
C = Curve([359/12*x*y^2*z^2 + 2*y*z^4 + 187/12*y^3*z^2 + x*z^4
           + 67/3*x^2*y*z^2 + 117/4*y^5 + 9*x^5 + 6*x^3*z^2
           + 393/4*x*y^4 + 145*x^2*y^3 + 115*x^3*y^2 + 49*x^4*y], P)
sorted(C.singular_points(K), key=str)
>>> from sage.all import *
>>> # needs sage.rings.number_field
>>> R = QQ['a']; (a,) = R._first_ngens(1)
>>> K = NumberField(a**Integer(8) - a**Integer(4) + Integer(1), names=('b',)); (b,) = K._first_ngens(1)
>>> P = ProjectiveSpace(QQ, Integer(2), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
>>> C = Curve([Integer(359)/Integer(12)*x*y**Integer(2)*z**Integer(2) + Integer(2)*y*z**Integer(4) + Integer(187)/Integer(12)*y**Integer(3)*z**Integer(2) + x*z**Integer(4)
...            + Integer(67)/Integer(3)*x**Integer(2)*y*z**Integer(2) + Integer(117)/Integer(4)*y**Integer(5) + Integer(9)*x**Integer(5) + Integer(6)*x**Integer(3)*z**Integer(2)
...            + Integer(393)/Integer(4)*x*y**Integer(4) + Integer(145)*x**Integer(2)*y**Integer(3) + Integer(115)*x**Integer(3)*y**Integer(2) + Integer(49)*x**Integer(4)*y], P)
>>> sorted(C.singular_points(K), key=str)
[(-1/2*b^5 - 1/2*b^3 + 1/2*b - 1 : 1 : 0),
 (-2/3*b^4 + 1/3 : 0 : 1),
 (-b^6 : b^6 : 1),
 (1/2*b^5 + 1/2*b^3 - 1/2*b - 1 : 1 : 0),
 (2/3*b^4 - 1/3 : 0 : 1),
 (b^6 : -b^6 : 1)]
# needs sage.rings.number_field
R.<a> = QQ[]
K.<b> = NumberField(a^8 - a^4 + 1)
P.<x,y,z> = ProjectiveSpace(QQ, 2)
C = Curve([359/12*x*y^2*z^2 + 2*y*z^4 + 187/12*y^3*z^2 + x*z^4
           + 67/3*x^2*y*z^2 + 117/4*y^5 + 9*x^5 + 6*x^3*z^2
           + 393/4*x*y^4 + 145*x^2*y^3 + 115*x^3*y^2 + 49*x^4*y], P)
sorted(C.singular_points(K), key=str)
singular_subscheme()[source]

Return the subscheme of singular points of this curve.

OUTPUT: a subscheme in the ambient space of this curve

EXAMPLES:

sage: A.<x,y> = AffineSpace(CC, 2)
sage: C = Curve([y^4 - 2*x^5 - x^2*y], A)
sage: C.singular_subscheme()
Closed subscheme of Affine Space of dimension 2 over Complex Field
 with 53 bits of precision defined by:
  (-2.00000000000000)*x^5 + y^4 - x^2*y,
  (-10.0000000000000)*x^4 + (-2.00000000000000)*x*y,
  4.00000000000000*y^3 - x^2
>>> from sage.all import *
>>> A = AffineSpace(CC, Integer(2), names=('x', 'y',)); (x, y,) = A._first_ngens(2)
>>> C = Curve([y**Integer(4) - Integer(2)*x**Integer(5) - x**Integer(2)*y], A)
>>> C.singular_subscheme()
Closed subscheme of Affine Space of dimension 2 over Complex Field
 with 53 bits of precision defined by:
  (-2.00000000000000)*x^5 + y^4 - x^2*y,
  (-10.0000000000000)*x^4 + (-2.00000000000000)*x*y,
  4.00000000000000*y^3 - x^2
A.<x,y> = AffineSpace(CC, 2)
C = Curve([y^4 - 2*x^5 - x^2*y], A)
C.singular_subscheme()
sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: C = Curve([y^8 - x^2*z*w^5, w^2 - 2*y^2 - x*z], P)
sage: C.singular_subscheme()
Closed subscheme of Projective Space of dimension 3
 over Rational Field defined by:
  y^8 - x^2*z*w^5,
  -2*y^2 - x*z + w^2,
  -x^3*y*z^4 + 3*x^2*y*z^3*w^2 - 3*x*y*z^2*w^4 + 8*x*y*z*w^5 + y*z*w^6,
  x^2*z*w^5,
  -5*x^2*z^2*w^4 - 4*x*z*w^6,
  x^4*y*z^3 - 3*x^3*y*z^2*w^2 + 3*x^2*y*z*w^4 - 4*x^2*y*w^5 - x*y*w^6,
  -2*x^3*y*z^3*w + 6*x^2*y*z^2*w^3 - 20*x^2*y*z*w^4
   - 6*x*y*z*w^5 + 2*y*w^7,
  -5*x^3*z*w^4 - 2*x^2*w^6
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4)
>>> C = Curve([y**Integer(8) - x**Integer(2)*z*w**Integer(5), w**Integer(2) - Integer(2)*y**Integer(2) - x*z], P)
>>> C.singular_subscheme()
Closed subscheme of Projective Space of dimension 3
 over Rational Field defined by:
  y^8 - x^2*z*w^5,
  -2*y^2 - x*z + w^2,
  -x^3*y*z^4 + 3*x^2*y*z^3*w^2 - 3*x*y*z^2*w^4 + 8*x*y*z*w^5 + y*z*w^6,
  x^2*z*w^5,
  -5*x^2*z^2*w^4 - 4*x*z*w^6,
  x^4*y*z^3 - 3*x^3*y*z^2*w^2 + 3*x^2*y*z*w^4 - 4*x^2*y*w^5 - x*y*w^6,
  -2*x^3*y*z^3*w + 6*x^2*y*z^2*w^3 - 20*x^2*y*z*w^4
   - 6*x*y*z*w^5 + 2*y*w^7,
  -5*x^3*z*w^4 - 2*x^2*w^6
P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
C = Curve([y^8 - x^2*z*w^5, w^2 - 2*y^2 - x*z], P)
C.singular_subscheme()
>>> from sage.all import *
>>> P = ProjectiveSpace(QQ, Integer(3), names=('x', 'y', 'z', 'w',)); (x, y, z, w,) = P._first_ngens(4)
>>> C = Curve([y**Integer(8) - x**Integer(2)*z*w**Integer(5), w**Integer(2) - Integer(2)*y**Integer(2) - x*z], P)
>>> C.singular_subscheme()
Closed subscheme of Projective Space of dimension 3
 over Rational Field defined by:
  y^8 - x^2*z*w^5,
  -2*y^2 - x*z + w^2,
  -x^3*y*z^4 + 3*x^2*y*z^3*w^2 - 3*x*y*z^2*w^4 + 8*x*y*z*w^5 + y*z*w^6,
  x^2*z*w^5,
  -5*x^2*z^2*w^4 - 4*x*z*w^6,
  x^4*y*z^3 - 3*x^3*y*z^2*w^2 + 3*x^2*y*z*w^4 - 4*x^2*y*w^5 - x*y*w^6,
  -2*x^3*y*z^3*w + 6*x^2*y*z^2*w^3 - 20*x^2*y*z*w^4
   - 6*x*y*z*w^5 + 2*y*w^7,
  -5*x^3*z*w^4 - 2*x^2*w^6
P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
C = Curve([y^8 - x^2*z*w^5, w^2 - 2*y^2 - x*z], P)
C.singular_subscheme()
union(other)[source]

Return the union of self and other.

EXAMPLES:

sage: x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
sage: C1 = Curve(z - x)
sage: C2 = Curve(y - x)
sage: C1.union(C2).defining_polynomial()
x^2 - x*y - x*z + y*z
>>> from sage.all import *
>>> x,y,z = PolynomialRing(QQ, Integer(3), names='x,y,z').gens()
>>> C1 = Curve(z - x)
>>> C2 = Curve(y - x)
>>> C1.union(C2).defining_polynomial()
x^2 - x*y - x*z + y*z
x,y,z = PolynomialRing(QQ, 3, names='x,y,z').gens()
C1 = Curve(z - x)
C2 = Curve(y - x)
C1.union(C2).defining_polynomial()