WorksMathematics
ECPack.wl: A Mathematica Package for Elliptic Curves over the Rationals and Finite Fields
Abstract
We present a Mathematica package entitled ECPack.wl, where we implement many important properties and commands relevant to the study of elliptic curves over the rationals and finite fields, namely and , where and is prime. By streamlining the analysis of general elliptic curves and their transformations, ECPack.wl offers foundational computational tools for applications in high-energy physics, including elliptic Feynman integrals. This package significantly extends the functionalities of a package due to McGee in so far as we are able to study all versions of elliptic curves, such as the long Weierstrass, quartic and Legendre forms. We implement suitable transformations that are required for the general case, as well as those associated with fields of characteristic 2 and 3. Furthermore, the package computes many curve properties, such as point arithmetic, minimality checks, rank bounds and analytic rank, group structure, invariants, and the Weil and Tate pairings, over both and , as well as the Kodaira classification of the singular fibres of one-parameter families of elliptic curves, with the associated F-theory data. The package and its accompanying notebooks are available at https://github.com/DhamakedarDarsh/Mathematica-Code-and-worked-out-notebooks-for-Elliptic-Curves
Program Summary
Program Title: ECPack.wl, version 1.0
Repository Link: https://github.com/DhamakedarDarsh/Mathematica-Code-and-worked-out-notebooks-for-Elliptic-Curves
Licensing Provisions: GNU General Public License
Programming Language: Wolfram Mathematica version 13.2 or higher
Introduction
In the recent past, elliptic curves, elliptic functions, elliptic integrals, and modular forms and their L-functions have begun to enter theoretical physics. For instance, in the calculation of certain Feynman integrals, elliptic and modular structures arise; hence, this category of Feynman integrals is often referred to as elliptic Feynman integrals. To calculate these integrals, we must study elliptic and modular structures. A recent collection of articles may be found in [1], and for instance in Chapter 13 of the standard textbook [2]. Furthermore, they arise in other areas of theoretical high-energy physics, such as string theory; see, e.g. [3].
In view of these applications, it is useful to study these structures systematically. In this article we focus on elliptic curves and introduce ECPack.wl, a Mathematica package for studying elliptic curves over the rationals and over finite fields. Note that other topics will be studied in our subsequent articles. Although many physics applications ultimately lead to elliptic curves over , here we confine ourselves to the rationals and finite fields as a first step. The transformations between cubic, Weierstrass, quartic, and Legendre forms are already useful in that broader setting, so this package is indirectly motivated by physics as well as by arithmetic geometry.
The subject of elliptic curves is one of the jewels of nineteenth-century mathematics, originating with Abel, Gauss, Jacobi, and Legendre as noted in the Introduction chapter of ref. [4]. These curves are associated with modular forms, topology, complex analysis, group theory, number theory, and modern cryptography. An elliptic curve over is a smooth algebraic curve of genus one in together with a distinguished point, usually taken as the point at infinity. Elliptic curves can have points with coordinates in any field, such as , , , or .[5] They are defined by an equation given by:
Our purpose is to learn the use of elliptic curve technology from basic principles and to study various manifestations of these that is often found in standard textbooks. Keeping in mind that this topic falls outside a typical university course syllabus, we wished to approach it through problem-solving and from the perspective of using computer algebra, especially the Mathematica platform.
To our knowledge, there is only one package by John McGee[6], which deals with elliptic curves and introduces several relevant topics, such as a linear combination of the two points, the order of the points, the group order, Hasse’s bound, the -invariant of the curve, Bachet’s duplication formula, as well as cryptography with ElGamal encoding and decoding using elliptic curve operators. The author has given a wishlist at the end of his accompanying notebooks, which lists Computation of the Weil Pairing and Implementation of the Schoof–Elkies–Atkin algorithm for , etc, to our knowledge, none of them have been made available to the public. Miller’s algorithm and the Weil and Tate pairings are implemented in ECPack (Section 7). In this work, we begin by writing an independent package that, on the one hand, reproduces the computations demonstrated in the notebook of McGee [6] and, whenever possible, offers comparisons, and, on the other hand, significantly enhances it. Our aim in this work is to comprehensively study elliptic curves over rational and finite fields. Our package offers several extensions, such as
Transformations and Coordinates Cubic to Weierstrass, quartic to Weierstrass, long to short Weierstrass, as well as Legendre to Weierstrass conversions, and coordinate conversions. The commands pertinent to transformations work for all elliptic curves regardless of the field over which they are defined.
Core Arithmetic and Equivalences Checking whether a point is on a curve or not, checking exact projective equivalence of two points, the chord and tangent operation, point addition, point multiplication by a scalar value, and point order.
Minimal Models and Discriminants Computing the torsion subgroup of an elliptic curve, finding rational torsion points using the Nagell-Lutz theorem, finding independent generators for an elliptic curve, calculating a basic upper bound on a curve’s rank, searching for points on a curve within a numerical bound, and Bachet’s duplication.
Heights and Pairings Computing the naive logarithmic height of a point, computing the canonical height using iterative limits, computing the height pairing of two points, computing the height matrix for a given list of points, and checking whether a set of points is independent based on their height matrix determinant or not.
Finite Fields, ElGamal Cryptography and Pairings Adding two points modulo prime , multiplying a point by scalar modulo prime , embedding an integer message onto the curve using Koblitiz encoding, performing ElGamal encryption/encoding, and performing ElGamal decryption/decoding. Evaluating Miller’s function, computing the Weil pairing and the reduced Tate pairing over and , and finding a basis of the full -torsion subgroup.
Elliptic Families and Kodaira Classification
Orders of vanishing of , and along a point of the base, the Kodaira type and Euler number of the singular fibre of a family of elliptic curves over , including the fibre at , the list of all singular fibres with the check that the Euler numbers add up to , the split or non-split character of and fibres, the -function of a family, F-theory gauge algebras, scaling dimensions of Coulomb-branch parameters, Tate forms with prescribed vanishing orders, and the universal families with an -torsion point.
Figure 1.1 gives a schematic overview of the package: the functionality that is already available in the package of McGee [6] (as described above) is shaded, and everything else is new.

Figure 1.1. Overview of ECPack.wl. Any curve is first brought to Weierstrass form, then analyzed over , locally (reduction modulo ), over finite fields, or used in cryptography. Shaded boxes indicate functionality that is also described for the package of McGee [6]; all other boxes are new.
We are guided by the very useful and accessible book by Lozano-Robledo [7] which allows us to give a solid structure to our code.
The first offering we have in this package is that we do not confine ourselves to the short Weierstrass form of the elliptic curve. For physical applications, one needs the quartic and Legendre forms, albeit over . Nevertheless, our code now allows the study of elliptic curves in the following forms: cubic, long and short Weierstrass, quartic, and Legendre. We also code the requisite transformations, which are valid as long as one is not dealing with fields of characteristic 2 and 3.
The availability of good and bad reduction will also assist in evaluating the L-series associated with elliptic curves.
We also offer a realization of Schoof’s point counting algorithm, which determines the trace of Frobenius modulo small primes and counts the points of a curve over a prime field with far beyond the reach of enumeration.
At appropriate points, we refer to the accompanying notebooks, which collect textbook-style test cases from Lozano-Robledo, Husemöller, Washington, Silverman, Silverman–Tate, McGee, and a set of general curves. These notebooks are meant to help readers see how the commands behave on representative inputs and to keep the main text focused on the ideas behind the package.
The rest of the article is organized as follows. Section 2 lists the forms in which an elliptic curve can be given and the maps to Weierstrass form. Section 3 studies the group of rational points, its torsion, rank, and heights, and Section 4 studies the curve over finite fields, including point counting. Section 5 treats reduction modulo and the minimal model, and Section 6 replaces the primes by the points of a parameter space and classifies the singular fibres of one-parameter families by Kodaira’s table. § 8 turns to cryptography and pairings. The appendices recall the characteristic of a field (Appendix § 11) and the Frobenius endomorphism (Appendix § 12), and contain the package’s user manual (Appendix § 13) and notebook guide (Appendix § 21). We demonstrate that using our notebooks can significantly reduce tedium, and solutions can be readily obtained. Furthermore, we provide a list of all commands embedded in the code, which can be retrieved in the notebook using the ? command.
Various Forms of an Elliptic Curve
In applications, an elliptic curve rarely arrives in the long Weierstrass form: curves that appear in the study of elliptic Feynman integrals can be given as a plane cubic or as a quartic, and families of curves are often written in the Legendre form. A first task of any package is therefore to recognize these forms and to bring each of them to a Weierstrass equation, on which all later computations are carried out. In this section we start by defining the elliptic curve and recall the forms accepted by ECPack, namely the general cubic, the long and short Weierstrass forms, the quartic and the Legendre form, and indicate how they are related. The transformations themselves are implemented by the commands listed at the end of the section.
Definition 1. An elliptic curve over is a smooth algebraic curve in of genus one together with one marked point, usually taken as the point at infinity.[2] The arithmetic of elliptic curves concerns itself with the points of a nonsingular cubic with coordinates in a field, such as , , , or .[4, 5]
The General Cubic Form
An elliptic curve over is a smooth cubic projective curve , with at least one rational point . This point is the identity element of the group law defined over elliptic curves. In the projective plane, it is given by a cubic polynomial with rational coefficients , such that is smooth.
Regardless, we often consider just affine charts of , e.g., those points of the form , and study instead the affine curve given by,
This is the general cubic form of an elliptic curve. Note that here, we left out some points of at infinity (i.e., those points ).
The General Weierstrass Equation: The Long Weierstrass Form
With .
The Short Weierstrass Form
A curve over a field of characteristic (see Appendix § 11.1) different from 2 or 3, where , is given by a Weierstrass equation,
This curve is non-singular if and only if
It also has a unique point at infinity , which is called the origin or the point at infinity of $E.
Quartic Form
We will meet elliptic curves defined by equations of the form
with . If we have a point lying on the curve with , then the equation, when it is nonsingular, can be transformed into a Weierstrass equation by an invertible change of variables that uses rational functions with coefficients in the field . Note that an elliptic curve defined over a field always has a point in , namely , whose projective coordinates certainly lie in . Therefore, if we are going to transform a curve into Weierstrass form in such a way that all coefficients of the rational functions describing the transformation lie in , then we need to start with a point on that has coordinates in .[8]
The quartic form can also be expressed as follows
If all roots of the quartic polynomial on the right-hand side are distinct, this defines a smooth elliptic curve.[2]
Legendre Form
An elliptic curve in Legendre form over is defined by equations of the form
where is a field of characteristic different from 2. The points are the three 2-torsion points on for each value of .
Note that here is treated as an affine parameter, , so only are excluded. If we compactify the parameter space by adjoining the point at infinity, then is viewed as a projective parameter on . In that setting, the smooth Legendre family is parametrized by
| Relevant ECPack commands (each name links to its entry in Appendix § 13. ) |
Reading and displaying a curve: ECPExtractCoefficients, ECPFormattedEquation, ECPToWeierstrassForm, ECPParseAffineCurve, ECPParseHomogeneousCurve, ECPPolynomialHomogeneous, ECPPolynomialTransform, ECPSetEC |
Cubic, quartic and Legendre forms to Weierstrass form: ECPCubicToWeierstrass, ECPCubicToWeierstrassCharTwoThree, ECPQuarticToWeierstrass, ECPLegendreToWeierstrass |
Long and short forms; normal forms in characteristic 2 and 3: ECPToShortWeierstrass, ECPShortWeierstrassForm, ECPToShortWeierstrassFp, ECPNormalFormCharTwoThree |
Isomorphisms and point coordinates: ECPTransformWeierstrass, ECPComposeTransformations, ECPToShortCoordinates, ECPFromShortCoordinates, ECPToShortCoordinatesFp, ECPFromShortCoordinatesFp, ECPToLongCoordinates |
Invariants: ECPWInvariants, ECPWeierstrassDiscriminant, ECPShortDiscriminant, ECPJInvariant |
Table 1.
Elliptic Curves over Rational Fields
Once a curve has been brought to Weierstrass form by the transformations of Section 2, the first field over which we study it is . The set of rational points of an elliptic curve is not merely a set but an abelian group, and many commands of ECPack (point addition and multiplication, torsion points, generators, heights) implement aspects of this structure. In this section we first recall the group law on , then describe the structure of the group, namely its torsion subgroup and its rank, and finally introduce the canonical height and the Néron–Tate pairing, which allow one to decide whether a given set of rational points is independent. We work with the short Weierstrass equation , to which every curve over can be reduced.
The Group Law on
Let with , and
where is the point at infinity. carries a group structure whose operation is the addition of points described below.
Chord and tangent. For two distinct points , the line through and meets in a third point ; the sum is the reflection of across the -axis (Figure 3.1a). If , the line is replaced by the tangent to at , which meets the curve at a new point whose reflection is (Figure 3.1b). The vertical line through and meets in no third affine point. To define we therefore adjoin the point “at infinity”, which lies on every vertical line, so that (Figure 3.1c).[5]

Figure 3.1. The group law on an elliptic curve: (a) addition of two distinct points, (b) adding a point to itself, (c) the vertical line through and , which explains the role of the point at infinity.
Formulas. Let and , and let the line through them be , with
Then with
and . A vertical chord gives .
Theorem 1 [5] With this addition, is an abelian group with identity : it is closed under addition, the operation is associative and commutative, and for all .
Bachet’s duplication formula. For the formulas above reduce to Bachet’s duplication formula (1621), found while expressing an integer as the difference of a square and a cube in rational numbers,
If with is a solution, then
is also a rational solution. Hence if and , the integer can be written as a difference of a square and a cube of nonzero rational numbers in infinitely many ways.[9]
Structure of : Torsion and Rank
Theorem 2 (: Mordell–Weil Group) [7] is a finitely generated abelian group. In other words, there are points such that any other point can be expressed as a linear combination
By the Mordell–Weil theorem and the structure theory of finitely generated abelian groups,
The decomposition is not canonical. The torsion subgroup is the finite group of points of finite order. The free part , with , is generated by independent points of infinite order, that is, points with for all nonzero . The integer is the rank of . The rational torsion points of an example curve are shown in Figure 3.2.

