This directory contains source code for the following programs.

mwrank tmrank ratpoint findinf tate conductor torsion twist allisog tconic

Notes on configuring, installing and running the programs:

1. Configure  (Thanks to Thomas Papanikolaou and William Stein)

Run ./configure first to create a Makefile suitable for your system.
See the file USING for details of how to recreate configure.  You will
need to make a choice of whether or not to use LiDIA (see below), or
NTL; you will have to give the full pathname of the directory where
the LiDIA or NTL include files and library are situated:  e.g. on my
system I must use one of

    ./configure --with-ntl_all=/usr/local/NTL
    ./configure --with-ntl_int=/usr/local/NTL
    ./configure --with-lidia_all=/usr/local/LiDIA
    ./configure --with-lidia_int=/usr/local/LiDIA

See ./configure --help for further configure options.

(0) If neither LiDIA nor LiDIA_INTS not NTL_INTS is defined the
programs used to use the libg++ "Integer" class for multiprecision
integer arithmetic, and did not use any multiprecision floating point.
This stopped working with version 2.8 of gcc (approx).

(1) lidia_int: use LiDIA for multiprecision integer arithmetic;  no
    multiprecision floating point.

(2) lidia_all: also use LiDIA for multiprecision floating point
    arithmetic (with a precision which can be set at run time).
 
(3) ntl_int: use NTL for multiprecision integer arithmetic; no
    multiprecision floating point.

(2) ntl_all: also use NTL for multiprecision floating point arithmetic
    (with a precision which can be set at run time).
 
Note the following:

(1) Integer arithmetic is slower with LiDIA than with NTL, even though
they are both based on gmp (by default).  (2) With NTL, integer
factorization will be done very crudely (trial division only) unless
gp is present (see below). (3) The isogeny program "allisog" is
unreliable if not compiled with multiprecision floating point.
Similarly for curves where second descent is used, since the quartic
reduction routines work better with greater precision.  Otherwise,
using multiprecision floating point slows the programs --
unfortunately the code is not at present designed to use it only in
places where it really helps.

For most use of mwrank with curves with small coefficients, the
options LiDIA_INTS or NTL_INTS are best.  But for "large" curves use a
version with multiprecision floating point.

If using NTL you can aid the factorization of large integers in
several ways:

(1) If you have gp installed it will be used for integer factorization
    if it is in /usr/local/bin/gp or in $PATH_TO_GPgp.  Otherwise
    trial division will be used...

(2) By default the programs initialise an array of primes < 10^6, so
    will fail to factor some numbers > 10^12.  This default can be
    increased as follows: create a file called MAXPRIME containing a
    single integer, such as 2000000 or 10000000.  Then this will be
    used instead of the default.

(3) If a file called PRIMES exists in the current directory,
    containing one or more prime numbers (separated by whitespace,
    e.g. one per line), terminated by "0", then the programs read this
    in at the start and use these for trial division as well as the
    main prime array.  No check is made that these numbers are prime.
    This is an advantage if you make several runs with the same curve
    which has a discriminant which is hard to factor, since you can
    avoid doing the hard work more than once.

2. Making the programs

"make progs" will compile all of these: 
	mwrank ratpoint findinf tate
	conductor torsion twist allisog tconic

"make ranktest" will compile a special version of mwrank (called
tmrank) for testing and run it using the file tmrank.in as input.  If
no error messages are reported then mwrank has successfully computed
the rank of about 740 curves, including all those of conductor < 400
and a selection of higher rank examples (which come first).  There's
no need to wait for this to finish if it seems to be running OK; the
complete run should take less than 5 minutes (mwrank version as of May
2000).  Update: July 2005: 33 seconds on a 2004-vintage Pentium IV.

3. Program notes:

A. Elliptic curves over Q: miscellaneous

	tate: Tate's algorithm for conductor, reduction types etc
	conductor: as tate but briefer one-line output
	torsion: torsion points
	twist: finding twists of a curve
	allisog: finding all curves isogenous to a given one
	findinf: searches for points on a curve up to an input bound on
		the naive logarithmic height.

Input format for curves is one of
a1 a2 a3 a4 a6
[a1,a2,a3,a4,a6]
{c4,c6}

Programs tate, conductor, torsion, allisog have a batch input mode for
processing large numbers of curves: enter filename (which contains
curves in one of these formats); or enter tty for interactive entering
of curves.  In either case entering a null curve [0,0,0,0,0] terminates.

Most programs have a verbose option switch, 0 for quiet (best for
batch), 1 for more output.  allisog also has a level 2 mainly for debugging.

NOTE allisog needs more precision to work properly than standard C
double precision: it is recommended to only use the version of this
compiled with lidia_all or ntl_all.  All other programs run much
faster with ntl_int or lidia_int.

B. Elliptic curves over Q: 2-descent

See the mwrank.doc file for details.

The test program tmrank is special: it requires an input file in which
each curve is followed by its known actual rank.  The file tmrank.in
is suitable here.  If tmrank < tmrank.in (or make ranktest) runs with
no errors things are looking good.

C. Solving conics: the program tconic finds rational points on conics,
or determines that there are none.  It prompts for integers a b c d
and solves a*^2 +b*x*z+c*z^2=d*y^2 for (x,y,z) not (0,0,0) and returns
1 or returns 0 if not possible.  Should be nonsingular (a, c, d,
b^2-4*a*c non-zero).  This is really just a test program for
conic.h/cc, which is used in the second descent part of mwrank.

