6

I was looking for free alternatives to Magma to perform number theory computations, such as modular, factorization, etc. and I've found GAP and Pari.

What's the difference between them? Any other advise instead?

regards

New: Sage has a lot of features but it has two drawbacks: It's made with many different applications, great applications but independent, with few features, not properly merged on a single one. Each application has its commands, format...

And it's OK for Linux users but for Windows users has to be run virtualized, much slower.

I've found that the difference is that SAGE is better for abstract algebra problems and PARI for big number arithmetic.

skan
  • 391
  • 2
    I've grown fond of SAGE (www.sagemath.org). It's open source, free and has a lot easier syntax than many of the other math programs. – Fredrik Meyer Dec 17 '12 at 21:17
  • I'd also recommend sage... especially since it incorporates both GAP and Pari. – Shaun Ault Dec 17 '12 at 21:26
  • I personally prefere GAP. It has large libraries for group theory. But for number theory, SAGE might be your friend. – sebigu Dec 17 '12 at 22:08
  • 2
    Maybe a bit out of topic here, but GAP actually has an interface to PARI/GP in the Alnuth package – Olexandr Konovalov Apr 22 '13 at 15:42
  • 1
    Pari vs Gap: Pari is much faster for computationally hard number theory, but it is relatively easy to misuse (most pari objects are literally lists of numbers; in GAP objects are lists of numbers wrapped up in sugary coating so that you don't send the wrong kind of list of numbers to a function). – Jack Schmidt Apr 23 '13 at 01:47
  • Just a note that SageMath now has a native binary installer for Windows. – J W Oct 09 '20 at 12:12

2 Answers2

3

GAP has certain number-theoretical functionality, see in particular manual chapters Integers, Number Theory, Finite Fields, Abelian Number Fields.

Besides the functionality implemented in the core system, GAP has also two packages:

  • FactInt, providing more advanced methods for factoring integers

  • Alnuth, providing various methods to compute with number fields which are given by a defining polynomial or by generators. Some of the methods are written in GAP code, while some use PARI/GP via an interface, which is also a part of the package. The main methods included in Alnuth are: creating a number field, computing its maximal order (using PARI/GP), computing its unit group (using PARI/GP) and a presentation of this unit group, computing the elements of a given norm of the number field (using PARI/GP), determining a presentation for a finitely generated multiplicative subgroup (using PARI/GP), and factoring polynomials defined over number fields (using PARI/GP).

Since GAP 4.5, integer arithmetic in GAP became faster due to the GMP library, but PARI/GP still will be faster for hard computational problems. On the other hand, GAP may offer you a robust programming environment and access to other areas of mathematics covered by GAP. Thus, the final choice would depend on particular problems you want to deal with...

Olexandr Konovalov
  • 7,002
  • 2
  • 34
  • 72
1

Pari is the fastest exact "extended precession" system. If you compile and tune your multithreaded version. Actually single thread pari is faster than (16) multithread Mathematica. Multithreaded pari version on ryzen 7 (8cores/16 threads) is 7x faster. If you are doing huge calculation Pari is defenitly the system to use.

kh.
  • 11