Figure 3.2. The rational torsion points of , where generates ; the point at infinity is not shown.
Theorem 3 (Mazur) [7] For an elliptic curve , the is isomorphic to exactly one of the following groups:
In particular, if the order of a rational point is greater than 12, then has infinite order, and contains infinitely many distinct rational points.
Although the rank cannot be read off from the equation, it admits upper bounds when has a rational point of order 2. Let be the number of distinct primes dividing a nonzero integer , so that and .
Theorem 4 (Rank bound) [7] Let with . Then
More generally, if has a nontrivial rational 2-torsion point, then , where and are the numbers of primes at which has multiplicative and additive bad reduction, respectively.
Proposition 1 [7] If with , then .
A rational 2-torsion point exists exactly when the cubic has a rational root, and moving that root to puts in the form of Theorem 4. The command ECPRankBound evaluates all bounds that apply and returns the smallest. These are upper bounds only: for the bound is 0 and the rank is 0, whereas for the bound is 3 and the rank is 2 [7]. For a curve without a rational point of order 2, such as 37a1, the command returns Missing["NoRational2Torsion"]. The command ECPRankUpperBound is only a heuristic and not a theorem (it overestimates the rank of ).
Heights and Linear Independence of Rational Points
The material follows [7]. Rational points are linearly independent if
with and a torsion point, forces . To test this, we use heights. The height of , with , is , and for a point we set . The canonical height of is
where is computed with the group law. For and it satisfies
with if and only if is a torsion point. The Néron–Tate pairing is defined by
It is symmetric and bilinear, , and so exactly for torsion points: this distinguishes torsion points from points of infinite order. (This is the normalisation used by ECPHeightPairing, see Appendix § 13.) For points the elliptic height matrix is
Theorem 5 [7]
(a) If , the points are linearly independent and the rank of is at least .
(b) If and lies in , then the points are linearly dependent and for a torsion point .
Relevant ECPack commands (each name links to its entry in Appendix § 13).
Point arithmetic: ECPAdd, ECPMultiply, ECPChordAndTangent, ECPBachetDuplication, ECPOnCurveQ, ECPPointQ, ECPAreProjectivelyEquivalent
Torsion and point orders: ECPFindTorsionPoints, ECPTorsionSubgroup, ECPPointOrder, ECPFindPointOrder
Searching for points, generators and rank: ECPSearchPoints, ECPFindGenerators, ECPAnalyticRank
Heights, pairings and independence: ECPNaiveHeight, ECPCanonicalHeight, ECPHeightPairing, ECPHeightMatrix, ECPIndependentQ
Prime divisors and rank bounds: ECPPrimeDivisorCount, ECPRankBound, ECPLocalData, ECPRankUpperBound
Elliptic Curves over Finite Fields
Elliptic curves over finite fields are one of the places where the geometry of the curve and the arithmetic of its points meet in a concrete way. Over , one often studies individual rational points and the group law on the curve. Over a finite field , the picture changes: the set of points is finite, and an important question becomes not whether the points exist, but how many there are. This counting problem plays a central role in algorithmic number theory and elliptic curve cryptography.
Curve structure
An elliptic curve over , where for a prime , in short Weierstrass form[8] is as follows
For a nonsingular curve[8]
Equivalently, the discriminant[8]
is nonzero as well.
is the set of all affine points of whose coordinates belong to , together with the point at infinity:
Note that
When a curve is defined over , it means that its defining equation has coefficients , in .
A point is rational over if its coordinates lie in .
A curve defined over can also have points whose coordinates lie in a larger field. Thus, for every (see Appendix § 11.2),
Advanced Point Counting
A simple heuristic suggests that the number of -rational points on should be close to , since for each there are at most two possible values of , and the point at infinity contributes one extra point.
Definition 2 (The Frobenius Endomorphism) [5] (see Appendix § 12) Suppose is defined over the finite field :
is the natural map associated with the finite-field structure, and it encodes the curve’s arithmetic very efficiently. From this point of view, point counting is closely related to understanding how Frobenius acts on the curve. This is the reason the trace appears so naturally in both theory and computation.
The Trace of Frobenius [5] (see Appendix § 12.2): The quantity
is called the trace of Frobenius, because one way to calculate it is to use the Frobenius map to obtain a linear transformation on a certain vector space that is associated with the Tate module. Then is the trace of that linear transformation.
Theorem 6 (Hasse’s theorem) [8] makes this precise:
So, although the exact count depends on the curve, it is always constrained to lie in a fairly small interval around $q+1.
It is often convenient to package the deviation from the expected value into the trace of Frobenius,
Then Hasse’s bound becomes simply .
For small fields, one can count points directly by checking each and determining whether the right-hand side of the curve equation is a quadratic residue. This works well for small examples and for verifying formulas by hand, but it quickly becomes too slow when is large. This is where advanced point-counting algorithms come into play.
Schoof’s Algorithm
Schoof’s algorithm [10] provides a breakthrough technique for computing . Using this technique, we need not directly compute the trace of Frobenius ; instead, we compute the trace of Frobenius modulo many small primes and then recover via the Chinese Remainder Theorem. So, the problem becomes one of studying how Frobenius acts on the -torsion subgroup . Because on the -torsion points, , Frobenius satisfies . Modulo , this becomes a finite computation.
For each small prime , Schoof determines
The congruences for , obtained modulo different primes , are combined using the Chinese Remainder Theorem. Since the moduli are pairwise coprime, the combined modulus is the product of the individual moduli. Once this product of small primes is larger than the width of Hasse’s interval , Hasse’s bound determines a unique value of , since there can be only one integer in the Hasse interval satisfying all the congruences. Finally,
The computation modulo . Let be prime, and an odd prime. The -coordinates of the nonzero points of are the roots of the division polynomial , of degree . All computations are carried out in the ring , in which is a generic point of and the Frobenius acts as . With , one adds and with the chord-and-tangent formulas of Section 3 and looks for with
then . If and have the same -coordinate for some , then and there are two cases: either , or is a square, and , the sign being read off from the -coordinates. For the answer is simpler: is even if and only if has a root in , that is, if and only if . All powers are computed by repeated squaring modulo , and the primes needed to exceed are of size , so the running time is polynomial in .
Implementation in ECPack. ECPSchoofPointCount implements the algorithm above for a curve over a prime field in any of the accepted forms, with arithmetic modulo done by the polynomial routines of the Wolfram Language over . It uses the primes (omitting ) until their product exceeds , combines the residues with the Chinese Remainder Theorem, and checks the result against Hasse’s bound. The enumeration used by ECPSEAPointCount is limited to , whereas Schoof’s algorithm handles much larger primes, here :
In[83]:= ECPSchoofPointCount[{2, 3}, 1000000000039]
Out[83]= 1000000769568
Here , and the result can be checked independently by verifying that for random points with ECPMultiplyFp.
| Relevant ECPack commands (each name links to its entry in Appendix § 13). | |
| Point counting, group structure and point orders: ECPSchoofPointCount, ECPSEAPointCount, ECPGroupFp, ECPPointOrderFp | |
| Point arithmetic and membership: ECPAddFp, ECPMultiplyFp, ECPPointQFp | |
| Arithmetic in : ECPFiniteFieldInfo, ECPFqAdd, ECPFqMultiply, ECPFqInverse, ECPFqElement, ECPFqVector | |
| Models and invariants over : ECPToShortWeierstrassFp, ECPJInvariant |
Table 4 (PDF p. 10).
Curve Reductions
When an elliptic curve is defined over , it is natural to ask what the curve looks like after reducing its coefficients modulo a prime . This idea is simple but one of the most useful bridges between global and local arithmetic. What actually happens is that, suppose we have an elliptic curve defined over ; reducing it modulo a prime produces an elliptic curve over . A curve may behave very nicely over , yet its reduction modulo a given prime , which is an elliptic curve over , can reveal subtle singular behavior. In this way, reduction modulo gives a local snapshot of the curve, and studying these snapshots prime by prime is a standard part of the arithmetic theory of elliptic curves.
Minimal Model
Before reducing the curve, one usually tries to choose the simplest possible model. Since the same elliptic curve can be written by many equivalent Weierstrass equations, it is important to work with a model that does not carry unnecessary powers of primes in its discriminant. This leads to the notion of a minimal Weierstrass model.
Definition 3 (Minimal Weierstrass Model) [7] Let be an elliptic curve. A Weierstrass equation for is called minimal if, among all integral Weierstrass equations for the same curve, its discriminant has minimal -adic valuation at every prime .
Once a minimal model is chosen, one reduces the coefficients modulo and obtains a curve over . If the reduced equation is still non-singular, then the curve has good reduction at . If the reduced equation becomes singular, then the curve has bad reduction. The discriminant is the key quantity here: if the discriminant does not vanish modulo , then the reduced curve remains smooth; if it does vanish, the curve acquires a singular point.
Definition 4 (Reduction Modulo ) [8] Let
be an elliptic curve with . The reduction of modulo is the curve over obtained by reducing the coefficients and modulo $p.
For a short Weierstrass equation, the discriminant is
Thus, the first test for reduction is very direct:
In practice, for a model that is minimal at , the singularity can be refined further by looking at the invariant .
This distinction is important because it tells us not only that the curve has degenerated, but also how it has degenerated.
Theorem 7 (Good Reduction Criterion) [11] If an elliptic curve has a minimal Weierstrass model at a prime , then the reduced curve over is smooth if and only if the discriminant is nonzero modulo . In that case, the curve has good reduction at .
A very useful consequence of good reduction is that torsion points of order prime to behave well under reduction. More precisely, if has good reduction at and is not divisible by , then the reduction map gives an injective homomorphism [8]
So, at good primes, finite-order rational points do not collapse unexpectedly when reduced modulo . This is one reason why reduction is so useful in explicit computations.
If the reduced curve is singular, one often refines the discussion using Kodaira symbols. In the simplest language, corresponds to good reduction, to multiplicative reduction, and the symbols , , , , , , describe the various additive cases. This classification is more detailed than what is needed for a first pass, but it shows that reduction modulo is not merely a yes-or-no question; it carries structured information about the geometry of the curve.
The reduction process can be carried out explicitly on individual curves: one first finds a minimal model, computes the discriminant, and reduces modulo a chosen prime to inspect whether the reduction is good, multiplicative, or additive.
From a computational standpoint, ECPack is well-suited to this topic. It can help you find a minimal model, compute the discriminant, reduce the curve modulo a chosen prime, and inspect whether the reduction is good, multiplicative, or additive. That makes it easier to move between the abstract definition and an actual curve written in code. It is also helpful when one wants to compare several primes at once, because the package can quickly show which primes are bad and which ones preserve smooth reduction. In that sense, the package turns reduction theory into something one can test and experiment with directly.
| Relevant ECPack commands (each name links to its entry in Appendix § 13). |
Table 5.
Minimal models: ECPIsMinimal, ECPIsMinimalShort, ECPMinimalQ, ECPMinimalModel, ECPMinimalModelShort, ECPFindLocalReduction, ECPToMinimalPoint, ECPFromMinimalPoint, ECPTransformWeierstrass
Discriminant and invariants: ECPWeierstrassDiscriminant, ECPWInvariants, ECPShortDiscriminant, ECPJInvariant
Local data: Tate’s algorithm and conductor: ECPTate, ECPLocalData, ECPConductor
The reduced curve over : ECPToShortWeierstrassFp, ECPGroupFp, ECPSchoofPointCount, ECPSEAPointCount
Elliptic Families and Kodaira Classification
This section, based on [12, 13, 14, 15], provides only the introductory overview needed for the package commands. If the coefficients of a Weierstrass equation depend on a parameter , then one gets a one-parameter family of elliptic curves. The zeros of the discriminant mark the singular fibres of the family, and Kodaira’s symbols provide a compact way to describe their local types. In the package, this information is used by commands that list singular fibres, report Euler numbers, and translate a fibre type into the associated gauge-algebra data when that dictionary is relevant.
| Type | ord | ord | ord | Euler number |
| () | ||||
| () | ||||
Table 1 (PDF p. 12). Kodaira’s table: the type of a singular fibre from the orders of vanishing of , and at a point where the Weierstrass equation is minimal.
A minimal model at a point is detected by the vanishing orders of the invariants , , and . For a first reading, it is enough to remember that the fibre is smooth when , and that the symbols , , , , , , , and are the standard names used by the commands in this package. The same local data can also be viewed at by passing to , which is why the package can treat families over uniformly.
The related command ECPFibreList returns the singular fibres and their Euler numbers, while ECPFibreAt inspects a fibre at a chosen parameter value and ECPGaugeAlgebra records the corresponding gauge-algebra dictionary when needed.
Relevant ECPack commands (each name links to its entry in Appendix § 13).
Kodaira classification: ECPKodairaType, ECPFibreAt, ECPFibreAtInfinity, ECPFibreList
Miscellaneous: ECPJFunction, ECPCoulombDimension, ECPGaugeAlgebra, ECPTateForm, ECPTorsionFamily
Cryptography and Algebraic Pairings
The two preceding sections studied the finite groups and the curves obtained from a curve over by reduction modulo . These finite groups are also the setting of elliptic-curve cryptography, which uses the group law over directly, and of pairings, which relate the additive group to the multiplicative group . In this section we first recall the discrete logarithm problem on an elliptic curve and the ElGamal protocol, which ECPack implements over prime fields. We then describe Miller’s algorithm and the Weil and Tate pairings, which are implemented over and , together with a routine that produces a basis of the full -torsion subgroup.
Elliptic Curve Cryptography and ElGamal Encryption
Elliptic curves became especially important in modern cryptography because they offer a very efficient group law, while the inverse problem remains difficult in practice. Over a finite field, point addition and scalar multiplication can be performed quickly, but recovering the scalar from a given multiple of a point is believed to be computationally hard. This asymmetry is the starting point for elliptic curve cryptography (ECC) [16, 17, 8, 18].
A central problem here is the Elliptic Curve Discrete Logarithm Problem (ECDLP). Suppose is a point on an elliptic curve and for some unknown integer . The ECDLP asks for the recovery of from and . For suitably chosen curves, no efficient general method is known for solving this problem [8], which is why elliptic curves are useful for secure communication. In contrast, the forward operation is easy to compute, especially with double-and-add methods and related fast scalar-multiplication algorithms.
A standard application is the elliptic-curve version of the ElGamal protocol [19, 16]. In this setting, a public point is chosen on the curve, together with a public point , where is the secret key. To encrypt a message, one first encodes the message as a point on the curve and then chooses a random integer . The ciphertext is the pair
Since , the legitimate receiver can recover the message by computing
The security of this procedure depends on the difficulty of recovering from and . The group law makes encryption and decryption efficient, while the underlying discrete logarithm problem makes unauthorized recovery difficult. ECPack implements Koblitz’s embedding of an integer message as a point on the curve [16] together with ElGamal encryption and decryption over prime fields. The parameters used in the manual are two values: the routines are meant for experimentation with the arithmetic, not for secure communication.
Pairings and Miller’s Algorithm
In more advanced cryptographic constructions, one needs a bilinear pairing. A pairing takes two points of an elliptic curve and returns an element of the multiplicative group of the field, so that the additive group law of the curve is converted into a multiplicative one in a controlled way. Throughout this subsection is defined over , , and is a positive integer prime to . Over an algebraic closure, , and we write for the group of -th roots of unity.
The Weil Pairing. The most classical pairing is the Weil pairing.
Definition 5 (Weil Pairing) [8] The Weil pairing is a map
with the following properties:
(a) bilinearity: for integers and ;
(b) alternating: , and hence ;
(c) non-degeneracy: if for all , then .
If is a basis of , then is a primitive -th root of unity. In particular, if the full -torsion subgroup is contained in , then , that is, divides .
Miller’s Function and Miller’s Algorithm [20]. The Weil pairing is computed with Miller’s algorithm, whose basic object is a rational function on . For a point and an integer , let be a rational function with divisor
normalised as in Miller’s algorithm; for this divisor is . Let denote the line through and (the tangent if ) and the vertical line through . Comparing divisors, one finds
which is the geometric chord-and-tangent construction of Section 3 in the language of divisors. Miller’s algorithm evaluates at a point by applying (41) along the binary expansion of (double-and-add). At each step, only the values of the line and of the vertical line at are computed, so the function itself is never written down, and the cost is operations in [20]. The evaluation fails if is a zero or a pole of one of the intermediate functions, for instance when lies in the subgroup generated by .
For the Weil pairing is given by
Both values in (42) are defined and nonzero exactly when and are independent; if one of them lies in the cyclic group generated by the other, the pairing equals 1.
The Tate Pairing [21, 22, 8]. The second pairing in common use is the Tate pairing. It is defined on and takes values in . If divides , one makes the value unique by raising it to the power , which gives the reduced Tate pairing
It is bilinear and non-degenerate but, unlike the Weil pairing, it is not alternating, so need not equal 1. Its evaluation requires only one Miller function rather than two. The condition is the reason why one often has to pass to an extension field: the smallest with is called the embedding degree of [23, 22].
Implementation in ECPack. ECPack evaluates the Miller function with ECPMillerFp, and computes the Weil pairing (42) and the reduced Tate pairing with ECPWeilPairingFp and ECPTatePairingFp. All three work over and over , in every characteristic for which the pairing is defined, and for a curve in any of the accepted forms. The routine ECPTorsionBasisFp finds a basis of inside , with of exact order and a primitive -th root of unity; this requires . For the curve over , one has 9 points and , so and :
In[80]:= ECPTorsionBasisFp[3, {0, 2}, 7]
Out[80]= {{0, 4}, {5, 1}}
In[81]:= ECPWeilPairingFp[3, {0, 4}, {5, 1}, {0, 2}, 7]
Out[81]= 2
In[82]:= {ECPWeilPairingFp[3, {0, 4}, {0, 4}, {0, 2}, 7], ECPWeilPairingFp[3, {5, 1}, {0, 4}, {0, 2}, 7]}
Out[82]= {1, 4}
Since and , the value is a primitive cube root of unity, as it must be for a basis. The pairing is alternating, , and modulo 7.
Relevant ECPack commands (each name links to its entry in Appendix § 13).
Group law over : ECPAddFp, ECPMultiplyFp, ECPPointOrderFp, ECPGroupFp
Message embedding and ElGamal: ECPFFindPointFp, ECPElGamalEncodeFp, ECPElGamalDecodeFp
Miller’s algorithm and pairings: ECPMillerFp, ECPWeilPairingFp, ECPTatePairingFp, ECPTorsionBasisFp
Future Directions
We plan to extend ECPack.wl in the following directions.
Torsion via Doud’s Algorithm.
ECPFindTorsionPointsuses the Nagell–Lutz theorem, which requires factoring the discriminant and falls back to a bounded search for large . Doud’s algorithm [24] instead bounds the torsion order by point counts modulo primes of good reduction and tests the -division points of the analytic parametrization by for rationality; we intend to implement it, with exact verification of the candidates.
Sharper Rank Bounds. The bounds of § 4.2 need a rational point of order 2. Computing the 2-Selmer group gives for every curve over , with equality exactly when [25, 26].
Elliptic Curves over . We plan commands for the lattice , the periods, , , the modular parameter and the uniformization , which is the case relevant to elliptic Feynman integrals and is also needed in item 1.
Further Extensions. A genuine Schoof–Elkies–Atkin point count (
ECPSEAPointCountis currently an enumeration), canonical heights through local heights [27], the Tamagawa numbers and real period for a numerical check of the BSD formula, isogenies (Vélu), the Shioda–Tate formula for families, and further cryptographic protocols such as ECDH and ECDSA.
Acknowledgements
During the preparation of this work, we have used the AI assistants Claude (Anthropic) and ChatGPT (OpenAI) to help refine and test the Wolfram Language code of the package and to check test cases. All mathematical content, the package design, and the final code, examples, and text were reviewed by the authors.
Characteristic and Finite Fields
The main text refers to the characteristic of a field and to the fields without defining them, although these notions decide which of the transformations and algorithms of ECPack apply to a given curve. This appendix collects the definitions and explains how is represented inside the package.
Characteristic
The characteristic of a field is the smallest with , or 0 if no such exists. It is always 0 or a prime: if with , then would give zero divisors. Thus and . The short Weierstrass form requires (completing the square and the cube divides by 2 and 3); in characteristic 2 and 3 one must use the normal forms of ECPNormalFormCharTwoThree and ECPToShortWeierstrassFp.
Prime Fields and Prime Field Extensions
For a prime , is a field, while is not for composite (e.g. ). Over all coefficients, coordinates and group-law computations are carried out modulo .
For with , is not . It is constructed as for any irreducible of degree , and it is unique up to isomorphism; for all , and is cyclic. For example, has no root in , so
ECPack represents as and writes nonzero elements as powers of a primitive element , so that multiplication is addition of exponents modulo (see ECPFiniteFieldInfo). Since and both are finite, every curve over has a finite group of points over each .
Relevant ECPack commands. ECPNormalFormCharTwoThree, ECPubicToWeierstrassCharTwoThree, ECPToShortWeierstrassFp, ECPJInvariant, ECPFiniteFieldInfo, ECPFqAdd, ECPFqMultiply, ECPFqInverse, ECPFqElement, ECPFqVector, ECPGroupFp, ECPAddFp, ECPPointQFp.
The Frobenius Endomorphism
Let be given by with , , and let be an algebraic closure. An endomorphism of is a morphism fixing (hence a group homomorphism). For example, the multiplication maps are endomorphisms, with .
Frobenius on the Field and on the Curve
In characteristic the map is a ring homomorphism, since (the binomial coefficients , , vanish mod ). Its iterate fixes exactly :
The -power Frobenius of the curve is
It maps to itself: raising to the -th power and using , gives . The group law is given by rational functions with coefficients in , which commute with , so and is an endomorphism. By the characterization above,
The Frobenius endomorphism on finite-field points can be used to describe fixed points over extension fields and to relate point counts over to the kernel of .
Trace of Frobenius and Point Counts
Theorem 8 Let .
(a) in .
(b) Writing , one has and for all . In particular (Hasse).
Sketch. has degree and is separable, so by (B.3), , with the dual isogeny. Hence and , which gives (a); (b) follows from and the Weil bound on . See Silverman [11] (Ch. V) or Washington [8] (Ch. 4).
Action on Torsion and the Tate Module
For prime, , and acts on each compatibly. The Tate module
organises these actions into a single matrix over whose characteristic polynomial is , i.e. , . Restricting to gives , which is the quantity computed by Schoof’s algorithm in § 5.3; is then recovered by the Chinese Remainder Theorem together with Hasse’s bound.
Relevant ECPack commands. ECPGroupFp, ECPAddFp, ECPMultiplyFp, ECPPointOrderFp, ECPSchoofPointCount, ECPSEAPointCount.
User Manual
All public commands of the package ECPack begin with the prefix ECP (variables with $ECP$), so that all of them can be listed with Names["ECPackECP*"]. The package is loaded with Get["ECPack.wl"]. Each entry below provides the call forms, arguments, returned value, remarks, and one example in the style of a Mathematica notebook. Unless stated otherwise, curve may be a long model $\{a_1,a_2,a_3,a_4,a_6\}$, a short pair $\{A,B\}$, an equation, a polynomial in $x,y$, a curve Association such as $ECPCurrentEC`, or Automatic (the session curve). The examples use the curves 37a1: (rank 1, conductor 37), (CM, torsion ) and .
Index of Commands
Commands marked {sup}†` can take a long time to compute for some inputs; the reason is given in their entries below.
ECPAdd Add two rational points on a curve.
ECPAddFp Add two points over or (short form: odd ; long form: any ).
ECPAnalyticRank{sup}†` Analytic rank, root number and conductor, assuming BSD.
ECPAreProjectivelyEquivalent Test whether two projective points are proportional.
ECPBachetDuplication Bachet’s duplication formula: as a rational function of .
ECPCanonicalHeight{sup}†` Canonical (Néron–Tate) height of a point.
ECPChordAndTangent Third intersection point of the tangent line at with the cubic.
ECPComposeTransformations Compose two Weierstrass isomorphisms .
ECPConductor{sup}†` Conductor of an integral Weierstrass model.
ECPCoulombDimension Scaling dimension of a Kodaira singularity.
ECPCubicToWeierstrass Reduce a plane cubic with a known rational point to Weierstrass form (characteristic 0 or ).
ECPCubicToWeierstrassCharTwoThree Same, given an inflection point, in characteristic 2 or 3 (also over ).
ECPElGamalDecodeFp Decrypt an ElGamal ciphertext over (prime fields only).
ECPElGamalEncodeFp Encrypt a message by elliptic-curve ElGamal over (prime fields only).
ECPExtractCoefficients Read off a curve in any form.
ECPFibreAt Kodaira fibre of a family over at a point .
ECPFibreAtInfinity Kodaira fibre at of a family over .
ECPFibreList All singular fibres of a family over , with the Euler-number check.
ECPFindGenerators{sup}†` Heuristic search for independent generators of the Mordell–Weil group.
ECPFindLocalReduction Local Laska–Kraus reduction step at a prime .
ECPFindPointFp Koblitz-embed a message as a curve point over (prime fields only).
ECPFindPointOrder Order of a point by bounded search (Mazur’s bound by default).
ECPFindPointOrderFp{sup}†Same asECPPointOrderFp`: exact order of a point over or .
ECPFindTorsionPoints{sup}†` All rational torsion points (Nagell–Lutz).
ECPFiniteFieldInfo Describe the field polynomial and generator used for .
ECPFormattedEquation Display the long Weierstrass equation.
ECPFqAdd Add two elements of .
ECPFqElement Build a field element from its coordinate vector.
ECPFqInverse Multiplicative inverse in .
ECPFqMultiply Multiply two elements of .
ECPFqVector Coordinate vector of a field element.
ECPFromMinimalPoint Inverse of ECPToMinimalPoint.
ECPFromShortCoordinates Map a point on the short model back to the long model.
ECPFromShortCoordinatesFp Finite-field analogue of ECPFromShortCoordinates.
ECPGaugeAlgebra -theory gauge algebra of a Kodaira type (split or non-split).
ECPGroupFp{sup}†` The group of points over or .
ECPHeightMatrix{sup}†` Pairwise height-pairing matrix (its determinant is the regulator).
ECPHeightPairing{sup}†` Néron–Tate height pairing of two points.
ECPIndependentQ{sup}†` Test independence of points via the height-matrix determinant.
ECPIsMinimal Test true Weierstrass minimality of a long model.
ECPIsMinimalShort Test minimality of a short model (or dispatch to ECPIsMinimal).
ECPJFunction -invariant of a family as a rational function.
ECPJInvariant -invariant over , or .
ECPKodairaType Kodaira type and Euler number from the orders of .
ECPLegendreToWeierstrass Convert Legendre form to short Weierstrass form.
ECPLocalData{sup}†` Tate’s-algorithm data at every bad prime.
ECPMillerFp Miller’s function evaluated at a point over or .
ECPMinimalModel{sup}†` Global minimal (long) Weierstrass model.
ECPMinimalModelShort Minimal model for a short Weierstrass pair.
ECPMinimalQ Test minimality at one prime or globally.
ECPMultiply Scalar multiplication of a rational point.
ECPMultiplyFp Scalar multiplication over or .
ECPNaiveHeight Naive logarithmic height of a point.
ECPNormalFormCharTwoThree Normal form of a long model in characteristic 2 or 3 (also over ).
ECPOnCurveQ Test whether a point lies on a given curve.
ECPParseAffineCurve Normalise a curve to . ECPParseHomogeneousCurve Homogenise a cubic with respect to . ECPPointOrder Order of a rational point. ECPPointOrderFp{sup}†Order of a point over $\mathbb{F}_p$ or $\mathbb{F}_{p^r}$ via Lagrange’s theorem.ECPPointQMembership test for a point on a curve (coordinates as two arguments).ECPPointQFpMembership test over $\mathbb{F}_p$ or $\mathbb{F}_{p^r}$.ECPPolynomialHomogeneousExact homogeneity test.ECPPolynomialTransformLinear change of variables in a polynomial.ECPPrimeDivisorCountNumber $\nu(n)$ of distinct primes dividing $n$, or dividing $\Delta$ of a curve.ECPQuarticToWeierstrassConvert $y^2 = \text{quartic}$ to short Weierstrass form.ECPRankBound{sup}† Proven upper bound for the rank of a curve with a rational point of order 2. ECPRankUpperBound{sup}†Heuristic (non-rigorous) rank estimate from the discriminant.ECPSchoofPointCount{sup}† Number of points over by Schoof’s algorithm (large ). ECPSEAPointCount{sup}†Exact point count by enumeration over $\mathbb{F}_p$ ($p \lesssim 10^6$) or $\mathbb{F}_{p^r}$.ECPSearchPointsBounded rational-point search.ECPSetECSet the global session curve.ECPShortDiscriminantDiscriminant $-16(4A^3 + 27B^2)$ of a short model.ECPShortWeierstrassFormGives short form curve with integer coefficients.ECPTateTate’s algorithm at one prime.ECPTateFormCoefficients with prescribed vanishing orders at $t = 0$ (F-theory Tate form).ECPTatePairingFp{sup}† Reduced Tate pairing over or . ECPToLongCoordinates Map coordinates of a transformed model back to the long model. ECPToMinimalPoint Map a point under a Weierstrass isomorphism . ECPTorsionBasisFp{sup}†Basis of the full $n$-torsion subgroup $E[n] \subset E(\mathbb{F}_q)$.ECPTorsionFamilyUniversal curve with a rational $N$-torsion point (Tate–Kubert form), $N = 4,\ldots,7$.ECPTorsionSubgroup{sup}† Torsion subgroup (order, structure, generators, points). ECPToShortCoordinates Map a point on the long model to the short model. ECPToShortCoordinatesFp Finite-field analogue of ECPToShortCoordinates (prime field). ECPToShortWeierstrass Reduce a long model to short Weierstrass form (characteristic 0 or ). ECPToShortWeierstrassFp Reduce a long model to its simplest form over or (any ). ECPToWeierstrassForm Read off a cubic already in Weierstrass shape. ECPTransformWeierstrass Apply the isomorphism to the coefficients. ECPWeierstrassDiscriminant Full discriminant of a long model. ECPWeilPairingFp Weil pairing over or . ECPWInvariants The invariants and .
ECPShortWierstrass is kept as a legacy alias of ECPShortWeierstrassForm. The package also defines the variables $ECPVersion (the version string, "1.0"), $ECPCurrentEC (the session curve set by ECPSetEC), $ECPNagellLutzDiscLimit (the largest for exact Nagell-Lutz in ECPFindTorsionPoints) and $ECPFqTableLimit (the largest for which the arithmetic tables of are built).
Function Descriptions
ECPAdd
Usage: ECPAdd[P1, P2, curve]
Arguments. P1, P2: points or Infinity in the coordinates of curve; curve: any curve form.
Returns. The point in the same coordinates as curve, as or Infinity.
Notes & restrictions. Both points and the curve are validated once at the entry point; the core uses the doubling formula if and the chord formula otherwise (a vertical chord gives Infinity).
| Example. | (0,0) + (1,0) on 37a1 |
In[4]:= | ECPAdd[\{0, 0\}, \{1, 0\}, \{0, 0, 1, -1, 0\}] |
Out[4]= | \{-1, -1\} |
Table 1 (PDF p. 18).
ECPAddFp
Usage: ECPAddFp[P1, P2, a, p] ECPAddFp[P1, P2, curve, p] ECPAddFp[P1, P2, curve, \{p, r\}] Arguments. P1, P2: points or Infinity (integer coordinates need not be reduced mod ). a: the -coefficient of (short overload, odd only; is not needed, so membership is not tested). curve: any curve form (long overload; it checks that both points lie on the curve; every prime allowed). : extension field, .
Returns. The sum over with coordinates in , or Infinity. Over coordinates are written 0 or .
Notes & restrictions. Points that do not lie on one common curve mod raise a message and return $Failed. Over an extension field give the full curve and field elements in the notation of ECPFiniteFieldInfo.
Example.
In[5]:= ECPAddFp[{5, 1}, {6, 3}, 2, 17]
Out[5]= {10, 6}
ECPAnalyticRank
Usage: ECPAnalyticRank[model] ECPAnalyticRank[model, prec]
Arguments. model: an integral long model (short pairs, equations and Automatic are also accepted). prec (default 40): working precision.
Returns. An Association with keys "Rank" (order of vanishing of at ), "Parity" (the root number ) and "Conductor".
Notes & restrictions. The rank is the true Mordell–Weil rank only assuming the Birch–Swinnerton-Dyer conjecture (proved for analytic rank ). By the parity conjecture the root number alone decides whether the rank is even or odd. Precision below the internal minimum raises a message. The slowest command: its computation may take time (minutes for conductor ), since it needs of order coefficients and many high-precision incomplete gamma functions. A lower prec speeds it up.
Example. analytic rank, root number and conductor of 37a1
In[6]:= ECPAnalyticRank[{0, 0, 1, -1, 0}]
Out[6]= <|"Rank" -> 1, "Parity" -> -1, "Conductor" -> 37|>
ECPAreProjectivelyEquivalent
Usage: ECPAreProjectivelyEquivalent[P, Q]
Arguments. P, Q: length-3 lists of numbers or symbols, the projective coordinates .
Returns. True if for some , False otherwise.
Notes & restrictions. The zero vector is equivalent to nothing, not even itself. The test does not check that the points lie on any curve.
Example. proportional projective points
In[7]:= ECPAreProjectivelyEquivalent[{1, 2, 3}, {2, 4, 6}]
Out[7]= True
ECPBachetDuplication
Usage: ECPBachetDuplication[x, curve] ECPBachetDuplication[{x, y}, curve] ECPBachetDuplication[Infinity, curve]
Arguments. x: a number or a symbol. : a point of the curve (checked). curve: any curve form.
Returns. For a bare : (for : ; for : ). For a point: the whole point .
Notes & restrictions. The result is Infinity when (for a numeric at a 2-torsion point). The whole-point form agrees with ECPMultiply[2, P, curve].
Example. the whole point
In[8]:= ECPBachetDuplication[{-3, 9}, {-36, 0}]
Out[8]= {25/4, -35/8}
ECPCanonicalHeight
Usage: ECPCanonicalHeight[P, curve] ECPCanonicalHeight[P, curve, maxIter]
Arguments. P: a rational point on curve, or Infinity. curve: any curve form. maxIter (default 8): number of doublings in the limit , where is the naive height of ECPNaiveHeight.
Returns. A machine-precision real number. Torsion points and Infinity give exactly 0.
Notes & restrictions. The value is an approximation (only maxIter doublings), so different maxIter may disagree in the last digits; this is why ECPIndependentQ uses a loose default tolerance. Normalisation: the package follows the convention of Silverman’s Arithmetic of Elliptic Curves, in which is half of the value tabulated in Silverman–Tate, Cremona and the LMFDB. Its computation may take time for points of large height, since each doubling roughly quadruples the number of digits in the coordinates.
Example. the generator of 37a1 (half of Cremona’s value 0.0511)
In[9]:= ECPCanonicalHeight[{0, 0}, {0, 0, 1, -1, 0}]
Out[9]= 0.0255553
ECPChordAndTangent
Usage: ECPChordAndTangent[P, curve] ECPChordAndTangent[P, curve, vars]
Arguments. P: projective point on the cubic. curve: any curve form (homogenised internally). vars: the three variable names (default: inferred).
Returns. A projective point: the third point where the tangent at meets the cubic, before any reflection. It is the chord-and-tangent doubling, not in the group law.
Notes & restrictions. If is a flex the function returns itself; at a 2-torsion point the tangent is vertical and the result is the point at infinity. The computation is an exact projective parametrisation and does not depend on the chart.
Example. third intersection of the tangent at
In[10]:= ECPChordAndTangent[{0, 0, 1}, y^2 z + y z^2 - x^3 + x z^2, {x, y, z}]
Out[10]= {1, -1, 1}
ECPComposeTransformations
Usage: ECPComposeTransformations[{u1,r1,s1,t1}, {u2,r2,s2,t2}]
Arguments. Two isomorphisms, each a length-4 list with , for , .
Returns. One list equal to applying the first and then the second transformation.
Notes & restrictions. Composition is not commutative; the order of the arguments is the order of application. raises a message and returns $Failed.
Example. compose two isomorphisms
In[11]:= ECPComposeTransformations[{2, 1, 3, 4}, {5, 6, 7, 8}]
Out[11]= {10, 25, 17, 140}
ECPConductor
Usage: ECPConductor[model]
Arguments. model: an integral long model .
Returns. The integer over the conductor exponents found by Tate’s algorithm.
Notes & restrictions. Built on ECPLocalData. A non-integral model raises a message and returns $Failed. Its computation may take time, since it factorises , which is slow when has large prime factors.
Example. conductor of 37a1
In[12]:= ECPConductor[{0, 0, 1, -1, 0}]
Out[12]= 37
ECPCoulombDimension
Usage: ECPCoulombDimension[ordDelta]
Arguments. ordDelta: an integer with .
Returns. The scaling dimension of the Coulomb-branch parameter at a Kodaira singularity with that order of vanishing of (Argyres–Douglas and Minahan–Nemeschansky: , , , , , , ).
Notes & restrictions. Meaningful only for the types that are not or , that is, for .
Example. the seven values
In[93]:= ECPCoulombDimension[#] & /@ {2, 3, 4, 6, 8, 9, 10}
Out[93]= {6/5, 4/3, 3/2, 2, 3, 4, 6}
ECPCubicToWeierstrass
Usage: ECPCubicToWeierstrass[P, curve] ECPCubicToWeierstrass[P, curve, opts]
Arguments. P: a rational point of the cubic. curve: a homogeneous cubic in three variables, or an affine cubic (homogenised with respect to ). opts: "Form" ("Long", default, or "Short") and the algorithm/equivalence options.
Returns. The long Weierstrass polynomial ; with "Form" -> "Short" the equation . The option "Equivalence" -> True also prints the transformation used.
Notes & restrictions. need not be a flex. For characteristic 2 or 3 use ECPCubicToWeierstrassCharTwoThree. A point that is not on the cubic, or an invalid option, raises a message and returns $Failed.
Example. cubic with the rational point (0:0:1)
In[13]:= ECPCubicToWeierstrass[{0, 0, 1}, y^2 z + y z^2 - x^3 + x z^2]
Out[13]= 7 x^2 - x^3 + y + 4 x y + y^2
ECPCubicToWeierstrassCharTwoThree
Usage: ECPCubicToWeierstrassCharTwoThree[F, P, p] ECPCubicToWeierstrassCharTwoThree[F, P, {p, r}]
Arguments. F: a homogeneous cubic in . P: a flex of (the point of a Weierstrass cubic always works). p: 2 or 3; {p,r}: work over .
Returns. An Association with "WeierstrassCoefficients", "Transformation" and auxiliary data (over also "Scaling").
Notes & restrictions. A purely linear change of coordinates anchored at the supplied flex; the usual completion of the square or cube would divide by 2 or 3.
Example. cubic over F_3 with the flex (0:1:0)
In[14]:= ECPCubicToWeierstrassCharTwoThree[y^2 z - x^3 - x z^2 - z^3, {0, 1, 0}, 3]
Out[14]= <|"WeierstrassCoefficients" -> {0, 0, 0, 1, 1}, "Transformation" -> {{1,
0, 0}, {0, 1, 0}, {0, 0, 1}}, "AuxiliaryPoints" -> <|"Q" -> {1, 0, 0}, "P" -> {0,
1, 0}, "R" -> {0, 0, 1}|>, "Characteristic" -> 3|>
ECPElGamalDecodeFp
Usage. ECPElGamalDecodeFp[s, {C1,C2}, a, p] ECPElGamalDecodeFp[s, {C1,C2}, curve, p, kappa]
Arguments. s: the private key. {C1,C2}: the ciphertext from ECPElGamalEncodeFp. a or curve: the curve. p: odd prime. kappa (default 100): the Koblitz parameter used at encoding time.
Returns. The plaintext integer .
Notes & restrictions. Computes and inverts the embedding . A wrong kappa silently recovers a wrong integer. A field with raises a message.
Example. decrypt with the secret key (round trip returns 42)
In[15]:= ECPElGamalDecodeFp[57, ECPElGamalEncodeFp[42, {{0, 8530}, {1753, 557}}, 2, 3, 10007, 4923], 2, 10007]
Out[15]= 42
ECPElGamalEncodeFp
Usage. ECPElGamalEncodeFp[m, {P,B}, a, b, p, n] ECPElGamalEncodeFp[m, {P,B}, curve, p, n, kappa]
Arguments. m: non-negative integer. {P,B}: base point and public key . a,b or curve: the curve. p: odd prime. n: bound for the ephemeral (normally the order of ). kappa (default 100): Koblitz parameter.
Returns. The ciphertext with , , where is the Koblitz point embedding .
Notes & restrictions. Requires . The ephemeral key is drawn at random from , so the ciphertext changes from one call to the next. Toy primes only in this manual.
Example. encrypt on over with of order 4923 and ; the ciphertext depends on the random , so we check it by decrypting
In[16]:= c = ECPElGamalEncodeFp[42, {{0, 8530}, {1753, 557}}, 2, 3, 10007, 4923];
ECPElGamalDecodeFp[57, c, 2, 10007]
Out[16]= 42
ECPExtractCoefficients
Usage. ECPExtractCoefficients[curve]
Arguments. curve: a polynomial, an equation, a coefficient list or an Association; variables , or , .
Returns. The five long coefficients.
Notes & restrictions. A singular curve raises a message and returns $Failed; this is the check every other command relies on.
Example. read the coefficients off an equation
In[17]:= ECPExtractCoefficients[y^2 + y == x^3 - x]
Out[17]= {0, 0, 1, -1, 0}
ECPFibreAt
Usage. ECPFibreAt[curve, t, t0]
Arguments. curve: a family over in any accepted form (long with coefficients that are polynomials in , short , an equation in , an Association). t: the parameter (a symbol). t0: a number, or Infinity (then ECPFibreAtInfinity is used).
Returns. An Association with the keys "Location", "Degree", "Type" (Kodaira symbol), "Euler", "Orders" (), "Split", "SplitCriterion", "GaugeAlgebra" and "ScalingDimension".
Notes & restrictions. The model must be minimal at ; otherwise the type is reported as "non-minimal". "Split" is decided over for the types () and by testing whether "SplitCriterion" ( at the point for , the leading coefficient of for ) is a rational square; for symbolic models it is Missing["Symbolic"] and "SplitCriterion" is the expression that must be a square. For other types it is Missing["NotApplicable"]. The invariants , , must be polynomials in ; a singular family raises a message.
Example. the Tate form has a fibre of type at
In[89]:= Lookup[ECPFibreAt[ECPTateForm[{1, 2, 3, 4, 5}, t], t, 0], {"Type",
"Euler", "GaugeAlgebra", "ScalingDimension"}]
Out[89]= {"II*", 10, "e8", 6}
ECPFibreAtInfinity
Usage: ECPFibreAtInfinity[curve, t] ECPFibreAtInfinity[curve, t, n]
Arguments. curve, as for ECPFibreAt; : a positive integer or Automatic (default).
Returns. The same Association as ECPFibreAt, for the fibre at of a family over whose coefficients satisfy (: rational elliptic surface, : K3).
Notes & restrictions. The fibre is classified in with the weights , , . With Automatic, is the smallest value that makes the model regular at infinity; give explicitly to use a larger one. A value of that is too small raises a message.
Example. the universal curve with a point of order 6 has an fibre at infinity
In[90]:= Lookup[ECPFibreAtInfinity[ECPTorsionFamily[6, d]["Coefficients"], d],
{"Type", "Euler"}]
Out[90]= {"I2", 2}
ECPFibreList
Usage: ECPFibreList[curve, t] ECPFibreList[curve, t, n]
Arguments. curve, , as for ECPFibreAtInfinity.
Returns. An Association with the keys "n", "Fibres" (one record as in ECPFibreAt for every irreducible factor of over , with "Degree" its number of points, followed by the fibre at Infinity), "TotalEuler", "ExpectedEuler" (= ) and "ConsistentQ".
Notes & restrictions. "ConsistentQ" is True when the Euler numbers add up to , a strong check that the model is minimal and the classification is right. For an irreducible factor of degree larger than one the "Location" is that polynomial (its roots all carry the same fibre type) and "Split" is Missing["NeedsExtension"].
Example. the family with a point of order 6 has fibres , , ,
In[91]:= Sort[Lookup[#, {"Type", "Location"}] & /@ ECPFibreList[ECPTorsionFamily[6,
d]["Coefficients"], d]["Fibres"]]
Out[91]= {{"I1", -1/9}, {"I2", Infinity}, {"I3", -1}, {"I6", 0}}
In[92]:= Lookup[ECPFibreList[ECPTorsionFamily[6, d]["Coefficients"], d], {"n",
"TotalEuler", "ExpectedEuler", "ConsistentQ"}]
Out[92]= {1, 12, 12, True}
ECPFIndGenerators
Usage: ECPFIndGenerators[{, }] ECPFIndGenerators[curve, opts]
Arguments. curve: any curve form; the search runs on the integral short model and results are translated back. opts: "SearchBound" (default 50), "Verbose" (default False).
Returns. An Association with "Rank" (the number of independent points found, a lower bound for the rank), "Generators", "Torsion", "RankBound" and diagnostic data. The key "RankBound" is the heuristic estimate of ECPRankUpperBound, not a proven bound; for a proven bound use ECPRankBound (which gives 3 for the example below).
Notes & restrictions. A bounded heuristic, not a 2-descent: generators outside the search range are missed and the rank is not proven. The generators returned generate the free part of the Mordell–Weil group (modulo torsion), not the torsion subgroup. Its computation may take time, since a canonical height is computed for every point found; the cost grows with "SearchBound". In the example below, the generator differs from the point used elsewhere in this manual by a torsion point, so both have the same canonical height.
Example. independent generators, short form
In[18]:= ECPFindGenerators[{-36, 0}, "SearchBound" -> 30]
Out[18]= <|"Rank" -> 1, "Generators" -> {{-2, -8}}, "Torsion" -> {Infinity, {-6,
0}, {0, 0}, {6, 0}}, "RankBound" -> 2, "Curve" -> {-36, 0}, "HeightMatrix" ->
{{0.444313}}, "Determinant" -> 0.444313, "Time" -> 62.1973|>
ECPFindLocalReduction
Usage: ECPFindLocalReduction[{a1,...,a6}, p]
Arguments. A long model with integer coefficients and a prime .
Returns. A list that reduces the model at by one step; the identity if the model is already minimal at .
Notes & restrictions. One step at one prime; ECPMinimalModel iterates it over all primes.
Example. Laska-Kraus step at the prime 2
In[19]:= ECPFindLocalReduction[{0, 0, 0, -576, 0}, 2]
Out[19]= {2, 0, 0, 0}
ECPFindPointFp
Usage: ECPFindPointFp[m, a, b, p] ECPFindPointFp[m, curve, p, kappa]
Arguments. : non-negative integer message. a,b or curve: the curve over an odd prime field. : odd prime. kappa (default 100).
Returns. A point with for the smallest successful .
Notes & restrictions. Requires . with raises a message.
Example. embed the message 3 as a point (Koblitz)
In[20]:= ECPFindPointFp[3, 2, 3, 10007]
Out[20]= {300, 349}
ECPFindPointOrder
Usage: ECPFindPointOrder[point, a, b] ECPFindPointOrder[point, curve, maxOrder]
Arguments. point: or Infinity. a,b or curve. maxOrder (default 12).
Returns. The smallest with , otherwise Infinity.
Notes & restrictions. Brute force; compare ECPPointOrderFp, which is exact over .
Example. order of the 2-torsion point (0,0), short coefficients a, b
In[21]:= ECPFindPointOrder[{0, 0}, -36, 0]
Out[21]= 2
ECPFindPointOrderFp
Usage: ECPFindPointOrderFp[point, curve, p] ECPFindPointOrderFp[point, curve, {p, r}]
Arguments. A point or Infinity on the curve mod ; any curve form (a short pair needs odd); a prime or .
Returns. The exact order of the point: the smallest divisor of that kills it.
Notes & restrictions. Same algorithm as ECPPointOrderFp (the group order comes from ECPSEAPointCount, so about , or $ECPFqTableLimit$). Returns $Failed with a message for a non-prime, a singular curve or a point off the curve.
Example. order of on over
In[98]:= ECPFindPointOrderFp[{5, 1}, {2, 2}, 17]
Out[98]= 19
ECPFindTorsionPoints
Usage: ECPFindTorsionPoints[curve]
Arguments. curve: any curve form.
Returns. A list of all rational torsion points, Infinity first, in the coordinates of curve.
Notes & restrictions. Nagell–Lutz: a nonzero torsion point has integral coordinates with or . For non-integral coefficients or $ECPNagellLutzDiscLimit$ the function falls back to a bounded search and says so; the result is then not guaranteed complete. Its computation may take time when is large, since is factorised and all its divisors are listed.
Example. Nagell-Lutz on
In[22]:= ECPFindTorsionPoints[{-36, 0}]
Out[22]= {Infinity, {-6, 0}, {0, 0}, {6, 0}}
ECPFiniteFieldInfo
Usage: ECPFiniteFieldInfo[{p, r}]
Arguments. : a prime and .
Returns. The field polynomial over (so ) and the meaning of the generator (the class of , a primitive element).
Notes & restrictions. Elements are written or ( prints as ). On input any Laurent polynomial in with integer coefficients is accepted (1+g, 2 g^3+1, g^-1), an integer means mod , and any single symbol may replace .
Example. how is represented
In[23]:= ECPFiniteFieldInfo[{2, 3}]
Out[23]= <|"p" -> 2, "r" -> 3, "q" -> 8, "FieldPolynomial" -> 1 + x + x^3, "Generator" -> "g, the class of x modulo FieldPolynomial; g is a primitive element (it generates F_q*)", "Elements" -> "0 and g^k for k = 0..q-2 (g^0 prints as 1)"|>
ECPFormattedEquation
Usage: ECPFormattedEquation[curve]
Arguments. curve: long , short , Association, equation, polynomial or Automatic.
Returns. The equation as an Equal expression.
Notes & restrictions. Display only; use ECPExtractCoefficients to go the other way.
Example. display the long Weierstrass equation
In[24]:= ECPFormattedEquation[{0, 0, 1, -1, 0}]
Out[24]= y + y^2 == -x + x^3
ECPFqAdd
Usage: ECPFqAdd[a, b, {p, r}]
Arguments. Field elements in the notation (or polynomials in ); .
Returns. The sum, as or .
Notes & restrictions. Uses the discrete-log tables, so $ECPFqTableLimit.
Example. in F_8
In[25]:= ECPFqAdd[g, g^2, {2, 3}]
Out[25]= g^4
ECPFqElement
Usage: ECPFqElement[{c0, ..., c(r-1)}, {p, r}]
Arguments. The coefficients and the field .
Returns. The element in notation.
Notes & restrictions. Inverse of ECPFqVector.
Example. the element with coordinates 1,1,0
In[26]:= ECPFqElement[{1, 1, 0}, {2, 3}]
Out[26]= g^3
ECPFqInverse
Usage: ECPFqInverse[a, {p, r}]
Arguments. A nonzero element and the field .
Returns. as .
Notes & restrictions. Zero has no inverse and raises a message.
Example. inverse of in F_8
In[27]:= ECPFqInverse[g, {2, 3}]
Out[27]= g^6
ECPFqMultiply
Usage: ECPFqMultiply[a, b, {p, r}]
Arguments. Field elements and the field .
Returns. The product, as or .
Notes & restrictions. Multiplication is addition of exponents modulo .
Example. in F_8
In[28]:= ECPFqMultiply[g^3, g^5, {2, 3}]
Out[28]= g
ECPFqVector
Usage: ECPFqVector[a, {p, r}]
Arguments. A field element and the field .
Returns. The list over with .
Notes & restrictions. Inverse of ECPFqElement.
Example. coordinates of over F_2
In[29]:= ECPFqVector[g^3, {2, 3}]
Out[29]= {1, 1, 0}
ECPFromMinimalPoint
Usage: ECPFromMinimalPoint[{X,Y}, {u,r,s,t}]
Arguments. A point on the transformed model and the isomorphism that produced it (e.g. the "Transformation" of ECPMinimalModel).
Returns. The point on the original model: , .
Notes & restrictions. Exact inverse of ECPToMinimalPoint; raises a message.
Example. and back again
In[30]:= ECPFromMinimalPoint[ECPMinimalPoint[{-12, 72}, ECPMinimalModel[{0, 0, 0, -576, 0}]["Transformation"]], ECPMinimalModel[{0, 0, 0, -576, 0}]["Transformation"]]
Out[30]= {-12, 72}
ECPFromShortCoordinates
Usage: ECPFromShortCoordinates[{X,Y}, curve] ECPFromShortCoordinates[Infinity, curve]
Arguments. A point on the short model of ToShortWeierstrass[curve]; curve is the original long curve.
Returns. The point on curve: the inverse of , .
Notes & restrictions. Exact inverse of ECPToShortCoordinates. A point not on the short model raises a message.
Example. the inverse map
In[31]:= ECPFromShortCoordinates[{0, 1/2}, {0, 0, 1, -1, 0}]
Out[31]= {0, 0}
ECPFromShortCoordinatesFp
Usage: ECPFromShortCoordinatesFp[{X,Y}, curve, p]
Arguments. A point on the model returned by ECPToShortWeierstrassFp[curve, p]; the original long curve; a prime .
Returns. The corresponding point of the original curve mod .
Notes & restrictions. Works in every characteristic, unlike ECPFromShortCoordinates.
Example. and back again
In[32]:= ECPFromShortCoordinatesFp[ECPToShortCoordinatesFp[{0, 0}, {0, 0, 1, -1, 0}, 7], {0, 0, 1, -1, 0}, 7]
Out[32]= {0, 0}
ECPGaugeAlgebra
Usage: ECPGaugeAlgebra[type] ECPGaugeAlgebra[type, split]
Arguments. type: a Kodaira symbol as a string ("I3", "IV*", . . .). split: True or False where it matters (default Automatic).
Returns. The F-theory gauge algebra as a string: : / ; : / ; : / ; : / ; and : ; : ; : .
Notes & restrictions. depends on the monodromy cover (, or ), and , , carry no gauge algebra. When split is omitted, an unresolved case is returned as an “either/or” string.
Example. split and non-split , and an unresolved
In[94]:= {ECPGaugeAlgebra["IV*", True], ECPGaugeAlgebra["IV*", False], ECPGaugeAlgebra["I5"]}
Out[94]= {"e6", "f4", "su(5) or sp(2)"}
ECPGroupFp
Usage: ECPGroupFp[curve, p] ECPGroupFp[curve, {p, r}] ECPGroupFp[a, b, p]
Arguments. curve: short, long, Association, equation or Automatic. p or {p, r}: the field, $ECPFqTableLimit. a,b: the short curve .
Returns. An Association with "Field", "Curve", "Order", "Invariants" with and , "Structure" (a string), "Generators" (one point if cyclic, two otherwise) and "Points" (all points, Infinity first).
Notes & restrictions. Works in every characteristic. Over points are integer pairs; over coordinates are 0 or . Its computation may take time for large , since every point of is listed.
Example. a non-cyclic group over F_7
In[33]:= ECPGroupFp[{-1, 0}, 7]["Structure"]
Out[33]= "Z/2 x Z/4"
ECPHeightMatrix
Usage: ECPHeightMatrix[points, curve]
Arguments. A list of points on curve; curve: any curve form.
Returns. The symmetric matrix .
Notes & restrictions. Torsion points give zero rows; dependent points give a determinant near 0. Its computation may take time, since points need about canonical heights.
Example. height matrix; its determinant is the regulator
In[34]:= ECPHeightMatrix[{{2, 9}, {3, 10}}, {0, 73}]
Out[34]= {{0.46197, -0.488523}, {-0.488523, 0.996347}}
ECPHeightPairing
Usage: ECPHeightPairing[P1, P2, curve]
Arguments. Two points on curve; curve: any curve form.
Returns. The real number , so that exactly as returned by ECPCanonicalHeight.
Notes & restrictions. Inherits the approximation and the normalisation of ECPCanonicalHeight. Its computation may take time, since it needs three canonical heights.
Example. pairing of (2,9) and (3,10) on
In[35]:= ECPHeightPairing[{2, 9}, {3, 10}, {0, 73}]
Out[35]= -0.488523
ECPIndependentQ
Usage: ECPIndependentQ[points, curve] ECPIndependentQ[points, curve, tol]
Arguments. A list of points; curve; tol (default 0.01): determinant threshold.
Returns. True if det ECPHeightMatrix tol, else False.
Notes & restrictions. Any torsion point, or two multiples of one point, makes the set dependent. A negative tol raises a message. Its computation may take time, since it builds the full height matrix.
Example. (2,9), (3,10) are independent
In[36]:= ECPIndependentQ[{{2, 9}, {3, 10}}, {0, 73}]
Out[36]= True
ECPIsMinimal
Usage: ECPIsMinimal[{a1,...,a6}] ECPIsMinimal[curve]
Arguments. Any curve form (a short pair {A, B} is read as {0, 0, 0, A, B}).
Returns. True iff the long model is a global minimal (Laska–Kraus) model over .
Notes & restrictions. The right test for a long model; ECPMinimalQ on a short pair can be fooled at .
Example. 37a1 has squarefree discriminant, so it is minimal
In[37]:= ECPIsMinimal[{0, 0, 1, -1, 0}]
Out[37]= True
ECPIsMinimalShort
Usage: ECPIsMinimalShort[{A,B}] ECPIsMinimalShort[curve]
Arguments. A short pair, or any curve form.
Returns. For a short pair: minimality among short models (via ECPMinimalQ); for long input: the same as ECPIsMinimal.
Notes & restrictions. A short pair can pass this test and still be non-minimal as a Weierstrass model at .
Example. is not minimal ( removes , )
In[38]:= ECPIsMinimalShort[{-576, 0}]
Out[38]= False
ECPJFunction
Usage: ECPJFunction[curve]
Arguments. curve: a family in any accepted form, with coefficients that may contain symbols.
Returns. The -invariant as a simplified rational function of the parameters.
Notes & restrictions. ECPJInvariant is meant for numeric curves; its singularity test cannot decide symbolic discriminants, which is why this command exists. A family with raises a message.
Example. the -function of the Legendre family
In[95]:= Simplify[ECPJFunction[{0, -(1 + t), 0, t, 0}] == 256 (t^2 - t + 1)^3/(t^2 (t - 1)^2)]
Out[95]= True
ECPJInvariant
Usage: ECPJInvariant[curve] ECPJInvariant[curve, p] ECPJInvariant[curve, {p, r}]
Arguments. curve: any curve form (also bare coefficients). : optional prime modulus; : .
Returns. , reduced mod or computed in if a modulus is given.
Notes & restrictions. The short-form overload modulo excludes .
Example. curve = Automatic uses the session curve
In[39]:= ECPJInvariant[Automatic]
Out[39]= 110592/37
ECPKodairaType
Usage: ECPKodairaType[{ordC4, ordC6, ordDelta}]
Arguments. The orders of vanishing of , and at a point: non-negative integers (or Infinity).
Returns. {type, EulerNumber} from Kodaira’s table (Table 1); the Euler number equals ord .
Notes & restrictions. The table is the characteristic-0 one, so it is valid over and . The result is {"non-minimal", Indeterminate} when ord and ord , and {"unclassified", Indeterminate} for inconsistent orders.
Example.
In[88]:= {ECPKodairaType[{2, 3, 8}], ECPKodairaType[{4, 6, 12}]}
Out[88]= {{"I2*", 8}, {"non-minimal", Indeterminate}}
ECPLegendreToWeierstrass
Usage: ECPLegendreToWeierstrass[lambda]
Arguments. lambda: a number or symbol, .
Returns. A pair {A, B} such that is isomorphic to (scaling , ).
Notes & restrictions. Requires characteristic 0 or .
Example. Legendre form
In[40]:= ECPLegendreToWeierstrass[3]
Out[40]= {-3024, -34560}
ECPLocalData
Usage: ECPLocalData[model]
Arguments. An integral long model.
Returns. An Association mapping each prime dividing to the Association that ECPTate[model, p] returns.
Notes & restrictions. Equivalent to calling ECPTate once per prime factor of . Its computation may take time, since it factorises , which is slow when has large prime factors.
Example. reduction data at every bad prime
In[41]:= ECPLocalData[{0, 0, 0, -36, 0}]
Out[41]= <|2 -> <|"f" -> 6, "type" -> "I2*", "model" -> {0, 6, 0, -24, -64}, "split" -> None|>, 3 -> <|"f" -> 2, "type" -> "I0*", "model" -> {0, 0, 0, -36, 0}, "split" -> None|>|>
ECPMillerFp
Usage: ECPMillerFp[n, P, Q, curve, field]
Arguments. : a positive integer. , : points on curve over the field, with . curve: short {A, B} (odd ), long {a1, ..., a6}, an Association or an equation. field: a prime or {p, r}; over , , field elements are written 0 or (see ECPFiniteFieldInfo).
Returns. The value of Miller’s function, where , normalised as in Miller’s algorithm: at every step the line through and is divided by the vertical line through . An integer for , 0 or for .
Notes & restrictions. Double-and-add loop. Returns $Failed with a message if is a zero or a pole of an intermediate function (for example when lies in the group generated by ). If the result is 1. Works in every characteristic, including 2 and 3.
Example. for , on over
In[78]:= ECPMillerFp[3, {0, 4}, {5, 1}, {0, 2}, 7]
Out[78] = 4
ECPMinimalModel
Usage: ECPMinimalModel[{a1,...,a6}] ECPMinimalModel[curve, opts]
Arguments. Any curve form (short {A, B} is read as {0, 0, 0, A, B}).
Returns. An Association with "MinimalCoefficients" (normalised so , , ), "Equation", "Transformation" ( from the input to the minimal model), "Discriminant", "OldDiscriminant" and "IsMinimal".
Notes & restrictions. Iterates ECPFindLocalReduction over all primes dividing ; feed "Transformation" to ECPToMinimalPoint to carry points along. Its computation may take time, since it factorises , which is slow when has large prime factors.

