Appendix a Packages for Number Theory
Total Page:16
File Type:pdf, Size:1020Kb
Appendix A Packages for Number Theory There exist several computer packages which can profitably be used for number-theoretic computations. In this appendix, I will briefly describe the advantages and disadvantages of some of these systems. The oldest general-purpose symbolic algebra packages were written pri marily for physicists, and are not well suited for number theory. Furthermore (even for what they were designed for) they are very slow. On the other hand, they have been extensively tested, are have probably less bugs than more re cent systems. The two main systems in this category are Macsyma and Reduce. Reduce was extended by G. Collins to handle more efficiently computations linked to polynomials, and this gave rise to Sac-II, with a user interface called AIdes. These were the packages used in the 1970's. A second generation of packages was developed in the 1980's. They are much faster, better adapted to number theory, but having had less use, have more bugs. The two main commercial systems are Mathematica, by Wolfram Research, Inc., and Maple, by the University of Waterloo, Canada. Mathematica has a very nice user interface, and its plotting capabilities, for example on the Macintosh, are su perb. Maple is faster and often simpler to use, and has my preference. A third system is widely available, although not commercially released, the Scratch pad II system developed by IBM. This is a monster (in the same sense that ADA is a monster as a programming language). A subset of this system has recently been commercially released under the name Axiom. It certainly has the most potential for developing powerful applications, but I do not believe that there is the need for such power (which is usually obtained at the expense of speed) for everyday (number-theoretic) problems. Some other packages were specially designed for small machines like Per sonal Computers (PC's). One of these is Derive, which is issued from JL-Math, and requires only half a megabyte of main memory. Derive even runs on some pocket computers! Another system, the Calculus Calculator (CC), is a symbolic manipulator with three-dimensional graphics and matrix operations which also runs on PC's. A third system, Numbers, is a shareware calcula tor for number theory that runs on PC's. It is designed to compute number theoretic functions for positive integers up to 150 decimal digits (modular arithmetic, primality testing, continued and Farey fractions, Fibonacci and Lucas numbers, encryption and decryption). In addition to commercial packages, free software systems (which are not complete symbolic packages) also exist. One is Ubasic, written by Y. Kida, A Packages for Number Theory 499 which is a math-oriented high-precision Basic for PC's (see the review in the Notices of the AMS of March 1991). Its extensions to Basic allow it to handle integers and reals of several thousand digits, as well as fractions, complex numbers and polynomials in one variable. Many number-theoretic functions are included in Ubasic, including the factoring algorithm MPQS. Since the package is written in assembly language, Ubasic is very fast. Another package, closer to a symbolic package, is Pari, written by the au thor and collaborators (see the review in the Notices of the AMS of October 1991). This package can be used on Unix workstations, Macintosh, Amiga, PC's, etc. Its kernel is also written in assembler, so it is also very fast. Fur thermore, it has been specially tailored for number-theoretic computations. In addition, it provides tools which are rarely or never found in other symbolic packages such as the direct handling of concrete mathematical objects, for example p-adic numbers, algebraic numbers and finite fields, etc ... It also gives mathematically more correct results than many packages on fundamen tal operations (e.g. subtraction of two real numbers which are approximately equal). Source is included in the package so it is easy to correct, improve and expand. Essentially all of the algorithms described in the present book have been implemented in Pari, so I advise the reader to obtain a copy of it. Apart from those general computer algebra systems, some special-purpose systems exist: Cayley/Magma, GAP, Kant. The Cayley system is designed to support fast computations in algebra (groups, modules, rings, polynomial rings over various kinds of coefficient domains), number theory and finite geometry. It includes general machinery for classical number theory (for example the ECM program of A.K. Lenstra), finite fields and cyclotomic fields. The next release will include a MPQS factoring algorithm, a Jacobi sum-type primality test, facilities for computing in a general algebraic number field, and a general purpose elliptic curve calculator. According to the developers, Cayley V 4 will include "just about all of the algorithms of this book". It will be released under the name Magma. GAP (Groups, Algorithms and Programming) is specially designed for computations in group theory. It includes some facilities for doing elementary number theory, in particular to calculate with arbitrary length integers and rational numbers, cyclotomic fields and their subfields, and finite fields. It has functions for integer factorization (based on elliptic curves), for primality testing, and for some elementary functions from number theory and combinatorics. Its programming language is Maple-like. Kant (Komputational Algebraic Number Theory) is a subroutine package for algorithms from the geometry of numbers and algebraic number theory, which will be included in Magma. In addition to specific packages, handling of multi-precision numbers or more general types can be easily achieved with several languages, Lisp, C and C++. For Lisp, the INRIA implementation LeLisp (which is not public domain) contains a package written in assembler to handle large numbers, and hence is very fast. The GNU Calc system is an advanced desk calculator 500 A Packages for Number Theory for GNU Emacs, written in Emacs Lisp. An excellent public domain C++ compiler can be obtained from the Free Software Foundation, and its library allows to use multi-precision numbers or other types. The library is however written in C++ hence is slow, so it is strongly advised to write a library in assembler for number-theoretic uses. Another multi-precision system written in C is the desk calculator (Calc) of Hans-J. Boehm for Unix workstations. Its particularity is to handle "constructive" real numbers, that is to remember the best known approximation to a number already computed. For PC's, Timothy C. Frenz has developed an "infinite" precision calculator, also named Calc. Finally, a few free packages exist which have been specifically written for handling multi-precision integers as part of a C library in an efficient way. In addition to Pari mentioned above, there is the Bignum package of DEC PRL (which is essentially the package used in LeLisp as mentioned above) which can be obtained by sending an e-mail messagetolibrarian(gdecprl.dec.com. and the GNU multi-precision package Gmp which can be obtained byanony mous ftp from prep. ai . mi t . edu, the standard place where one can ftp all the GNU software. Conclusions. My personal advice (which is certainly not objective) is the following. If you are on an IBM-PC 286, you do not have much choice. Obtain Ubasic, Derive or the Calculus Calculator. On an IBM-PC 386 or more, Maple, Sym bolics Macsyma, Mathcad (see Maple below) and Pari are also available. If you are on a MacH or on a Unix workstation then, if you really need all the power of a symbolic package, buy either Maple or Mathematica, my preference going to Maple. If you want a system that is already specialized for number theoretic computations, then buy Cayley. In any case, as a complement to this package, obtain Pari. Where to obtain these packages. You can order Maple at the following address: Waterloo Maple Software, 160 Columbia St. W., Waterloo, Ontario, Canada N2L 3L3, phone (519) 747- 2373, fax (519) 747-5284, e-mail wmsi(gdaisy.waterloo.edu. Maple has been ported to many different machines and it is highly probable that it has been ported to the machine that you want. There is also a system named Mathcad that uses some parts of Maple for its symbolic manipulations; Mathcad runs under Microsoft Windows and is published by MathSoft Inc., 201 Broadway, Cambridge, Massachussets, USA, 02139 Phone: (617) 577-1017. You can order Mathematica from Wolfram Research, Inc. at the following address: Wolfram Research, 100 Trade Center Drive, Champaign, IL 61820, phone 800-441-Math, fax 217-398-0747, e-mail info(gwri. com. Mathematica has also been ported to quite a number of machines, and in addition you can use a friendly "front-end" like the Macintosh H linked to a more powerful computer (including supercomputers) which will do the actual computations. A Packages for Number Theory 501 Macsyma exists in two flavors: the commercial versions (Symbolics Mac syma, ALJABR, ParaMacs) are licensed from MIT, the non-commercial ver sions (Vaxima, Maxima, and DOE-Macsyma) officially come from the Amer ican Department of Energy (DOE). All these versions are derived from the Macsyma developed by the Mathlab Group at MIT. The Symbolics version runs on PC 386, Symbolics computers, VMS machines and most Unix work stations; the address to order it is: Symbolics MACSYMA Division, Symbol ics, Inc., 8 New England Executive Park East, Burlington, MA 01803, phone (617) 221-1250 or 1-800-MACSYMA (free from the U.S.), fax (617) 221-1099, e-mail macsyma-service~symbolics.com. Vaxima is available from the En ergy Science and Technology Software Center (ESTSC), P.O. Box 1020, Oak Ridge, Tennessee 37831, phone (615) 576-2606.