---
title: "Points"
canonical: "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/HyperellipticCurves/points.html"
source: "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/HyperellipticCurves/points.md"
part: "Arithmetic Geometry"
chapter: "Hyperelliptic Curves"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Arithmetic Geometry", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/index-arithmetic-geometry.md"}
  - {"title": "Hyperelliptic Curves", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/HyperellipticCurves/index-hyperelliptic-curves.md"}
prev: {"title": "Function Field", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/HyperellipticCurves/function_field.md"}
next: {"title": "Jacobians", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/HyperellipticCurves/jacobian.md"}
intrinsics:
  - {"name": "!", "signature": "C ! [x, y]: CrvHyp, [RngElt] -> PtHyp"}
  - {"name": "!", "signature": "C ! [x, y, z]: CrvHyp, [RngElt] -> PtHyp"}
  - {"name": "elt", "signature": "elt< PS | x, y >: SetPtHyp, RngElt, RngElt, RngElt -> PtHyp"}
  - {"name": "elt", "signature": "elt< PS | x, y, z >: SetPtHyp, RngElt, RngElt, RngElt -> PtHyp"}
  - {"name": "!", "signature": "C ! P: CrvHyp, PtHyp -> PtHyp"}
  - {"name": "Points", "signature": "Points(C, x): CrvHyp, RngElt -> SetIndx"}
  - {"name": "RationalPoints", "signature": "RationalPoints(C, x): CrvHyp, RngElt -> SetIndx"}
  - {"name": "Points", "signature": "Points(C, x): CrvHyp, Infty -> SetIndx"}
  - {"name": "RationalPoints", "signature": "RationalPoints(C, x): CrvHyp, Infty -> SetIndx"}
  - {"name": "PointsAtInfinity", "signature": "PointsAtInfinity(C): CrvHyp -> SetIndx"}
  - {"name": "IsPoint", "signature": "IsPoint(C, S): CrvHyp, SeqEnum -> BoolElt, PtHyp"}
  - {"name": "Random", "signature": "Random(C): CrvHyp -> PtHyp"}
  - {"name": "eq", "signature": "P eq Q: PtHyp, PtHyp -> BoolElt"}
  - {"name": "ne", "signature": "P ne Q: PtHyp, PtHyp -> BoolElt"}
  - {"name": "P[i]", "signature": "P[i]: PtHyp, RngIntElt -> RngElt"}
  - {"name": "Eltseq", "signature": "Eltseq(P): PtHyp -> SeqEnum"}
  - {"name": "ElementToSequence", "signature": "ElementToSequence(P): PtHyp -> SeqEnum"}
  - {"name": "-", "signature": "- P: PtHyp -> PtHyp"}
  - {"name": "Involution", "signature": "Involution(P): PtHyp -> PtHyp"}
  - {"name": "NumberOfPointsAtInfinity", "signature": "NumberOfPointsAtInfinity(C): CrvHyp -> RngIntElt"}
  - {"name": "PointsAtInfinity", "signature": "PointsAtInfinity(C): CrvHyp -> SetIndx"}
  - {"name": "#", "signature": "# C: CrvHyp -> RngIntElt"}
  - {"name": "Points", "signature": "Points(C): CrvHyp -> SetIndx"}
  - {"name": "RationalPoints", "signature": "RationalPoints(C): CrvHyp -> SetIndx"}
  - {"name": "RationalPoints", "signature": "RationalPoints(C): SetPtHyp -> SetIndx"}
  - {"name": "PointsGenus2", "signature": "PointsGenus2(C): CrvHyp -> SetIndx, BoolElt, RngIntElt"}
  - {"name": "RationalPointsGenus2", "signature": "RationalPointsGenus2(C): CrvHyp -> SetIndx, BoolElt, RngIntElt"}
  - {"name": "PointsKnown", "signature": "PointsKnown(C): CrvHyp -> BoolElt"}
  - {"name": "Frobenius", "signature": "Frobenius(P, F): PtHyp, FldFin -> PtHyp"}
  - {"name": "FrobeniusMatrix", "signature": "FrobeniusMatrix(C, p): CrvHyp, RngIntElt -> Mtrx"}
examples:
  - "ex-c9370e"
  - "ex-814aee"
---

# Points

The hyperelliptic curve is embedded in a weighted projective space, with weights $1$, $g+1$, and $1$, respectively on $x$, $y$, and $z$. Therefore point triples satisfy the equivalence relation $(x : y : z) = (\mu x : \mu^{g+1} y : \mu z)$, and the points at infinity are then normalized to take the form $(1 : y : 0)$.

## Creation of Points

<a id="operation-op-crvhyp-rngelt"></a>
### `C ! [x, y]: CrvHyp, [RngElt] -> PtHyp`

<a id="operation-op-crvhyp-rngelt-2"></a>
### `C ! [x, y, z]: CrvHyp, [RngElt] -> PtHyp`

<a id="constructor-constructor-elt-setpthyp-rngelt-rngelt-rngelt-pthyp"></a>
### `elt< PS | x, y >: SetPtHyp, RngElt, RngElt, RngElt -> PtHyp`

<a id="constructor-constructor-elt-setpthyp-rngelt-rngelt-rngelt-pthyp-2"></a>
### `elt< PS | x, y, z >: SetPtHyp, RngElt, RngElt, RngElt -> PtHyp`

Returns the point on a hyperelliptic curve $C$ specified by the coordinates $(x,y,z)$. The `elt` constructor takes the pointset of a hyperelliptic curve as an argument. If $z$ is not specified it is assumed to be $1$.

<a id="operation-op-crvhyp-pthyp"></a>
### `C ! P: CrvHyp, PtHyp -> PtHyp`

Given a point $P$ on a hyperelliptic curve $C_1$, such that $C$ is a base extension of $C_1$, this returns the corresponding point on the hyperelliptic curve $C$. The curve $C$ can be, e.g., the reduction of $C_1$ to finite characteristic (i.e., base extension to a finite field) or the tautological coercion to itself.

<a id="function-points-crvhyp-rngelt"></a>
### `Points(C, x): CrvHyp, RngElt -> SetIndx`

<a id="function-rationalpoints-crvhyp-rngelt"></a>
### `RationalPoints(C, x): CrvHyp, RngElt -> SetIndx`

<a id="function-points-crvhyp-infty"></a>
### `Points(C, x): CrvHyp, Infty -> SetIndx`

<a id="function-rationalpoints-crvhyp-infty"></a>
### `RationalPoints(C, x): CrvHyp, Infty -> SetIndx`

The indexed set of all rational points on the hyperelliptic curve $C$ that have the value $x$ as their $x$-coordinate. (Rational points are those with coordinates in the coefficient ring of $C$). Note that points at infinity are considered to have $\infty$ as their $x$-coordinate.

<a id="function-pointsatinfinity-crvhyp"></a>
### `PointsAtInfinity(C): CrvHyp -> SetIndx`

The points at infinity for the hyperelliptic curve $C$ returned as an indexed set of points.

<a id="function-ispoint-crvhyp-seqenum"></a>
### `IsPoint(C, S): CrvHyp, SeqEnum -> BoolElt, PtHyp`

The function returns `true` if and only if the sequence $S$ specifies a point on the hyperelliptic curve $C$, and if so, returns this point as the second value.

<a id="example-ex-c9370e"></a>
### `Example: Points at Infinity (ex-c9370e)`

We look at the point at infinity on $y^2=x^5+1$.

```magma
> P<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(x^5+1);
> PointsAtInfinity(C);
{@ (1 : 0 : 0) @}
```

There is only one, and to see that this really is a point on $C$ it must be remembered that in Magma, all hyperelliptic curves are considered to live in weighted projective spaces:

```magma
> Ambient(C);
Projective Space of dimension 2
Variables : $.1, $.2, $.3
Gradings :
1       3       1
```

In fact, the point is nonsingular on $C$, as we now check. (It’s worth remembering that all the functionality for curves, for instance `IsNonsingular`, applies to hyperelliptic curves as a special case.)

```magma
> pointAtInfinity := C![1,0,0];  // Entering the point by hand.
> IsNonsingular(pointAtInfinity);
true
```

## Random Points

<a id="function-random-crvhyp"></a>
### `Random(C): CrvHyp -> PtHyp`

Given a hyperelliptic curve $C$ defined over a finite field, this returns a point chosen at random on the curve. If the set of all points on $C$ has already been computed, this gives a truly random point, otherwise the ramification points have a slight advantage.

## Predicates on Points

<a id="operation-op-eq-pthyp-pthyp"></a>
### `P eq Q: PtHyp, PtHyp -> BoolElt`

Returns `true` if and only if the two points $P$ and $Q$ on the same hyperelliptic curve have the same coordinates.

<a id="operation-op-ne-pthyp-pthyp"></a>
### `P ne Q: PtHyp, PtHyp -> BoolElt`

Returns `false` if and only if the two points $P$ and $Q$ on the same hyperelliptic curve have the same coordinates.

## Access Operations

<a id="literal-literal-p-i-pthyp-rngintelt-rngelt"></a>
### `P[i]: PtHyp, RngIntElt -> RngElt`

The $i$-th coordinate of the point $P$, for $1\leq i\leq 3$.

<a id="function-eltseq-pthyp"></a>
### `Eltseq(P): PtHyp -> SeqEnum`

<a id="function-elementtosequence-pthyp"></a>
### `ElementToSequence(P): PtHyp -> SeqEnum`

Given a point $P$ on a hyperelliptic curve, this returns a $3$-element sequence consisting of the coordinates of the point $P$.

## Arithmetic of Points

<a id="operation-operation-pthyp-pthyp"></a>
### `- P: PtHyp -> PtHyp`

<a id="function-involution-pthyp"></a>
### `Involution(P): PtHyp -> PtHyp`

Given a point $P$ on a hyperelliptic curve, this returns the image of $P$ under the hyperelliptic involution.

## Enumeration and Counting Points

<a id="function-numberofpointsatinfinity-crvhyp"></a>
### `NumberOfPointsAtInfinity(C): CrvHyp -> RngIntElt`

The number of points at infinity on the hyperelliptic curve $C$.

<a id="function-pointsatinfinity-crvhyp-2"></a>
### `PointsAtInfinity(C): CrvHyp -> SetIndx`

The points at infinity for the hyperelliptic curve $C$ returned as an indexed set of points.

<a id="operation-operation-crvhyp-rngintelt"></a>
### `# C: CrvHyp -> RngIntElt`

Given a hyperelliptic curve $C$ defined over a finite field, this returns the number of rational points on $C$.

If the base field is small or there is no other good alternative, a naive point counting technique is used. However, if they are applicable, the faster $p$-adic methods described in the `#J` section are employed (which actually yield the full zeta function of $C$). As for `#J`, the verbose flag `JacHypCnt` can be used to output information about the computation.

<a id="function-points-crvhyp"></a>
### `Points(C): CrvHyp -> SetIndx`

<a id="function-rationalpointscrvhyplabel"></a>
### `RationalPoints(C): CrvHyp -> SetIndx`

<a id="function-rationalpoints-setpthyp"></a>
### `RationalPoints(C): SetPtHyp -> SetIndx`

```magma
Bound           : RngIntElt                    Default: 
NPrimes         : RngIntElt                    Default: 30
DenominatorBound: RngIntElt                    Default: Bound
```

For a hyperelliptic curve $C$ defined over a finite field, the function returns an indexed set of all rational points on $C$.

For a curve $C$ over ${\mathbb{Q}}$ of the form $y^2 = f(x)$ with integral coefficients, it returns the set of points such that the naive height of the $x$-coordinate is less than `Bound`.

For a curve $C$ over a number field, it returns the set of points in a search region which is controlled by the parameters `Bound` (which must be specified) and `DenominatorBound`. The algorithm is a sieve method, described in Appendix A of [[Bru02](https://docs.magma-maths.org/v2.30-1/references.md#cite-bruin-phdthesis)]. The parameter `NPrimes` controls the number of primes to be used for the sieve.

<a id="function-pointsgenus2-crvhyp"></a>
### `PointsGenus2(C): CrvHyp -> SetIndx, BoolElt, RngIntElt`

<a id="function-rationalpointsgenus2"></a>
### `RationalPointsGenus2(C): CrvHyp -> SetIndx, BoolElt, RngIntElt`

```magma
Bound1     : RngIntElt                    Default: 1000
Bound2     : RngIntElt                    Default: 20000
Fast       : BoolElt                      Default: false
RankBound  : RngIntElt                    Default: Infinity()
PrimeCutoff: RngIntElt                    Default: 10000
```

For a curve $C$ over ${\mathbb{Q}}$ of the form $y^2 = f(x)$ try to determine the set of rational points

This returns a set of rational points on the curve, a flag indicating whether we know that these are all the points, and if this is not the case, a number such that all the points of (multiplicative x-coordinate) height up to that bound are included in the set.

`Bound1` is an argument passed to `RationalPoints`. Same is true for `Bound2`, which will be called after the first search for small points has failed, and the curve is everywhere locally soluble. If `Fast` is set, smaller bounds than the default ones are used in the call to `MordellWeilGroupGenus2` for the search on 2-coverings. This has the effect of making this function fail faster when otherwise a time-intensive search for rational points on 2-coverings would be triggered. `PrimeCutoff` is passed on to `TwoCoverDescent`.

This function uses a combination of techniques:

**i)**
search for (relatively small) points,

**ii)**
test for everywhere local solubility,

**iii)**
two-cover descent,

**iv)**
degree 2 and 3 elliptic subcovers of rank zero,

**v)**
computation of generators of a finite-index subgroup of the Mordell-Weil group,