Figure 1. Example. minimal model, with the transformation used In[42]:= ECPMinimalModel[{0, 0, 0, -576, 0}] Out[42]= <|"MinimalCoefficients" -> {0, 0, 0, -36, 0}, "Equation" -> y^2 == -36 x + x^3, "Transformation" -> {2, 0, 0, 0}, "Discriminant" -> 2985984, "OldDiscriminant" -> 12230590464, "IsMinimal" -> True|>
ECPMinimalModelShort
Usage: ECPMinimalModelShort[{A,B}] ECPMinimalModelShort[curve]
Arguments. A short pair, or any curve form.
Returns. For short input: the minimal short model (removes , ). For long input: the result of ECPMinimalModel.
Notes & restrictions. The shape of the Association depends on the kind of input; test for "MinimalCoefficients" when writing generic code.

Figure 2. Example. minimal short model In[43]:= ECPMinimalModelShort[{-576, 0}] Out[43]= <|"MinimalCoefficients" -> {-36, 0}, "Equation" -> y^2 == -36 x + x^3, "TransformationScale" -> 2, "Discriminant" -> 2985984, "OldDiscriminant" -> 12230590464, "IsMinimal" -> True|>
ECPMinimalQ
Usage: ECPMinimalQ[{A,B}, p] ECPMinimalQ[{A,B}] ECPMinimalQ[{a1,...,a6}, p] ECPMinimalQ[{a1,...,a6}]
Arguments. A short pair or a long model, optionally a prime .
Returns. True/False. Short overload: not both and . Long overload: true Laska–Kraus minimality.
Notes & restrictions. Short-model minimality is weaker than Weierstrass minimality at : for instance passes the short test but reduces to . Use ECPIsMinimal for the true test.

