4.2 GAP

Sage comes with GAP 4.4.10 for computational discrete mathematics, especially group theory.

Here's an example of GAP's IdGroup function, which uses the optional small groups database that has to be installed separately, as explained below.

sage: G = gap('Group((1,2,3)(4,5), (3,4))')
sage: G
Group( [ (1,2,3)(4,5), (3,4) ] )
sage: G.Center()
Group( () )
sage: G.IdGroup()    # requires optional database_gap package
[ 120, 34 ]
sage: G.Order()
120

We can do the same computation in Sage without explicitly invoking the GAP interface as follows:

sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
sage: G.center()
Permutation Group with generators [()]
sage: G.group_id()     # requires optional database_gap package
[120, 34]
sage: n = G.order(); n
120

Note: For some GAP functionality, you should install two optional Sage packages. Type sage -optional for a list and choose the one that looks like gap_packages-x.y.z, then type sage -i gap_packages-x.y.z. Do the same for database_gap-x.y.z. Some non-GPL'd GAP packages may be installed by downloading them from the GAP web site [GAPkg], and unpacking them in SAGE_ROOT/local/lib/gap-4.4.10/pkg.

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