Hyperelliptic curves

A hyperelliptic curve C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

A few functions, sharing the prefix genus2, are specific to the genus 2 case (Q2 + 4 P has degree 5 or 6).


genus2charpoly(C, p)

C being a genus-2 curve, returns the characteristic polynomial of the action of the Frobenius on the Picard group of C at p. When p = 2 and 2 has bad reduction, the result might be incorrect. C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? C = [x^5+x^4-5*x^3-4*x^2+6*x,x^3+x^2];
  ? forprime(p=2,11,print(p," : ",genus2charpoly(C,p)))
  2 : x^2 + x + 2
  3 : x^2 + 2*x + 1
  5 : x^3 + x^2 + 3*x - 5
  7 : x^4 + 14*x^2 + 49
  11 : x^4 + 6*x^2 + 121

The library syntax is GEN genus2charpoly(GEN C, GEN p).


genus2igusa(PQ, {k})

Let PQ be a polynomial P, resp. a vector [P,Q] of polynomials defined over a field F of characteristic != 2. Returns the Igusa invariants [J2,J4,J6,J8,J10] of the hyperelliptic curve C/F, defined by the equation y2 = P(x), resp. y2 + Q(x)*y = P(x). If k is given, only return the invariant of degree k (k must be even between 2 and 10).

  ? genus2igusa(x^5+3*x^2-4)
  %1 = [0, 9600, 20736, -23040000, 177926144]
  ? genus2igusa([x^6+x^5-x^4+3*x^3+x^2-2*x+1,x^3-x^2+x-1])
  %2 = [-788, 1958, 341220, -68178781, -662731520]
  ? genus2igusa([x^6+x^5-x^4+3*x^3+x^2-2*x+1,x^3-x^2+x-1],4)
  %3 = 1958
  ? genus2igusa(x^5+3*Mod(a,a^2-3)*x^2-4) \\  {over ℚ(sqrt{3})}
  %4 = [Mod(0, a^2 - 3), Mod(9600*a, a^2 - 3), Mod(186624, a^2 - 3),
        Mod(-69120000, a^2 - 3), Mod(-241864704*a + 204800000, a^2 - 3)]
  ? a = ffgen([3,4], 'a); \\  {over 𝔽34 = 𝔽3[a]}
  ? genus2igusa(x^6+a*x^5-a*x^4+2*x^3+a*x+a+1)
  %6 = [2*a^2, a^3 + a^2 + a + 1, a^2 + a + 2, 2*a^3 + 2*a^2 + a + 1,
        2*a^2 + 2]
  ? a = ffgen([2,4], 'a); \\  {𝔽24 = 𝔽2[a]}
  ? genus2igusa(x^6+a*x^5+a*x^4+a*x+a+1) \\ doesn't work in characteristic 2
    ***   at top-level: genus2igusa(x^6+a*x^5+a*x^4+a*x+a+1)
    ***                 ^ —  —  —  —  —  —  —  —  —  —  —  — 
    *** genus2igusa: impossible inverse in FF_mul2n: 2.

The library syntax is GEN genus2igusa(GEN PQ, long k).


genus2red(PQ, {p})

Let PQ be a polynomial P, resp. a vector [P,Q] of polynomials, with rational coefficients. Determines the reduction at p > 2 of the (proper, smooth) genus 2 curve C/ℚ, defined by the hyperelliptic equation y2 = P(x), resp. y2 + Q(x)*y = P(x). (The special fiber Xp of the minimal regular model X of C over ℤ.)

If p is omitted, determines the reduction type for all (odd) prime divisors of the discriminant.

This function was rewritten from an implementation of Liu's algorithm by Cohen and Liu (1994), genus2reduction-0.3, see https://www.math.u-bordeaux.fr/~liu/G2R/.

CAVEAT. The function interface may change: for the time being, it returns [N,FaN, [Pm, Qm], V] where N is either the local conductor at p or the global conductor, FaN is its factorization, y2 +Qm y = Pm defines a minimal model over ℤ and V describes the reduction type at the various considered p. Unfortunately, the program is not complete for p = 2, and we may return the odd part of the conductor only: this is the case if the factorization includes the (impossible) term 2-1; if the factorization contains another power of 2, then this is the exact local conductor at 2 and N is the global conductor.

  ? default(debuglevel, 1);
  ? genus2red(x^6 + 3*x^3 + 63, 3)
  (potential) stable reduction: [1, []]
  reduction at p: [III{9}] page 184, [3, 3], f = 10
  %1 = [59049, Mat([3, 10]), x^6 + 3*x^3 + 63, [3, [1, []],
         ["[III{9}] page 184", [3, 3]], Vecsmall([0, 0, 2])]]
  ? [N, FaN, T, V] = genus2red([x^2-x, x^3-x^2-1]); \\ X1(13), global reduction
  p = 13
  (potential) stable reduction: [5, [Mod(0, 13), Mod(0, 13)]]
  reduction at p: [I{0}-II-0] page 159, [], f = 2
  ? N
  %3 = 169
  ? FaN
  %4 = Mat([13, 2])   \\ in particular, good reduction at 2 !
  ? T
  %5 = [-x^5 - x^3 + x^2 - x, x^3 + x^2 + 1]
  ? V
  %6 = [[13, [5, [Mod(0, 13), Mod(0, 13)]], ["[I{0}-II-0] page 159", []],
             Vecsmall([1, 0, 1])]]

We now first describe the format of the vector V = Vp in the case where p was specified (local reduction at p): it is a quadruple [p, stable, red, pic]. The component stable = [type, vecj] contains information about the stable reduction after a field extension; depending on types, the stable reduction is

* 1: smooth (i.e. the curve has potentially good reduction). The Jacobian J(C) has potentially good reduction.

* 2: an elliptic curve E with an ordinary double point; vecj contains j mod p, the modular invariant of E. The (potential) semi-abelian reduction of J(C) is the extension of an elliptic curve (with modular invariant j mod p) by a torus.

* 3: a projective line with two ordinary double points. The Jacobian J(C) has potentially multiplicative reduction.

* 4: the union of two projective lines crossing transversally at three points. The Jacobian J(C) has potentially multiplicative reduction.

* 5: the union of two elliptic curves E1 and E2 intersecting transversally at one point; vecj contains their modular invariants j1 and j2, which may live in a quadratic extension of 𝔽p and need not be distinct. The Jacobian J(C) has potentially good reduction, isomorphic to the product of the reductions of E1 and E2.

* 6: the union of an elliptic curve E and a projective line which has an ordinary double point, and these two components intersect transversally at one point; vecj contains j mod p, the modular invariant of E. The (potential) semi-abelian reduction of J(C) is the extension of an elliptic curve (with modular invariant j mod p) by a torus.

* 7: as in type 6, but the two components are both singular. The Jacobian J(C) has potentially multiplicative reduction.

The component red = [NUtype, neron] contains two data concerning the reduction at p without any ramified field extension.

The NUtype is a t_STR describing the reduction at p of C, following Namikawa-Ueno, The complete classification of fibers in pencils of curves of genus two, Manuscripta Math., vol. 9, (1973), pages 143-186. The reduction symbol is followed by the corresponding page number or page range in this article.

The second datum neron is the group of connected components (over an algebraic closure of 𝔽p) of the Néron model of J(C), given as a finite abelian group (vector of elementary divisors).

If p = 2, the red component may be omitted altogether (and replaced by [], in the case where the program could not compute it. When p was not specified, V is the vector of all Vp, for all considered p.

The component pic is t_VECSMALL with 3 components [ra,rt,ru] describing the Picard group of the curve: ra is the Abelian rank, rt is the toric rank, and ru is the unipotent rank. If p = 2, the pic component is currently omitted.

Notes about Namikawa-Ueno types.

* A lower index is denoted between braces: for instance, [I{2}-II-5] means [I2-II-5].

* If K and K' are Kodaira symbols for singular fibers of elliptic curves, then [K-K'-m] and [K'-K-m] are the same.

We define a total ordering on Kodaira symbol by fixing I < I* < II < II*,.... If the reduction type is the same, we order by the number of components, e.g. I2 < I4, etc. Then we normalize our output so that K ≤ K'.

* [K-K'--1] is [K-K'-α] in the notation of Namikawa-Ueno.

* The figure [2I0-m] in Namikawa-Ueno, page 159, must be denoted by [2I0-(m+1)].

The library syntax is GEN genus2red(GEN PQ, GEN p = NULL).


hyperellauto(C, {nf})

C being a hyperelliptic curve given by a Weierstrass equation, either over the rationals or over the number field nf if given, return the group of automorphisms of C as a vector of changes of coordinates of the form [e, [a,b;c,d], H], see hyperellchangecurve.

C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

The library syntax is GEN hyperellauto(GEN C, GEN nf = NULL).


hyperellchangecompose(C, m1, m2)

C being a hyperelliptic curve given by a Weierstrass equation, compose the changes of coordinates given by m1 and m2, see hyperellchangecurve.

C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? C = [Pol([a6,a5,a4,a3,a2,a1,a0]), Pol([b2,b1,b0])];
  ? m1 = [6, [0,1;2,3], 4*x^3+3*x^2+2*x+1];
  ? m2 = [7, [1,2;3,4], 5*x^3+4*x^2+3*x+2];
  ? m = hyperellchangecompose(C, m1, m2);
  ? A = hyperellchangepoint(C, hyperellchangepoint(C,[X,Y], m1), m2);
  ? A == hyperellchangepoint(C, [X,Y], m)
  %6 = 1

The library syntax is GEN hyperellchangecompose(GEN C, GEN m1, GEN m2).


hyperellchangecurve(C, m)

C being a hyperelliptic curve given by a Weierstrass equation, apply the change of coordinates given by m = [e, [a,b;c,d], H].

If (X,Y) is a point on the new model, the corresponding point (x,y) on C is given by

x = (a X + b) / (c X + d), y = (e Y + H(X)) / (c X + d)g+1.

The input C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree. The output curve is given in [P, Q] format, where Q may be 0.

The library syntax is GEN hyperellchangecurve(GEN C, GEN m).


hyperellchangeinvert(C, m)

C being a hyperelliptic curve given by a Weierstrass equation, invert the change of coordinates given by m = [e, [a,b;c,d], H], see hyperellchangecurve.

C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

The library syntax is GEN hyperellchangeinvert(GEN C, GEN m).


hyperellchangepoint(C, p, m)

C being a hyperelliptic curve given by a Weierstrass equation, apply the change of coordinates given by m = [e, [a,b;c,d], H] to the point p of C, see hyperellchangecurve.

C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

The point p can be given either

* in weighted projective coordinates: [x,y,z] stands for [x:y:z], where [x:y:z] = [λ x:λg+1 y:λ z] for any non-zero λ,

* or in affine coordinates: [x,y] stands for [x:y:1] and [y] stands for [1:y:0].

This function returns a point in the same system of coordinates as p.

The library syntax is GEN hyperellchangepoint(GEN C, GEN p, GEN m).


hyperellchangepointinv(C, p, m)

C being a hyperelliptic curve given by a Weierstrass equation, apply the reverse of the change of coordinates given by m = [e, [a,b;c,d], H] to the point p of C, see hyperellchangecurve.

C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

The point p can be given either

* in weighted projective coordinates: [x,y,z] stands for [x:y:z], where [x:y:z] = [λ x:λg+1 y:λ z] for any non-zero λ,

* or in affine coordinates: [x,y] stands for [x:y:1] and [y] stands for [1:y:0].

This function returns a point in the same system of coordinates as p.

The library syntax is GEN hyperellchangepointinv(GEN C, GEN p, GEN m).


hyperellcharpoly(X)

X being a nonsingular hyperelliptic curve defined over a finite field, return the characteristic polynomial of the Frobenius automorphism. X can be given either by a squarefree polynomial P such that X: y2 = P(x) or by a vector [P,Q] such that X: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

The library syntax is GEN hyperellcharpoly(GEN X).


hyperelldisc(X)

X being a nonsingular hyperelliptic model of a curve, defined over a field of characteristic distinct from 2, returns its discriminant. X can be given either by a squarefree polynomial P such that X has equation y2 = P(x) or by a vector [P,Q] such that X has equation y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? hyperelldisc([x^3,1])
  %1 = -27
  ? hyperelldisc(x^5+1)
  %2 = 800000

The library syntax is GEN hyperelldisc(GEN X).


hyperellextremalmodels(C, p)

C being a hyperelliptic curve given by an integral Weierstrass equation, compute a maximal chain of minimal Weierstrass models at the prime number p. Return a vector [n, V] where n is the length of the chain of minimal Weierstrass models at p, and V is vector of length 1 or 2 containing the extremal models of the chain.

The library syntax is GEN hyperellextremalmodels(GEN C, GEN p).


hyperellisisom(C1, C2, {nf})

C1 and C2 being two hyperelliptic curve given by Weierstrass equations, either over the rationals or over the number field nf if given, return the list of isomorphisms from C1 to C2 as changes of coordinates of the form [e, [a,b;c,d], H], see hyperellchangecurve.

The library syntax is GEN hyperellisisom(GEN C1, GEN C2, GEN nf = NULL).


hyperellisoncurve(X, p)

X being a nonsingular hyperelliptic model of a curve, test whether the point p is on the curve.

X can be given either by a squarefree polynomial P such that X: y2 = P(x) or by a vector [P,Q] such that X: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? W = [2*x^6+3*x^5+x^4+x^3-x,x^3+1]; p = [px, py] = [1/3,-14/27];
  ? hyperellisoncurve(W, p)
  %2 = 1
  ? [Px,Qx]=subst(W,x,px); py^2+py*Qx == Px
  %3 = 1

The library syntax is int hyperellisoncurve(GEN X, GEN p).


hyperellminimaldisc(C, {pr})

C being a hyperelliptic curve given by an integral Weierstrass equation, return the minimal discriminant of an integral model of C. If pr is given, it must be a list of primes and the discriminant is then only guaranteed minimal at the elements of pr. C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? W = [x^6+216*x^3+324,0];
  ? D = hyperelldisc(W)
  %2 = 1828422898924853919744000
  ? M = hyperellminimaldisc(W)
  %4 = 29530050606000

The library syntax is GEN hyperellminimaldisc(GEN C, GEN pr = NULL).


hyperellminimalmodel(C, {&m}, {pr})

C being a hyperelliptic curve given by an integral Weierstrass equation, return an integral model of C with minimal discriminant. If pr is given, it must be a list of primes and the model is then only guaranteed minimal at the elements of pr. If present, m is set to the mapping from the original model to the new one: a three-component vector [e,[a,b;c,d],H] such that if (x,y) is a point on W, the corresponding point on C is given by xC = (a*x+b)/(c*x+d), yC = (e*y+H(x))/(c*x+d)g+1, where g is the genus. C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? W = [x^6+216*x^3+324,0];
  ? D = hyperelldisc(W)
  %2 = 1828422898924853919744000
  ? Wn = hyperellminimalmodel(W,&M)
  %3 = [2*x^6+18*x^3+1,x^3];
  ? M
  %4 = [18, [3, 0; 0, 1], 9*x^3]
  ? hyperelldisc(Wn)
  %5 = 29530050606000
  ? hyperellchangecurve(W, M)
  %6 = [2*x^6+18*x^3+1,x^3]

The library syntax is GEN hyperellminimalmodel(GEN C, GEN *m = NULL, GEN pr = NULL).


hyperellordinate(H, x)

Gives a 0, 1 or 2-component vector containing the y-coordinates of the points of the curve H having x as x-coordinate. If x = oo, return the list of y such that [y] (that is [1:y:0] in weighted projective coordinates) is on the curve. H can be given either by a squarefree polynomial P such that H has equation y2 = P(x) or by a vector [P,Q] such that H has equation y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? hyperellordinate([x^3,1], 0)
  %1 = [0, -1]
  ? hyperellordinate(x^5+1, 2)
  %2 = []
  ? hyperellordinate([6*x^4,x^2], oo)
  %3 = [2,-3]
  ? hyperellisoncurve([6*x^4,x^2],[2])
  %4 = 1
  ? hyperellisoncurve([6*x^4,x^2],[1,-3,0])
  %5 = 1

The library syntax is GEN hyperellordinate(GEN H, GEN x).


hyperellpadicfrobenius(Q, q, n)

Let X be the curve defined by y2 = Q(x), where Q is a polynomial of degree d over ℚ and q ≥ d is a prime such that X has good reduction at q. Return the matrix of the Frobenius endomorphism ϕ on the crystalline module Dp(X) = ℚp ⨂ H1dR(X/ℚ) with respect to the basis of the given model (ω, x ω,...,xg-1 ω), where ω = dx/(2 y) is the invariant differential, where g is the genus of X (either d = 2 g+1 or d = 2 g+2). The characteristic polynomial of ϕ is the numerator of the zeta-function of the reduction of the curve X modulo q. The matrix is computed to absolute q-adic precision qn.

Alternatively, q may be of the form [T,p] where p is a prime, T is a polynomial with integral coefficients whose projection to 𝔽p[t] is irreducible, X is defined over K = ℚ[t]/(T) and has good reduction to the finite field 𝔽q = 𝔽p[t]/(T). The matrix of ϕ on Dq(X) = ℚq ⨂ H1dR(X/K) is computed to absolute p-adic precision pn.

  ? M=hyperellpadicfrobenius(x^5+'a*x+1,['a^2+1,3],10);
  ? liftall(M)
  [48107*a + 38874  9222*a + 54290  41941*a + 8931 39672*a + 28651]
  
  [ 21458*a + 4763  3652*a + 22205 31111*a + 42559 39834*a + 40207]
  
  [ 13329*a + 4140 45270*a + 25803  1377*a + 32931 55980*a + 21267]
  
  [15086*a + 26714  33424*a + 4898 41830*a + 48013  5913*a + 24088]
  ? centerlift(simplify(liftpol(charpoly(M))))
  %8 = x^4+4*x^2+81
  ? hyperellcharpoly((x^5+Mod(a,a^2+1)*x+1)*Mod(1,3))
  %9 = x^4+4*x^2+81

The library syntax is GEN hyperellpadicfrobenius0(GEN Q, GEN q, long n). The functions GEN hyperellpadicfrobenius(GEN H, ulong p, long n) and GEN nfhyperellpadicfrobenius(GEN H, GEN T, ulong p, long n) are also available.


hyperellperiods(X, {flag})

X being a nonsingular hyperelliptic curve defined over the complex, return a period matrix for the integration pairing H1(X,Ω1) x H1(X,ℤ) → ℂ. X can be given either by a squarefree polynomial P such that X: y2 = P(x) or by a vector [P,Q] such that X:y2+Q(x)y = P(x) and Q2 + 4P is squarefree. If flag = 0 (default), return a reduced period in the Siegel space, obtained when the differentials form a dual basis of the first homology cycles. If flag = 1, return the big period matrix whose 2g columns correspond to a symplectic basis of H1(X,ℤ), and whose g rows correspond to the differentials (xk dx )/(y). if flag = 2, return the period occuring in the BSD conjecture, that is the volume of the real part of the period lattice multiplied by the number of connected components.

The library syntax is GEN hyperellperiods(GEN X, long flag, long prec).


hyperellratpoints(X, h, {flag = 0})

X being a nonsingular hyperelliptic curve given by a rational model, return a vector containing the affine rational points on the curve of naive height less than h. If flag = 1, stop as soon as a point is found; return either an empty vector or a vector containing a single point.

X is given either by a squarefree polynomial P such that X: y2 = P(x) or by a vector [P,Q] such that X: y2+Q(x) y = P(x) and Q2+4 P is squarefree.

The parameter h can be

* an integer H: find the points [n/d,y] whose abscissas x = n/d have naive height ( = max(|n|, d)) less than H;

* a vector [N,D] with D ≤ N: find the points [n/d,y] with |n| ≤ N, d ≤ D.

* a vector [N,[D1,D2]] with D1 < D2 ≤ N find the points [n/d,y] with |n| ≤ N and D1 ≤ d ≤ D2.

The library syntax is GEN hyperellratpoints(GEN X, GEN h, long flag).


hyperellred(C, {&m})

Let C be a nonsingular integral hyperelliptic model of a curve of positive genus g > 0. Return an integral model of C with the same discriminant but small coefficients, using Cremona-Stoll reduction.

The optional argument m is set to the mapping from the original model to the new one, given by a three-component vector [1,[a,b;c,d],H] such that a*d-b*c = 1 and if (x,y) is a point on W, the corresponding point (X,Y) on C is given by

X = (ax + b) / (cx + d), Y = (y + H(x)) / (cx + d)g+1.

C can be given either by a squarefree polynomial P such that C: y2 = P(x) or by a vector [P,Q] such that C: y2 + Q(x) y = P(x) and Q2+4 P is squarefree.

  ? P = 1001*x^4 + 3704*x^3 + 5136*x^2 + 3163*x + 730;
  ? hyperellred(P, &m)
  %2 = [x^3 + 1, 0]
  ? hyperellchangecurve(P, m)
  %3 = [x^3 + 1, 0]

The library syntax is GEN hyperellred(GEN C, GEN *m = NULL).

Also available is GEN ZX_hyperellred(GEN P, GEN *M) where C: y2 = P(x) and *M is set to [a,b;c,d]