13.1 Cremona's tables of elliptic curves

Module: sage.databases.cremona

Cremona's tables of elliptic curves.

SAGE includes John Cremona's tables of elliptic curves in an easy-to-use format. The unique instance of the class CremonaDatabase() gives access to the database.

If the full CremonaDatabase isn't installed, a mini-version, which is included by default with SAGE, is included. It includes Weierstrass equations, rank, and torsion for curves up to conductor 10000.

The large database includes all curves of conductor up to 120,000 (!). It also includes data related to the BSD conjecture and modular degrees for all of these curves, and generators for the Mordell-Weil groups. To install it type the following in SAGE: !sage -i database_cremona_ellcurve-2005.11.03

The name of the database may change as it is updated. Type "!sage -optional" to see the latest package names.

Module-level Functions

CremonaDatabase( )

cremona_letter_code( n)

Returns the Cremona letter code corresponding to an integer. For example, 0 -> a 25 -> z 26 -> ba 51 -> bz 52 -> ca 53 -> cb etc.

NOTE: This is just the base 26 representation of n, where a=0, b=1, ..., z=25. This extends the old Cremona notation (counting from 0) for the first 26 classes, and is different for classes above 26.

Input:

n
- int
Output: str

sage: cremona_letter_code(0)
'a'
sage: cremona_letter_code(26)
'ba'
sage: cremona_letter_code(27)
'bb'
sage: cremona_letter_code(521)
'ub'
sage: cremona_letter_code(53)
'cb'
sage: cremona_letter_code(2005)
'czd'

is_optimal_id( id)

Returns true if the Cremona id refers to an optimal curve, and false otherwise. The curve is optimal if the id, which is of the form [letter code][number] has number 1.

NOTE: 990H3 is the optimal curve in that class, so doesn't obey this rule.

Input:

id
- str of form letter code followed by an integer, e.g., A3, BB5, etc.
Output: bool

sage: is_optimal_id('A2')
False
sage: is_optimal_id('B1')
True
sage: is_optimal_id('CC1')
True
sage: is_optimal_id('CC2')
False

old_cremona_letter_code( n)

Returns old the Cremona letter code corresponding to an integer.

For example, 1 -> A 26 -> Z 27 -> AA 52 -> ZZ 53 -> AAA etc.

Input:

n
- int
Output: str

sage: old_cremona_letter_code(1)
'A'
sage: old_cremona_letter_code(26)
'Z'
sage: old_cremona_letter_code(27)
'AA'
sage: old_cremona_letter_code(521)
'AAAAAAAAAAAAAAAAAAAAA'
sage: old_cremona_letter_code(53)
'AAA'
sage: old_cremona_letter_code(2005)
'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC'

parse_cremona_label( label)

Given a Cremona label corresponding that defines an elliptic curve, e.g., 11A1 or 37B3, parse the label and return the conductor, isogeny class label, and number.

The isogeny number may be omitted, in which case it default to 1. If the isogeny number and letter are both omitted, so label is just a string representing a conductor, then the label defaults to 'A' and the number to 1.

Input:

label
- str
Output:
int
- the conductor
str
- the isogeny class label
int
- the number

sage: parse_cremona_label('37a2')
(37, 'a', 2)
sage: parse_cremona_label('37b1')
(37, 'b', 1)
sage: parse_cremona_label('10bb2')
(10, 'bb', 2)

rebuild( data_tgz, largest_conductor, [decompress=True])

Rebuild the LargeCremonaDatabase from scratch using the data_tgz tarball.

Class: LargeCremonaDatabase

class LargeCremonaDatabase
The Cremona database of elliptic curves.

sage: c = CremonaDatabase()
sage: c.allcurves(11)
{'a1': [[0, -1, 1, -10, -20], 0, 5], 'a3': [[0, -1, 1, 0, 0], 0, 5], 'a2':
[[0, -1, 1, -7820, -263580], 0, 1]}

LargeCremonaDatabase( self, [read_only=True])

Initialize the database.

Input:

read_only
- bool (default: True), if True, then the database is read_only and changes cannot be commited to disk.

Functions: allbsd,$ \,$ allcurves,$ \,$ allgens,$ \,$ conductor_range,$ \,$ curves,$ \,$ degphi,$ \,$ elliptic_curve,$ \,$ elliptic_curve_from_ainvs,$ \,$ isogeny_class,$ \,$ isogeny_classes,$ \,$ iter,$ \,$ iter_optimal,$ \,$ largest_conductor,$ \,$ list,$ \,$ number_of_curves,$ \,$ number_of_isogeny_classes,$ \,$ random,$ \,$ smallest_conductor

allbsd( self, N)

Return the allbsd table for conductor N. The entries are:

            [id, tamagawa_product, Omega_E, L, Reg_E, Sha_an(E)],
where id is the isogeny class (letter) followed by a number, e.g., b3, and L is $ L^r(E,1)/r!$ , where E has rank r.

Input:

N
- int, the conductor
Output: dict

allcurves( self, N)

Returns the allcurves table of curves of conductor N.

Input:

N
- int, the conductor
Output:
dict
- id:[ainvs, rank, tor], ...

allgens( self, N)

Return the allgens table for conductor N.

Input:

N
- int, the conductor
Output:
dict
- id:[points, ...], ...

conductor_range( self)

Return the range of conductors that are covered by the database.

Output:

int
- smallest cond
int
- largest

sage: CremonaDatabase().conductor_range()     # random -- depends on database installed
(1, 9999)

curves( self, N)

Returns the curves table of all *optimal* curves of conductor N.

Input:

N
- int, the conductor
Output:
dict
- id:[ainvs, rank, tor], ...

NOTE: 990H3 is the optimal curve in that class, due to a mistake in Cremona's labeling.