**vi)**
Chabauty when the rank is at most 1,

**vii)**
a check whether the curve has rational divisors of odd degree,

**viii)**
if the rank is at least 2 and no points were found, a Mordell-Weil sieve computation.

The two possible failure modes are:

**i)**
failure to determine the rank

**ii)**
rank is at least 2 and rational points exist; in these cases the result is `false`, and it returns the set of rational points up to the height bound for the search.

<a id="function-pointsknown-crvhyp"></a>
### `PointsKnown(C): CrvHyp -> BoolElt`

Returns `true` if and only if the points of the hyperelliptic curve $C$ have been computed. This can especially be helpful when the curve is likely to have many points and when one does not wish to trigger the possibly expensive point computation.

<a id="example-ex-814aee"></a>
### `Example: Points on a Curve of Diophantus (ex-814aee)`

For the following classical curve of Diophantus’ *Arithmetica*, it is proved by Joseph Wetherell [[Wet97](https://docs.magma-maths.org/v2.30-1/references.md#cite-weth97th)] that Diophantus found all positive rational points. The following Magma code enumerates the points on this curve.

```magma
> P<x> := PolynomialRing(Rationals());
> C := HyperellipticCurve(x^6+x^2+1);
> Points(C : Bound := 1);
{@ (1 : -1 : 0), (1 : 1 : 0), (0 : -1 : 1), (0 : 1 : 1) @}
> Points(C : Bound := 2);
{@ (1 : -1 : 0), (1 : 1 : 0), (0 : -1 : 1), (0 : 1 : 1), (-1 : -9 : 2),
(-1 : 9 : 2), (1 : -9 : 2), (1 : 9 : 2) @}
> Points(C : Bound := 4);
{@ (1 : -1 : 0), (1 : 1 : 0), (0 : -1 : 1), (0 : 1 : 1), (-1 : -9 : 2),
(-1 : 9 : 2), (1 : -9 : 2), (1 : 9 : 2) @}
```

## Frobenius

<a id="function-frobenius-pthyp-fldfin"></a>
### `Frobenius(P, F): PtHyp, FldFin -> PtHyp`

```magma
Check: BoolElt                    Default: true
```

Applies the Frobenius $x -> x^{(\#F)}$ to $P$. If `Check` is `true`, it verifies that the curve of which $P$ is a point is defined over the finite field $F$.

<a id="function-frobeniusmatrix-crvhyp-rngintelt"></a>
### `FrobeniusMatrix(C, p): CrvHyp, RngIntElt -> Mtrx`

```magma
Precision: RngIntElt                    Default: 10
```

Given a hyperelliptic curve over the rationals and a good prime $p$, this computes the matrix corresponding to the action of Frobenius to the indicated precision. The basis used is $x^e(dx/y)$ for $0\le e<d-1$, where the curve is given by $y^2=f(x)$ with $f$ of degree $d$.
