1 An Introduction to Open-Source Mathematics Software (Specifically: GAP,, Macaulay2 and Sage) Jason B. Hill Slow Pitch Colloquium University of Colorado March 17, 2010
2 Outline 1 Introduction 2 GAP - Groups, Algorithms, Programming 3 4 Macaulay2 5 Sage
3 Introduction Why use these programs?
3 Introduction Why use these programs? When you think of mathematics software, something like Mathematica, Wolfram Alpha or Maple may come to mind.
Introduction 3 Why use these programs? When you think of mathematics software, something like Mathematica, Wolfram Alpha or Maple may come to mind. These all have a rich GUI = Graphical User Interface.
Introduction 3 Why use these programs? When you think of mathematics software, something like Mathematica, Wolfram Alpha or Maple may come to mind. These all have a rich GUI = Graphical User Interface. They can also perform some amazing calculations.
Introduction 3 Why use these programs? When you think of mathematics software, something like Mathematica, Wolfram Alpha or Maple may come to mind. These all have a rich GUI = Graphical User Interface. They can also perform some amazing calculations. Unfortunately, they are too often exploited for trivial calculations.
Introduction Why use these programs?
Introduction Why use these programs? The programs presented here differ slightly.
Introduction Why use these programs? The programs presented here differ slightly. All of them are free.
Introduction Why use these programs? The programs presented here differ slightly. All of them are free. All of them are open-source.
Introduction Why use these programs? The programs presented here differ slightly. All of them are free. All of them are open-source. They are developed and maintained by professional mathematicians, people who need to do serious (nontrivial) calculations.
Introduction Why use these programs? The programs presented here differ slightly. All of them are free. All of them are open-source. They are developed and maintained by professional mathematicians, people who need to do serious (nontrivial) calculations. All of the programs presented here are algebraic programs. There are also statistical, numerical,... programs that fall under the free/open-source category. I m just not familiar with them.
5 Introduction Terminal based versus GUI
5 Introduction Terminal based versus GUI All of the programs shown in this talk are terminal native.
Introduction 5 Terminal based versus GUI All of the programs shown in this talk are terminal native. Most of them have some sort of GUI that can be added.
Introduction 5 Terminal based versus GUI All of the programs shown in this talk are terminal native. Most of them have some sort of GUI that can be added. For example, Sage Notebook has become a standard Sage interface.
Introduction 5 Terminal based versus GUI All of the programs shown in this talk are terminal native. Most of them have some sort of GUI that can be added. For example, Sage Notebook has become a standard Sage interface. For serious computation, the terminal is faster.
6 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
6 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming Purpose Mostly: Group Theory Developers University of St. Andrews, RWTH Aachen, Technische Universität Braunschweig, Colorado State University Stable Release 4.4.12 December 2008 Structure Written in C Internally like Python Download http://www.gap-system.org/ or repositories OS Source + Linux, OS-X, Windows, BSD, Solaris
7 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP is installed on euclid.
7 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP is installed on euclid. There are two ways to access euclid:
7 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP is installed on euclid. There are two ways to access euclid: From one of the Math Dept office desktops, open a terminal.
GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP is installed on euclid. There are two ways to access euclid: From one of the Math Dept office desktops, open a terminal. Open a terminal anywhere online and SSH to euclid.
GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP is installed on euclid. There are two ways to access euclid: From one of the Math Dept office desktops, open a terminal. Open a terminal anywhere online and SSH to euclid. Once on euclid (or any Math Dept desktop) the prompt looks like: euclid: >
GAP - Groups, Algorithms, Programming 7 GAP Groups, Algorithms, Programming GAP is installed on euclid. There are two ways to access euclid: From one of the Math Dept office desktops, open a terminal. Open a terminal anywhere online and SSH to euclid. Once on euclid (or any Math Dept desktop) the prompt looks like: euclid: > Type gap.sh to start GAP euclid: >gap.sh
GAP - Groups, Algorithms, Programming 7 GAP Groups, Algorithms, Programming GAP is installed on euclid. There are two ways to access euclid: From one of the Math Dept office desktops, open a terminal. Open a terminal anywhere online and SSH to euclid. Once on euclid (or any Math Dept desktop) the prompt looks like: euclid: > Type gap.sh to start GAP euclid: >gap.sh Note: Installing GAP on another computer may change this: hilljb@tarski: $ gap
8 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
9 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon.
9 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2;
9 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2; 65*3;
9 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2; 65*3; GAP commands are case-sensitive.
9 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2; 65*3; GAP commands are case-sensitive. Factorial(72);
9 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2; 65*3; GAP commands are case-sensitive. Factorial(72); IsPrime(8366279922555288399586668829959967236637);
GAP - Groups, Algorithms, Programming 9 GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2; 65*3; GAP commands are case-sensitive. Factorial(72); IsPrime(8366279922555288399586668829959967236637); It is useful to know how to stop GAP once started. gap> quit;
GAP - Groups, Algorithms, Programming 9 GAP Groups, Algorithms, Programming All (or most) GAP commands end in a semi-colon. 2+2; 65*3; GAP commands are case-sensitive. Factorial(72); IsPrime(8366279922555288399586668829959967236637); It is useful to know how to stop GAP once started. gap> quit; Often, your input doesn t match a function s defintion. Type Ctrl+D when this happens.
10 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
11 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
12 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
13 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
14 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
15 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP has several ways to construct groups.
GAP - Groups, Algorithms, Programming 15 GAP Groups, Algorithms, Programming GAP has several ways to construct groups. Many groups it is already familiar with: gap> G:=SymmetricGroup(8); Sym( [ 1.. 8 ] ) gap> G; Sym( [ 1.. 8 ] )
GAP - Groups, Algorithms, Programming 15 GAP Groups, Algorithms, Programming GAP has several ways to construct groups. Many groups it is already familiar with: gap> G:=SymmetricGroup(8); Sym( [ 1.. 8 ] ) gap> G; Sym( [ 1.. 8 ] ) Or you can specify your own: gap> H:=Group([(1,2),(1,2,3,4,5,6,7,8)]); Group([ (1,2), (1,2,3,4,5,6,7,8) ])
16 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming In short, GAP can represent the same group in several ways.
GAP - Groups, Algorithms, Programming 16 GAP Groups, Algorithms, Programming In short, GAP can represent the same group in several ways. gap> F1 := FreeGroup( "a", "b" ); <free group on the generators [ a, b ]>
GAP - Groups, Algorithms, Programming 16 GAP Groups, Algorithms, Programming In short, GAP can represent the same group in several ways. gap> F1 := FreeGroup( "a", "b" ); <free group on the generators [ a, b ]> gap> A5 := F1 / [ F1.1 2, F1.2 3, (F1.1*F1.2) 5 ]; <fp group on the generators [ a, b ]>
GAP - Groups, Algorithms, Programming 16 GAP Groups, Algorithms, Programming In short, GAP can represent the same group in several ways. gap> F1 := FreeGroup( "a", "b" ); <free group on the generators [ a, b ]> gap> A5 := F1 / [ F1.1 2, F1.2 3, (F1.1*F1.2) 5 ]; <fp group on the generators [ a, b ]> gap> G := AlternatingGroup(5); Alt( [ 1.. 5 ] )
GAP - Groups, Algorithms, Programming 16 GAP Groups, Algorithms, Programming In short, GAP can represent the same group in several ways. gap> F1 := FreeGroup( "a", "b" ); <free group on the generators [ a, b ]> gap> A5 := F1 / [ F1.1 2, F1.2 3, (F1.1*F1.2) 5 ]; <fp group on the generators [ a, b ]> gap> G := AlternatingGroup(5); Alt( [ 1.. 5 ] ) gap> IsomorphismGroups( A5, G ); [ a*b 2 *a*b 3 *a*b, b ] -> [ (2,4)(3,5), (1,2,3) ] gap>
GAP - Groups, Algorithms, Programming 17 GAP Groups, Algorithms, Programming GAP documentation is given by searching within GAP: If you want to find out how to compute an orbit, type?orbit
18 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
19 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming Then, typing?1 gives...
20 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
21 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming GAP works well for large groups. Consider the permutation group on faces of a Rubik s cube.
22 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
23 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
24 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming Some other calculations we may be interested in...
25 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
26 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
27 GAP - Groups, Algorithms, Programming GAP Groups, Algorithms, Programming
28
28 Purpose Mostly: Number Theory & Elliptic Curves Developers Université Bordeaux Stable Release 2.3.5 February 2010 Structure PARI is a C library gp is a terminal calculator Download http://pari.math.u-bordeaux.fr/ OS Source + Linux, OS-X, Windows, BSD, Solaris
29
29 PARI is a C library with an emphasis on efficiency
29 PARI is a C library with an emphasis on efficiency It does no calculations itself.
29 PARI is a C library with an emphasis on efficiency It does no calculations itself. But the libraries/functions it contains are amazing.
29 PARI is a C library with an emphasis on efficiency It does no calculations itself. But the libraries/functions it contains are amazing. GP is a terminal calculator based on PARI
29 PARI is a C library with an emphasis on efficiency It does no calculations itself. But the libraries/functions it contains are amazing. GP is a terminal calculator based on PARI Less efficient than compiling with PARI, still very efficient
29 PARI is a C library with an emphasis on efficiency It does no calculations itself. But the libraries/functions it contains are amazing. GP is a terminal calculator based on PARI Less efficient than compiling with PARI, still very efficient A little awkward. The output is less user friendly.
29 PARI is a C library with an emphasis on efficiency It does no calculations itself. But the libraries/functions it contains are amazing. GP is a terminal calculator based on PARI Less efficient than compiling with PARI, still very efficient A little awkward. The output is less user friendly. The entire system is rigorously typed.
29 PARI is a C library with an emphasis on efficiency It does no calculations itself. But the libraries/functions it contains are amazing. GP is a terminal calculator based on PARI Less efficient than compiling with PARI, still very efficient A little awkward. The output is less user friendly. The entire system is rigorously typed. Light programming is possible in GP, for anything else use C/PARI
30
31 To start the GP calculator on euclid, euclid: >gp To exit the GP calculator on euclid,? quit
32
33
34 The documentation in GP is built-in and in PDF form:
34 The documentation in GP is built-in and in PDF form: Type? for the help dialog
34 The documentation in GP is built-in and in PDF form: Type? for the help dialog Type?function for information about function
34 The documentation in GP is built-in and in PDF form: Type? for the help dialog Type?function for information about function In my experience, PARI is better documented externally.
35
36 Some algebraic number theory calculations in GP:
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials.
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials. Check if that polynomial is reducible.
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials. Check if that polynomial is reducible. Initialize a number field using the roots of a polynomial.
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials. Check if that polynomial is reducible. Initialize a number field using the roots of a polynomial. Find the discriminant
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials. Check if that polynomial is reducible. Initialize a number field using the roots of a polynomial. Find the discriminant... or an integral basis
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials. Check if that polynomial is reducible. Initialize a number field using the roots of a polynomial. Find the discriminant... or an integral basis... or the regulator
36 Some algebraic number theory calculations in GP: Create a polynomial / find characteristic polynomials. Check if that polynomial is reducible. Initialize a number field using the roots of a polynomial. Find the discriminant... or an integral basis... or the regulator... or a generating set for the unit group of the integer ring.
37
38
39
40
41
Other calculations in GP:
Other calculations in GP: Elliptic Curves Sum points on a curve Compute L-function coefficients. Find Z-basis for free parts of Mordell-Weil groups. Compute heights
Other calculations in GP: Elliptic Curves Sum points on a curve Compute L-function coefficients. Find Z-basis for free parts of Mordell-Weil groups. Compute heights Matrix calculations Solving large systems of equations. Various calculations
43
Macaulay2 Macaulay2
Macaulay2 Macaulay2 Purpose Mostly: Commutative Algebra & Algebraic Geometry Developers Daniel Grayson Michael Stillman David Eisenbud Stable Release 1.3.1 November 2009 Structure Good question Download http://www.math.uiuc.edu/macaulay2 OS Source + Linux, BSD, OS-X, Windows
45 Macaulay2 Macaulay2 Macaulay2 is not on euclid.
Macaulay2 45 Macaulay2 Macaulay2 is not on euclid. But, it is free and you can download it if you need it.
Macaulay2 45 Macaulay2 Macaulay2 is not on euclid. But, it is free and you can download it if you need it. The notation is slightly odd, but the documentation on the Macaulay2 website does a pretty good job of showing examples.
Macaulay2 45 Macaulay2 Macaulay2 is not on euclid. But, it is free and you can download it if you need it. The notation is slightly odd, but the documentation on the Macaulay2 website does a pretty good job of showing examples. Macaulay2 is considered a more specific piece of software, dealing with: finite fields, polynomial rings, graded/multigraded polynomial rings, quotient rings, factorization, exterior algebras, symmetric algebras, tensor products, associative algebras, etc.
46 Macaulay2 Macaulay2
Macaulay2 Macaulay2 We could...
Macaulay2 Macaulay2 We could... Generate random homogeneous elements of our polynomial ring...
Macaulay2 47 Macaulay2 We could... Generate random homogeneous elements of our polynomial ring... Form a basis of the subspace of ring elements of a given degree..
Macaulay2 47 Macaulay2 We could... Generate random homogeneous elements of our polynomial ring... Form a basis of the subspace of ring elements of a given degree.. Construct a polynomial ring over our polynomial ring...
Macaulay2 47 Macaulay2 We could... Generate random homogeneous elements of our polynomial ring... Form a basis of the subspace of ring elements of a given degree.. Construct a polynomial ring over our polynomial ring... Examine ideals and factorization...
48 Macaulay2 Macaulay2
49 Macaulay2 Macaulay2
50 Macaulay2 Macaulay2
51 Macaulay2 Macaulay2
52 Sage Sage
52 Sage Sage Purpose Algebra, Combinatorics, Numerical, Calculus Developers William Stein + others Stable Release 4.3.1 January 2010 Structure Written in Python Interface varies Download http://www.sagemath.org OS Source + Linux, OS-X, Solaris, LiveCD
53 Sage Sage Sage is largely a combination of other open-source packages.
Sage 53 Sage Sage is largely a combination of other open-source packages. Sage includes most of PARI and GAP, for instance.
Sage 53 Sage Sage is largely a combination of other open-source packages. Sage includes most of PARI and GAP, for instance. Sage will also interface with non-open-source software: Mathematica, Magma, Maple.
Sage 53 Sage Sage is largely a combination of other open-source packages. Sage includes most of PARI and GAP, for instance. Sage will also interface with non-open-source software: Mathematica, Magma, Maple. As a result, it is capable of A LOT.
54 Sage Sage
Sage 55 Sage Sage is installed on euclid. Initialize Sage with the command: euclid: >sage Exit Sage with the command: sage: quit
56 Sage Sage
57 Sage Sage Sage can do group theory
58 Sage Sage
59 Sage Sage Sage can do calculus
60 Sage Sage
61 Sage Sage Sage can do more advanced mathematics
62 Sage Sage
Sage 63 Sage Sage notebook is a web-based GUI for Sage. http://www.sagenb.org
64 Sage Sage
Sage 65 The End