degphi( self, N)

Return the degphi table for conductor N.

Input:

N
- int, the conductor
Output:
dict
- id:degphi, ...

elliptic_curve( self, label)

Return an elliptic curve with given label with some data about it from the database pre-filled in.

Input:

label
- str (Cremona label)
Output: EllipticCurve

elliptic_curve_from_ainvs( self, N, ainvs)

Returns the elliptic curve in the database of conductor N with minimal ainvs, if it exists, or raises a RuntimeError exception otherwise.

Input:

N
- int
ainvs
- list (5-tuple of int's); the minimal Weierstrass model for an elliptic curve of conductor N
Output: EllipticCurve

isogeny_class( self, label)

Returns the isogeny class of elliptic curves that are isogeneous to the curve with given Cremona label. Input:

label
- string
Output:
list
- list of EllpticCurve objects.

isogeny_classes( self, conductor)

Return the allcurves data (ainvariants, rank and torsion) for the elliptic curves in the database of given conductor as a list of lists, one for each isogeny class. The curve with number 1 is always listed first.

iter( self, conductors)

Returns an iterator through all curves with conductor between Nmin and Nmax-1, inclusive, in the database.

Input:

conductors
- list or generator of ints
Output: generator that iterates over EllipticCurve objects.

iter_optimal( self, conductors)

Returns an iterator through all optimal curves with conductor between Nmin and Nmax-1 in the database.

Input:

conductors
- list or generator of ints
Output: generator that iterates over EllipticCurve objects.

largest_conductor( self)

The largest conductor for which the database is complete.

Output:

int
- largest conductor

sage: CremonaDatabase().largest_conductor()   # random -- depends on size of installed database
9999

list( self, conductors)

Returns a list of all optimal curves with conductor between Nmin and Nmax-1, inclusive, in the database. Input:

conductors
- list or generator of ints
Output: list of EllipticCurve objects.

number_of_curves( self, [N=0], [i=0])

Returns the number of curves stored in the database with conductor N. If N = 0, returns the total number of curves in the database.

If i is nonzero, returns the number of curves in the i-th isogeny class. If i is a Cremona letter code, e.g., 'a' or 'bc', it is converted to the corresponding number.

Input:

N
- int
i
- int or str
Output: int

sage: c = CremonaDatabase()
sage: c.number_of_curves(11)
3
sage: c.number_of_curves(37)
4
sage: c.number_of_curves(990)
42

number_of_isogeny_classes( self, [N=0])

Returns the number of isogeny classes of curves in the database of conductor N. If N is 0, return the total number of curves in the database.

Input:

N
- int
Output: int

sage: c = CremonaDatabase()
sage: c.number_of_isogeny_classes(11)
1
sage: c.number_of_isogeny_classes(37)
2

random( self)

Returns a random curve from the database.

sage: CremonaDatabase().random() # random -- depends on database installed
Elliptic Curve defined by y^2 + x*y  = x^3 - x^2 - 224*x + 3072 over
Rational Field

smallest_conductor( self)

The smallest conductor for which the database is complete. (Always 1.)

Output:

int
- smallest conductor

sage: CremonaDatabase().smallest_conductor()
1

Special Functions: __getitem__,$ \,$ __init__,$ \,$ __iter__,$ \,$ __repr__,$ \,$ _init_allbsd,$ \,$ _init_allcurves,$ \,$ _init_allgens,$ \,$ _init_degphi,$ \,$ _init_from_ftpdata

__getitem__( self, N)

If N is an integer, return all data about level N in the database. If N is a string it must be a Cremona label, in which case return the corresponding elliptic curve, if it is in the database.

Input:

N
- int or str
Output: dict (if N is an int) or EllipticCurve (if N is a str)

__iter__( self)

Returns an iterator through all EllipticCurve objects in the Cremona database.

__repr__( self)

String representation of this database. Output: str

_init_allbsd( self, ftpdata, [largest_conductor=0])

Initialize the allbsd table by reading the corresponding ftpdata files and importing them into the database.

_init_allcurves( self, ftpdata, [largest_conductor=0])

Initialize the allcurves table by reading the corresponding ftpdata files and importing them into the database.

Input:

largest_conductor
- int (default: 0), if > 0, then only include data up to that conductor.
Output:
int
- number_of_curves
int
- number_of_isogeny_classes

_init_allgens( self, ftpdata, [largest_conductor=0])

Initialize the allgens table by reading the corresponding ftpdata files and importing them into the database.

_init_degphi( self, ftpdata, [largest_conductor=0])

Initialize the degphi table by reading the corresponding ftpdata files and importing them into the database.

_init_from_ftpdata( self, ftpdata, [largest_conductor=0])

Create the ZODB Cremona Database from the Cremona data directory, which is available from Cremona's website. I.e., just wget Cremona's database to a local directory.

NOTE: For data up to level 130000, this function takes about 30 minutes on a 1.8Ghz Opteron laptop. The resulting database occupies 36MB disk space. Creating the database uses a LOT of memory. Use a machine with at *least* 2GB RAM.

To recreate the large database from the files in the current directory, do the following:

sage: d = sage.databases.cremona.LargeCremonaDatabase(read_only=False)   # not tested
sage: d._init_from_ftpdata('.')                                 # not tested

Class: MiniCremonaDatabase

class MiniCremonaDatabase
A mini version of the Cremona database that contains only the Weierstrass equations, rank and torsion of elliptic curves of conductor up to 10000 and nothing else.
MiniCremonaDatabase( self, [read_only=True])

Initialize the database.

Input:

read_only
- bool (default: True), if True, then the database is read_only and changes cannot be commited to disk.

Special Functions: __init__,$ \,$ __repr__,$ \,$ _init

See About this document... for information on suggesting changes.