SD14: Curves
system:sage

{{{id=11|
# a projective plane curve
R.<x, y, z> = QQ[]
C = Curve(x^7+y^7+z^7); C
///
Projective Curve over Rational Field defined by x^7 + y^7 + z^7
}}}

{{{id=10|
C.genus()
///
15
}}}

{{{id=9|
C.arithmetic_genus()
///
15
}}}

{{{id=8|
# brute-force search up to a bound
C.rational_points(bound=5)
///
[(-1 : 0 : 1), (0 : -1 : 1), (-1 : 1 : 0)]
}}}

{{{id=12|
# an affine space curve
C = Curve([y^2 + x^3 + x^10 + z^7,  x^2 + y^2]); C
///
Affine Space Curve over Rational Field defined by x^10 + z^7 + x^3 + y^2
}}}

{{{id=13|
C.genus()
///
47
}}}

{{{id=14|
# a non-reduced, non-irreducible curve
C = Curve((x-y)^2*(x+z)^2); C
///
Projective Curve over Rational Field defined by x^4 - 2*x^3*y + x^2*y^2 + 2*x^3*z - 4*x^2*y*z + 2*x*y^2*z + x^2*z^2 - 2*x*y*z^2 + y^2*z^2
}}}

{{{id=15|
C.irreducible_components()
///
[
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
  x + z,
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
  x - y
]
}}}

{{{id=16|
Curve(C.irreducible_components()[1]).genus()
///
0
}}}

{{{id=0|
R.<x> = ZZ[]
f = x^20 - 3*x^2 + 1
H = HyperellipticCurve(f); H
///
Hyperelliptic Curve over Integer Ring defined by y^2 = x^20 - 3*x^2 + 1
}}}

{{{id=1|
H.genus()
///
9
}}}

{{{id=3|
p = next_prime(2009)
R.<x> = GF(p)[]
f = x^20 - 3*x^2 + 1
H = HyperellipticCurve(f); H
///
Hyperelliptic Curve over Finite Field of size 2011 defined by y^2 = x^20 + 2008*x^2 + 1
}}}

{{{id=4|
time pts = H.points()
///
Time: CPU 0.82 s, Wall: 0.84 s
}}}

{{{id=6|
len(pts)
///
1891
}}}

{{{id=7|

///
}}}