Figure 3. Example. local test at the prime 2 In[44]:= ECPMinimalQ[{-576, 0}, 2] Out[44]= False
Remark (choosing a minimality test). ECPIsMinimal, ECPIsMinimalShort and ECPMinimalQ are not interchangeable. ECPIsMinimal always applies the Laska–Kraus test and answers whether the model is a global minimal Weierstrass model; it takes no prime and a short pair is read as . ECPMinimalQ can test at a single prime (or globally if is omitted). On a long model it agrees with ECPIsMinimal; on a short pair it only checks that and do not both hold, which is minimality among short models. ECPMinimalShort uses this short-model rule for a short pair and equals ECPIsMinimal for long input. The two notions differ at : passes the short test, yet it is not minimal as a Weierstrass model (it reduces to ), so ECPIsMinimal[{0, 16}] is False while ECPMinimalQ[{0, 16}] is True. Use ECPIsMinimal whenever the true answer matters, and ECPMinimalQ[curve, p] for a local check at one prime, preferably on a long model.
ECPMultiply
Usage: ECPMultiply[n, P, curve]
Arguments. : an integer (any sign; 0 gives Infinity). : a point or Infinity. curve: any curve form.
Returns. The point by double-and-add, in the coordinates of curve.
Notes & restrictions. Negative uses .
Example. 4 (0,0) on 37a1
In[45]:= ECPMultiply[4, {0, 0}, {0, 0, 1, -1, 0}]
Out[45]= {2, -3}
ECPMultiplyFp
Usage: ECPMultiplyFp[n, P, a, p] ECPMultiplyFp[n, P, curve, p] ECPMultiplyFp[n, P, curve, {p, r}]
Arguments. : an integer of either sign. , /curve, : as in ECPAddFp.
Returns. as or Infinity.
Notes & restrictions. Double-and-add on top of ECPAddFp.
Example. 3 (5,1)
In[46]:= ECPMultiplyFp[3, {5, 1}, 2, 17]
Out[46]= {10, 6}
ECPNaiveHeight
Usage: ECPNaiveHeight[{x, y}]
Arguments. A rational point (only is used).
Returns. .
Notes & restrictions. The base case of the limit in ECPCanonicalHeight; not itself a group invariant. A symbolic raises a message.
Example. for
In[47]:= ECPNaiveHeight[{-3, 9}]
Out[47]= 1.09861
ECPNormalFormCharTwoThree
Usage: ECPNormalFormCharTwoThree[curve, p] ECPNormalFormCharTwoThree[curve, {p, r}]
Arguments. curve: any curve form. : 2 or 3; : work over .
Returns. An Association with "NormalForm", "Transformation", "Case" (a string naming the ordinary or supersingular normal form used) and "Characteristic". For : or ; for : or .
Notes & restrictions. Over the result also has "FieldOrder" and, for ordinary, a "Gamma" of absolute trace 1 ().
Example. characteristic 2
In[48]:= ECPNormalFormCharTwoThree[{1, 0, 1, 1, 1}, 2]
Out[48]= <|"NormalForm" -> {1, 1, 0, 0, 1}, "Transformation" -> {1, 1, 0, 0}, "Case" -> "ordinary (a1 != 0): y^2+xy=x^3+a2 x^2+a6", "Characteristic" -> 2|>
ECPOnCurveQ
Usage: ECPOnCurveQ[P, curve] Arguments. P: a point or Infinity; curve: any curve form. Returns. True iff P lies exactly on curve; Infinity always does. Notes & restrictions. Takes a single point list and any curve form, unlike ECPPointQ.
Example. exact membership test, long form
In[49]:= ECPOnCurveQ[{0, 0}, {0, 0, 1, -1, 0}]
Out[49]= True
ECPParseAffineCurve
Usage: ECPParseAffineCurve[input] Arguments. A polynomial, equation, 5-element coefficient list, Association or Automatic. Returns. The list {F, {xv, yv}}. Notes & restrictions. Internal workhorse of the curve-input handling.
Example. normalise a curve to polynomial, variables
In[50]:= ECPParseAffineCurve[y^2 + y - x^3 + x]
Out[50]= {x - x^3 + y + y^2, {x, y}}
ECPParseHomogeneousCurve
Usage: ECPParseHomogeneousCurve[input] Arguments. As ECPParseAffineCurve; a two-variable input is homogenised automatically. Returns. A homogeneous cubic and its three variables. Notes & restrictions. Used by ECPChordAndTangent and ECPCubicToWeierstrass.
Example. homogenise a cubic with respect to z
In[51]:= ECPParseHomogeneousCurve[y^2 + y == x^3 - x]
Out[51]= -x^3 + y^2 z + x z^2 + y z^2
ECPPointOrder
Usage: ECPPointOrder[point, curve] Arguments. A point or Infinity; any curve form. Returns. The exact order, or Infinity for a point of infinite order. Notes & restrictions. Over no torsion order exceeds Mazur’s bound 12, so Infinity is unambiguous.
Example. order of (-3,9): infinite, it is not torsion
In[52]:= ECPPointOrder[{-3, 9}, {-36, 0}]
Out[52]= Infinity
ECPPointOrderFp
Usage: ECPPointOrderFp[point, a, b, p] ECPPointOrderFp[point, curve, p] ECPPointOrderFp[point, curve, {p, r}] Arguments. A point or Infinity on the curve mod ; a,b or curve; a prime or {p, r}. Returns. The smallest divisor of that kills the point; $Failed with a message for a non-prime, a singular curve or a point off the curve. Notes & restrictions. Exact, not limited by Mazur’s bound. Limited by the point count: about , or $q \le $ECPFqTableLimit. Its computation may take time for large , since each call first counts the whole group.
Example. order of
In[53]:= ECPPointOrderFp[{5, 1}, 2, 2, 17]
Out[53]= 19
ECPPointQ
Usage. ECPPointQ[F, x1, y1]
Arguments. F: a curve Association, equation or polynomial in or . x1, y1: the two coordinates.
Returns. True iff satisfies F.
Notes & restrictions. Compare ECPOnCurveQ, which takes a point list and any curve form.
Example. lies on
In[54]:= ECPPointQ[y^2 + y == x^3 - x, 0, 0]
Out[54]= True
ECPPointQFp
Usage. ECPPointQFp[P, a, b, p] ECPPointQFp[P, curve, p] ECPPointQFp[P, curve, {p, r}]
Arguments. A point (not necessarily reduced) or Infinity; a,b or curve; a prime p or .
Returns. True iff P lies on the curve over the field; $Failed with a message if p is not prime.
Notes & restrictions. Over an extension field give coordinates and coefficients in notation.
Example. on over
In[55]:= ECPPointQFp[{5, 1}, 2, 2, 17]
Out[55]= True
ECPPolynomialHomogeneous
Usage. ECPPolynomialHomogeneous[F, vars]
Arguments. A polynomial and its variables.
Returns. True iff F is homogeneous in vars.
Notes & restrictions. No numerical tolerance.
Example. homogeneity test
In[56]:= ECPPolynomialHomogeneous[x^2 + x y + y^2, {x, y}]
Out[56]= True
ECPPolynomialTransform
Usage. ECPPolynomialTransform[F, vars, matrix]
Arguments. A polynomial, its variables and a square matrix.
Returns. The expanded polynomial after substituting the linear change of variables.
Notes & restrictions. Used when moving a flex to .
Example. linear change of variables
In[57]:= ECPPolynomialTransform[x^2 + y^2, {x, y}, {{1, 1}, {0, 1}}]
Out[57]= x^2 + 2 x y + 2 y^2
ECPPrimeDivisorCount
Usage: ECPPrimeDivisorCount[n] ECPPrimeDivisorCount[curve]
Arguments. A nonzero integer , or an integral model in any curve form.
Returns. , the number of distinct primes dividing (); for a curve, .
Notes & restrictions. For a minimal model, is the number of primes of bad reduction. This is the function of Theorem 4.
Example. , and for () In[99]:= {ECPPrimeDivisorCount[360], ECPPrimeDivisorCount[{-36, 0}]} Out[99]= {3, 2}
ECPQuarticToWeierstrass
Usage: ECPQuarticToWeierstrass[{a,b,c,d,e}]
Arguments. The coefficients of .
Returns. A pair with , : the Jacobian of the quartic.
Notes & restrictions. The Jacobian is isomorphic to the quartic itself exactly when the quartic has a rational point.
Example. In[58]:= ECPQuarticToWeierstrass[{1, 0, 0, 1, 1}] Out[58]= {-324, 729}
ECPRankBound
Usage: ECPRankBound[curve] ECPRankBound[curve, "Details"]
Arguments. An integral model in any curve form with a rational point of order 2.
Returns. The smallest of the proven bounds of Theorem 4 and Proposition 1 that apply: after moving a rational root of the cubic to , from the bad reduction, and when all three 2-torsion points are rational. With "Details", an Association with "Bound", "Candidates" (method bound) and the data used.
Notes & restrictions. A proven upper bound, not the rank. If has no point of order 2 no bound of this type exists, and Missing["NoRational2Torsion"] is returned with a message. Its computation may take time, since ECPLocalData factorises .
Example. (rank 1), and 37a1, which has no rational point of order 2 In[100]:= {ECPRankBound[{-36, 0}], ECPRankBound[{0, 0, 1, -1, 0}]} Out[100]= {3, Missing["NoRational2Torsion"]}
ECPRankUpperBound
Usage: ECPRankUpperBound[{A,B}] ECPRankUpperBound[curve]
Arguments. Any curve form with integral coefficients.
Returns. A small integer: the number of distinct prime factors of , capped at 4.
Notes & restrictions. A crude sanity signal, not derived from 2-descent: it equals the rank for 37a1 but overestimates it for . Its computation may take time, since it factorises , which is slow when has large prime factors.
Example. heuristic rank estimate (not a proven bound) In[59]:= ECPRankUpperBound[{-36, 0}] Out[59]= 2
ECPSchoofPointCount
Usage: ECPSchoofPointCount[a, b, p] ECPSchoofPointCount[curve, p]
Arguments. a, b or curve: short , long , an Association or an equation; a prime of any size ( is also accepted).
Returns. , including the point at infinity.
Notes & restrictions. Schoof’s algorithm: is found from the action of the Frobenius endomorphism on (division polynomials, arithmetic in ) for () until , and is recovered by the Chinese Remainder Theorem and Hasse’s bound. The running time is polynomial in , so is not limited to as for ECPSEAPointCount. For the points are counted directly. The Elkies and Atkin improvements (SEA) are not implemented. Fields with are not supported; use ECPSEAPointCount. Its computation may take time for very large , since the division polynomials have degree about .
Example. a prime far beyond the enumeration limit, and a check against enumeration
In[83]:= ECPSchoofPointCount[{2, 3}, 1000000000039]
Out[83]= 1000000769568
In[84]:= ECPSchoofPointCount[{2, 3}, 1000003] == ECPSEAPointCount[{2, 3}, 1000003]
Out[84]= True
ECPSEAPointCount
Usage: ECPSEAPointCount[a, b, p] ECPSEAPointCount[curve, p] ECPSEAPointCount[curve, {p, r}]
Arguments. a, b or curve (the long overload also works for ); a prime or .
Returns. including the point at infinity.
Notes & restrictions. Despite the name this is brute-force enumeration, not the Schoof–Elkies–Atkin algorithm; for larger primes use ECPSchoofPointCount. For a curve with plain integer coefficients over the count comes from by a Lucas-sequence recurrence and works for any . Its computation may take time for large , since the running time is proportional to .
Example. number of points (direct count, not the SEA algorithm)
In[60]:= ECPSEAPointCount[2, 2, 17]
Out[60]= 19
ECPSearchPoints
Usage: ECPSearchPoints[curve, bound]
Arguments. curve: any curve form; bound (default 50): numerators bound, denominators up to 10.
Returns. All points found, in the coordinates of curve.
Notes & restrictions. Not guaranteed complete for positive rank; method distinct from Nagell–Lutz.
Example. rational points of small height
In[61]:= ECPSearchPoints[{-36, 0}, 30]
Out[61]= {{-6, 0}, {-3, 9}, {-3, -9}, {-2, 8}, {-2, -8}, {0, 0}, {6, 0}, {12, 36}, {12, -36}, {18, 72}, {18, -72}, {25/4, 35/8}, {25/4, -35/8}}
ECPSetEC
Usage: ECPSetEC[a1, a2, a3, a4, a6]
Arguments. The five long coefficients as separate arguments.
Returns. The new value of $ECPcurrentEC.
Notes & restrictions. A singular input raises a message and leaves $ECPcurrentEC unchanged.
Example. set the session curve to 37a1:
In[62]:= ECPSetEC[0, 0, 1, -1, 0]
Out[62]= <|"Coefficients" -> {0, 0, 1, -1, 0}, "Equation" -> x - x^3 + y + y^2 ==
0|>
ECPShortDiscriminant
Usage: ECPShortDiscriminant[{A,B}] ECPShortDiscriminant[A, B]
Arguments. A short pair or two numbers.
Returns. .
Notes & restrictions. Short input only; use ECPWeierstrassDiscriminant for other forms.
Example. discriminant of
In[63]:= ECPShortDiscriminant[{-36, 0}]
Out[63]= 2985984
ECPShortWeierstrassForm
Usage: ECPShortWeierstrassForm[curve]
Arguments. Any curve form.
Returns. Curve in Short form with integer coefficients.
Notes & restrictions. Uses a different transformation than ECPToShortWeierstrass.
Example. correctly spelled synonym
In[64]:= ECPShortWeierstrassForm[y^2 + y == x^3 - x]
Out[64]= -11664 + 1296 x - x^3 + y^2
ECPTate
Usage: ECPTate[model, p]
Arguments. An integral long model and a prime (normally a bad prime).
Returns. An Association with the conductor exponent (key "f"), the Kodaira symbol, the minimal model at and the split type.
Notes & restrictions. At a prime of good reduction it only confirms minimality and returns exponent 0. A singular model or a non-prime raises a message.
Example. Tate’s algorithm for 37a1 at
In[66]:= ECPTate[{0, 0, 1, -1, 0}, 37]
Out[66]= <|"f" -> 1, "type" -> "I1", "model" -> {0, 15, 37, 74, -222}, "split" ->
False|>
ECPTateForm
Usage: ECPTateForm[orders, t]
Arguments. orders: a list of five non-negative integers for . t: the parameter (a symbol).
Returns. The long Weierstrass coefficients with the base constants , a model whose coefficients vanish to the prescribed orders at .
Notes & restrictions. Example orders: SU(2) , SU(3) , SU(5) , SO(10) , E6 , E7 , E8 . The base constants are one arbitrary generic choice, not the most general Tate form.
Example. Tate form for su(2)
In[96]:= ECPTateForm[{0, 0, 1, 1, 2}, t]
Out[96]= {1 + 2 t, 1 + 3 t, t (3 + 4 t), t (5 + 5 t), t^2 (7 + 6 t)}
ECPTatePairingFp
Usage: ECPTatePairingFp[n, P, Q, curve, field]
Arguments. : a positive integer dividing . : a point of with . : any point of . curve: any curve form (every characteristic). field: a prime or .
Returns. The reduced Tate pairing , an -th root of unity in (an integer for , or for ).
Notes & restrictions. Computed by Miller’s algorithm. The value depends only on modulo ; the pairing is bilinear and non-degenerate on . A point of smaller exact order is reduced to . If is a zero or a pole of an intermediate Miller function, the value with an auxiliary point is used. If a message asks for an extension field with . Unlike the Weil pairing the pairing is not alternating, so need not be . Its computation may take time for large when the auxiliary point is needed, since the points of are then listed.
| Example. Tate pairing of and on over |
In[79]:= ECPTatePairingFp[3, {0, 4}, {5, 1}, {0, 2}, 7] |
Out[79]= 2 |
Table 1 (PDF p. 38).
ECPToLongCoordinates
Usage: ECPToLongCoordinates[pt, curve] ECPToLongCoordinates[pt, curve, {u,r,s,t}]
Arguments. A point of the transformed model ECPTransformWeierstrass[curve, {u,r,s,t}]; the original long curve; an isomorphism (default identity ). The point is checked on the transformed model.
Returns. The point on the original model via , .
Notes & restrictions. With the default identity this is a no-op; to undo ECPToShortCoordinates use ECPFromShortCoordinates.
Example. on the transformed model (see ECPTransformWeierstrass) is on 37a1 |
In[67]:= ECPToLongCoordinates[{0, 0}, {0, 0, 1, -1, 0}, {1, 1, 0, 0}] |
Out[67]= {1, 0} |
Table 2.
ECPToMinimalPoint
Usage: ECPToMinimalPoint[{x,y}, {u,r,s,t}]
Arguments. A point of the original model and the isomorphism (e.g. "Transformation" of ECPMinimalModel).
Returns. The point on the new model: , .
Notes & restrictions. raises a message.
| Example. map (-12, 72) on to the minimal model |
In[68]:= ECPToMinimalPoint[{-12, 72}, ECPMinimalModel[{0, 0, 0, -576, 0}]["Transformation"]] |
Out[68]= {-3, 9} |
Table 3.
ECPTorsionBasisFp
Usage: ECPTorsionBasisFp[n, curve, field]
Arguments. : an integer prime to . curve: any curve form. field: a prime or .
Returns. A basis of the full -torsion subgroup : has exact order and ECPWeilPairingFp[n, P, Q, curve, field] is a primitive -th root of unity.
Notes & restrictions. Requires , that is, (this forces ); otherwise a message says so, suggests an extension field , and $Failed is returned. All points are enumerated, so $ECPFqTableLimit. Over the coordinates are written 0 or . Its computation may take time for large , since every point of is listed and multiplied by .
Example. basis of for over
In[80]:= ECPTorsionBasisFp[3, {0, 2}, 7]
Out[80]= {{0, 4}, {5, 1}}
ECPTorsionFamily
Usage: ECPTorsionFamily[N, d]
Arguments. : 4, 5, 6 or 7. : the parameter on (a symbol).
Returns. The universal elliptic curve with a rational -torsion point, in the Tate–Kubert normal form (the point has order ), as an Association with the keys "Coefficients" ({1 - c, -b, -b, 0, 0}), "b", "c" and "Parameter".
Notes & restrictions. Over the torsion of the Mordell–Weil group contains . Use ECPFibreList on the coefficients to see the fibre content ( gives ). Other values of raise a message.
Example. the family with a point of order 6
In[97]:= ECPTorsionFamily[6, d]["Coefficients"]
Out[97]= {1 - d, -d - d^2, -d - d^2, 0, 0}
ECPTorsionSubgroup
Usage: ECPTorsionSubgroup[curve]
Arguments. Any curve form.
Returns. An Association with "Order", "Structure" (a string), "Generators" and "Points" (including Infinity); points are returned in the coordinates of curve.
Notes & restrictions. Built on ECPFindTorsionPoints, so it inherits the $ECPNagellLutzDiscLimit fallback. Its computation may take time for the same reason as ECPFindTorsionPoints.
Example. torsion subgroup of
In[69]:= ECPTorsionSubgroup[{-36, 0}]
Out[69]= <|"Order" -> 4, "Structure" -> "Z/2Z x Z/2Z", "Generators" -> {{0, 0}, {-6, 0}}, "Points" -> {Infinity, {-6, 0}, {0, 0}, {6, 0}}|>
ECPToShortCoordinates
Usage: ECPToShortCoordinates[{x,y}, curve]
Arguments. A point on curve; any curve form.
Returns. The point on the model of ECPToShortWeierstrass[curve]: , .
Notes & restrictions. A point off the curve, or a singular curve, raises a message and returns $Failed.
Example. move the point to the short model
In[70]:= ECPToShortCoordinates[{0, 0}, {0, 0, 1, -1, 0}]
Out[70]= {0, 1/2}
ECPToShortCoordinatesFp
Usage: ECPToShortCoordinatesFp[{x,y}, curve, p]
Arguments. A point of the long curve over ; any curve form; a prime .
Returns. The image on the model of ECPToShortWeierstrassFp[curve, p]; Infinity maps to Infinity.
Notes & restrictions. A group isomorphism. The point must lie on the curve mod .
Example. move (0,0) to the reduced model
In[71]:= ECPToShortCoordinatesFp[{0, 0}, {0, 0, 1, -1, 0}, 7]
Out[71]= {0, 4}
ECPToShortWeierstrass
Usage: ECPToShortWeierstrass[curve]
Arguments. Any curve form.
Returns. The short model with , , as an equation in .
Notes & restrictions. For use ECPToShortWeierstrassFp or ECPNormalFormCharTwoThree.
Example. the short model Y^2 = X^3 + A X + B, A = -c4/48, B = -c6/864
In[72]:= ECPToShortWeierstrass[{0, 0, 1, -1, 0}]
Out[72]= Y^2 == 1/4 - X + X^3
Remark (ECPToShortWeierstrass versus ECPShortWeierstrassForm). Both reduce a long model to short Weierstrass form for characteristic 0 or , but they return different things. ECPToShortWeierstrass[curve] gives the equation with , , written in the new variables ; the coefficients may be rational, and the substitution , is the one used by ECPToShortCoordinates and ECPFromShortCoordinates. For 37a1 it returns Y^2 == 1/4 - X + X^3. ECPShortWeierstrassForm[curve] returns the polynomial in the curve’s own variables , not an equation. For 37a1 it returns , that is : the same curve rescaled by so that the coefficients are integers (, ). The two outputs are therefore isomorphic over but are not the same equation, and points computed on one model cannot be used on the other without the corresponding scaling. Use ECPToShortWeierstrass when you need the point transformation or the standard normalisation, and ECPShortWeierstrassForm when you want an integral short model as a polynomial. Neither applies in characteristic 2 or 3; use ECPToShortWeierstrassFp.
ECPToShortWeierstrassFp
Usage: ECPToShortWeierstrassFp[curve, p] ECPToShortWeierstrassFp[curve, {p, r}]
Arguments. Any curve form (integer or -integral rational coefficients); a prime or .
Returns. An Association with "Characteristic", "OriginalCoefficients", "ShortCoefficients", "Transformation", "Case", "PureShortQ", "ShortPair", "Equation", "Discriminant" and "jInvariant" (plus "FieldOrder" over ).
Notes & restrictions. For the result is a genuine short model; for one exists only if (otherwise ); for none exists.
Example. long model of 37a1 reduced modulo 7
In[73]:= ECPToShortWeierstrassFp[{0, 0, 1, -1, 0}, 7]
Out[73]= <|"Characteristic" -> 7, "OriginalCoefficients" -> {0, 0, 1, 6, 0},
"ShortCoefficients" -> {0, 0, 6, 2}, "Transformation" -> {1, 0, 0, 3}, "Case" ->
"p > 3: genuine short model y^2 = x^3 + A x + B (A = -c4/48, B = -c6/864 mod p)",
"PureShortQ" -> True, "ShortPair" -> {6, 2}, "Equation" -> y^2 == 2 + 6 x + x^3,
"Discriminant" -> 2, "jInvariant" -> 3|>
ECPToWeierstrassForm
Usage: ECPToWeierstrassForm[F, {xv, yv}]
Arguments. A polynomial or equation and its two variables.
Returns. The equation .
Notes & restrictions. No change of variables; stray non-Weierstrass monomials are reported, not discarded.
Example. read the coefficients off a cubic already in Weierstrass shape
In[74]:= ECPToWeierstrassForm[y^2 + y - x^3 + x, {x, y}]
Out[74]= x - x^3 + y + y^2
ECPTransformWeierstrass
Usage: ECPTransformWeierstrass[{a1,...,a6}, {u,r,s,t}]
Arguments. A long model (or any curve form) and an isomorphism with .
Returns. The new coefficients for , :
Notes & restrictions. The building block of ECPMinimalModel, ECPFindLocalReduction, ECPNormalFormCharTwoThree and ECPToShortWeierstrassFp. raises a message.
Example. apply the isomorphism 1,1,0,0 to the coefficients
In[75]:= ECPTransformWeierstrass[{0, 0, 1, -1, 0}, {1, 1, 0, 0}]
Out[75]= {0, 3, 1, 2, 0}
ECPWeierstrassDiscriminant
Usage: ECPWeierstrassDiscriminant[curve]
Arguments. Any curve form.
Returns. .
Notes & restrictions. The curve is nonsingular iff .
Example. discriminant of 37a1
In[76]:= ECPWeierstrassDiscriminant[{0, 0, 1, -1, 0}]
Out[76]= 37
ECPWeilPairingFp
Usage: ECPWeilPairingFp[n, P, Q, curve, field]
Arguments. : a positive integer prime to . , : points of () on curve over the field. curve: any curve form (every characteristic). field: a prime or .
Returns. The Weil pairing , computed with Miller’s algorithm for both functions: an -th root of unity in , written as an integer for the field or and as or for .
Notes & restrictions. The pairing is bilinear, alternating () and non-degenerate. Points of smaller exact order are reduced to their exact order, and dependent points give 1. Returns $Failed with a message if is not prime to , or if a point is not on the curve or not in .
Example. Weil pairing of the basis of for over (a primitive cube root of unity: )
In[81]:= ECPWeilPairingFp[3, {0, 4}, {5, 1}, {0, 2}, 7]
Out[81]= 2
ECPWInvariants
Usage: ECPWInvariants[curve]
Arguments. Any curve form.
Returns. The Association <|"b2" -> ..., "b4" -> ..., "b6" -> ..., "b8" -> ..., "c4" -> ..., "c6" -> ..., "Discriminant" -> ...|>.
Notes & restrictions. There is no key; use ECPJInvariant.
Example. b2, b4, b6, b8, c4, c6 and the discriminant
In[77]:= ECPWInvariants[{0, 0, 1, -1, 0}]
Out[77]= <|"b2" -> 0, "b4" -> -2, "b6" -> 1, "b8" -> -1, "c4" -> 48, "c6" -> -216, "Discriminant" -> 37|>
Notebook guide
Here are some pre-computed example notebooks from various standard textbooks on the elliptic curves using ECPack.wl for the better understanding of the subject. User can click on the name of example notebook, which will redirect them to Github page. There the notebook can be downloaded to check the computed examples.
| Notebook | Description |
| Lozano Examples [7] | Textbook-style exercises illustrating changes of form, invariants, and basic computations with elliptic curves in the style of Lozano-Robledo. |
| Husemöller Examples [28] | Classical exercises on the group law, torsion points, and explicit arithmetic drawn from the textbook of Husemöller. |
| Washington Examples [8] | Worked examples emphasizing finite-field arithmetic, point counts, and cryptography-related computations from the textbook of Washington. |
| Silverman AEC Examples [11] | Standard arithmetic examples covering minimal models, heights, ranks, and rational points from the textbook of Silverman. |
| Silverman Tate Examples [9] | Examples of point arithmetic and other computations over rational and finite fields from the textbook of Silverman and Tate. |
| McGee Examples [6] | Comparison examples inspired by McGee’s package, highlighting point arithmetic over , Bachet’s duplication formula and ElGamal encryption. |
| Miscellaneous Examples | Additional test curves and miscellaneous examples. Covers all possible commands of ECPack on some chosen curves. |
Table 2 (PDF p. 42). Summary of the seven accompanying Mathematica notebooks.
Declarations
Funding
This research did not receive any specific funding.
Availability of data and material
Not applicable. This manuscript does not report data generation or analysis. The package ECPack.wl and the accompanying Mathematica notebooks are openly available in the ECPack GitHub repository.
Competing interests
The authors have no competing interests to declare that are relevant to the content of this article.
Authors’ contributions
The Mathematica package ECPack.wl was created by D.B., with help from P.T. in the later stages. B.A. provided the essential knowledge of the subject without which this work would not have been completed, and gave D.B. and P.T. the guidance and mentorship they needed. The manuscript was written by B.A., D.B. and P.T.
References
- [1]Johannes Blümlein, Carsten Schneider, and Peter Paule, eds. Elliptic Integrals, Elliptic Functions and Modular Forms in Quantum Field Theory. Texts & Monographs in Symbolic Computation. Cham: Springer, 2019. ISBN: 978-3-030-04480-0. DOI: 10.1007/978-3-030-04480-0.
- [2]Stefan Weinzierl. Feynman Integrals. A Comprehensive Treatment for Students and Researchers. 1st ed. UNITEXT for Physics. Springer Cham, 2022. ISBN: 978-3-030-99557-7. DOI: 10.1007/978-3-030-99558-4.DOI
- [3]Eric D’Hoker and Justin Kaidi. Modular Forms and String Theory. Cambridge University Press, 2024. ISBN: 9781009457521. DOI: 10.1017/9781009457521.
- [4]Henry McKean and Victor Moll. Elliptic Curves: Function Theory, Geometry, Arithmetic. Cambridge: Cambridge University Press, 1997. ISBN: 0-521-58228-8. DOI: 10.1017/CBO9781139174879.DOI
- [5]Joseph H. Silverman. An Introduction to the Theory of Elliptic Curves. Lecture notes for the Summer School on Computational Number Theory and Applications to Cryptography, University of Wyoming, June 19–July 7, 2006. 2006. URL: https://www.math.brown.edu/~jhs/Presentations/WyomingEllipticCurve.pdf.
- [6]John McGee. “A Mathematica Package for Elliptic Curves”. In: Wolfram Technology Conference 2015. Wolfram Research. Champaign, Illinois, USA, 2015. URL: https://library.wolfram.com/infocenter/Conferences/9260/.
- [7]Álvaro Lozano-Robledo. Elliptic Curves, Modular Forms, and Their L-functions. Vol. 58. Student Mathematical Library. Providence, Rhode Island: American Mathematical Society, 2011. ISBN: 9780821852422. URL: https://bookstore.ams.org/view?ProductCode=STML/58.
- [8]Lawrence C. Washington. Elliptic Curves: Number Theory and Cryptography. 2nd ed. New York: Chapman and Hall/CRC, 2008. ISBN: 9781420071474. DOI: 10.1201/9781420071474.DOI
- [9]Joseph H. Silverman and John T. Tate. Rational Points on Elliptic Curves. 2nd ed. Cham: Springer, 2015. ISBN: 9783319858800. DOI: 10.1007/978-3-319-18588-0.DOI
- [10]René Schoof. “Elliptic curves over finite fields and the computation of square roots mod p”. In: Mathematics of Computation 44.170 (1985), pp. 483–494. DOI: 10.1090/S0025-5718-1985-077720-6.
- [11]Joseph H. Silverman. The Arithmetic of Elliptic Curves. 2nd ed. Vol. 106. Graduate Texts in Mathematics. New York: Springer, 2009. ISBN: 978-0-387-09493-9. DOI: 10.1007/978-0-387-09494-6.DOI
- [12]Joseph H. Silverman. Advanced Topics in the Arithmetic of Elliptic Curves. Vol. 151. Graduate Texts in Mathematics. New York: Springer, 1994. ISBN: 978-0-387-94325-1. DOI: 10.1007/978-1-4612-0851-8.DOI
- [13]John Tate. “Algorithm for determining the type of a singular fiber in an elliptic pencil”. In: Modular Functions of One Variable IV. Ed. by B. J. Birch and W. Kuyk. Vol. 476. Lecture Notes in Mathematics. Berlin: Springer, 1975, pp. 33–52. DOI: 10.1007/BFb0097582.DOI
- [14]Kunihiko Kodaira. “On compact analytic surfaces. II”. In: Annals of Mathematics (2) 77.3 (1963), pp. 563–626. DOI: 10.2307/1970131.DOI
- [15]Kunihiko Kodaira. “On compact analytic surfaces. III”. In: Annals of Mathematics (2) 78.1 (1963), pp. 1–40. DOI: 10.2307/1970500.DOI
- [16]Neal Koblitz. “Elliptic curve cryptosystems”. In: Mathematics of Computation 48.177 (1987), pp. 203–209. DOI: 10.1090/S0025-5718-1987-0866109-5.DOI
- [17]Victor S. Miller. “Use of elliptic curves in cryptography”. In: Advances in Cryptology — CRYPTO ’85 Proceedings. Ed. by Hugh C. Williams. Vol. 218. Lecture Notes in Computer Science. Berlin: Springer, 1986, pp. 417–426. URL: https://doi.org/10.1007/3-540-39799-X_31.
- [18]Darrel Hankerson, Alfred Menezes, and Scott Vanstone. Guide to Elliptic Curve Cryptography. Springer Professional Computing. New York: Springer, 2004. ISBN: 978-0-387-95273-4. DOI: 10.1007/b97644.DOI
- [19]Taher ElGamal. “A public key cryptosystem and a signature scheme based on discrete logarithms”. In: IEEE Transactions on Information Theory 31.4 (1985), pp. 469–472. DOI: 10.1109/TIT.1985.1057074.DOI
- [20]Victor S. Miller. “The Weil pairing, and its efficient calculation”. In: Journal of Cryptology 17.4 (2004), pp. 235–261. DOI: 10.1007/s00145-004-0315-8.DOI
- [21]Stephen Lichtenbaum. “Duality theorems for curves over p-adic fields”. In: Inventiones Mathematicae 7 (1969), pp. 120–136. DOI: 10.1007/BF01389795.DOI
- [22]Gerhard Frey and Hans-Georg Rück. “A remark concerning m-divisibility and the discrete logarithm in the divisor class group of curves”. In: Mathematics of Computation 62.206 (1994), pp. 865–874. DOI: 10.1090/S0025-5718-1994-1218343-6.DOI
- [23]Alfred J. Menezes, Tatsuaki Okamoto, and Scott A. Vanstone. “Reducing elliptic curve logarithms to logarithms in a finite field”. In: IEEE Transactions on Information Theory 39.5 (1993), pp. 1639–1646. DOI: 10.1109/18.259647.DOI
- [24]Darrin Doud. “A procedure to calculate torsion of elliptic curves over ℚ”. In: Manuscripta Mathematica 95.3 (1998), pp. 463–469. URL: https://eudml.org/doc/156388.DOI
- [25]Ernst S. Selmer. “The Diophantine Equation ax^3+by^3+cz^3 = 0”. In: Acta Mathematica 85 (1951), pp. 203–362. DOI: 10.1007/BF02395746.
- [26]J. E. Cremona. Algorithms for Modular Elliptic Curves. 2nd ed. Cambridge: Cambridge University Press, 1997, pp. vi+376. ISBN: 0-521-59820-6. URL: https://johncremona.github.io/book/.
- [27]Joseph H. Silverman. “Computing heights on elliptic curves”. In: Mathematics of Computation 51.183 (1988), pp. 339–358. DOI: 10.1090/S0025-5718-1988-0942161-4.DOI
- [28]Dale Husemöller. Elliptic Curves. 2nd ed. Graduate Texts in Mathematics. New York: Springer, 2004. ISBN: 978-0-387-95490-5. DOI: 10.1007/b979292.DOI