GAP (computer algebra system): Difference between revisions

Content deleted Content added
External links: medit text editor, originally a component of GGAP -___-_ GGAP - Front end for GAP
 
(26 intermediate revisions by 15 users not shown)
Line 1:
{{About|a software package|other uses|Gap (disambiguation)}}
{{use dmy dates|date=December 2022}}
{{infobox software
| name = GAP
Line 14 ⟶ 15:
* [[University of Kaiserslautern|TU Kaiserslautern]]
}}
| released = 1988
| latest_release_version = 4.11.0
| latest release version = {{wikidata|property|reference|P348}}
| latest_release_date = {{start date and age|2020|03|06||df=yes}}<ref name=gap-ver>{{cite web|title=GAP 4.11.0|url=https://www.gap-system.org/Releases/4.11.0.html|website=www.gap-system.org|accessdate=18 April 2020}}</ref>
| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}
| programming language = [[C (programming language)|C]]
| operating_system = [[Cross-platform]]
Line 21 ⟶ 23:
| license = [[GNU General Public License]]
| website = {{URL|https://www.gap-system.org/}}
| logo = GAP computer algebra system icon.png
}}
 
'''GAP''' ([[Group (mathematics)|Groups]], [[Algorithm]]s and [[Computer programming|Programming]]) is aan [[open source]] [[computer algebra system]] for computational [[Discrete mathematics#AlgebraAlgebraic structures|discrete algebra]] with particular emphasis on [[computational group theory]].
 
==History==
GAP was developed at Lehrstuhl D für Mathematik (LDFM), [[RWTH Aachen University|Rheinisch-Westfälische Technische Hochschule Aachen]], [[Germany]] from [[1986]] to [[1997]]. After the retirement of [[Joachim Neubüser]] from the chair of LDFM, the development and maintenance of GAP was coordinated by the School of Mathematical and Computational Sciences at the [[University of St Andrews]], [[Scotland]].<ref>{{cite web|url=https://www.gap-system.org/Doc/History/history.html|title=Some history of GAP|website=Official GAP website|access-date=September 27, 2019}}</ref> In the summer of 2005 coordination was transferred to an equal partnership of four 'GAP Centres', located at the [[University of St Andrews]], RWTH Aachen, [[Braunschweig University of Technology|Technische Universität Braunschweig]], and [[Colorado State University]] at [[Fort Collins, Colorado|Fort Collins]]; in April 2020, a fifth GAP Centre located at the [[University of Kaiserslautern|TU Kaiserslautern]] was added .<ref>{{cite web|url=https://www.gap-system.org/Contacts/centres.html|title=GAP Centres|website=Official GAP website|access-date=April 18, 2020}}</ref>
 
==Features==
GAP contains a [[Procedural programming|procedural programming language]] and a large collection of functions to create and manipulate various mathematical objects. It supports integers and rational numbers of arbitrary size, memory permitting. [[Finite group|Finite groups]] can be defined as [[Permutation group|groups of permutations]] and it is also possible to define [[Finitely-presented group|finitely presented groups]] by specifying generators and relations. Several databases of important finite groups are included. GAP also allows to work with [[Matrix (mathematics)|matrices]] and with [[Finite field|finite fields]] (which are represented using [[Conway polynomial (finite fields)|Conway polynomials]]). [[Ring (mathematics)|Rings]], [[Module (mathematics)|modules]] and [[Lie algebra|Lie algebras]] are also supported.
 
==Distribution==
GAP and its sources, including packages (sets of user contributed programs), data library (including a [[list of small groups]]) and the manual, are distributed freely, subject to "[[copyleft]]" conditions. GAP runs on any [[Unix]] system, under [[Microsoft Windows|Windows]], and on [[Apple MacintoshMac_(computer)|MacintoshMac]] systems. The standard distribution requires about 300 MB (about 400 MB if all the packages are loaded). To run GAP, 128 MB of RAM is sufficient.
 
The user contributed packages are an important feature of the system, adding a great deal of functionality. GAP offers package authors the opportunity to submit these packages for a process of [[peer review]], hopefully improving the quality of the final packages, and providing recognition akin to an academic publication for their authors. {{As of|20062021|0803}}, there are 58151 packages distributed with GAP, of which approximately 3571 have been through this process.
 
An interface is available for using the [[Singular (software)|SINGULAR]] computer algebra system from within GAP. GAP is also included in the mathematical software system [[SageMath]].
 
==Sample session==
 
<span style="color: darkblue;">gap></span> <span style="color: #B60000;">G:=SmallGroup(8,1);</span> <span style="color: darkgray;"># Set G to be a group of order 8.</span>
=== [[Permutation group]] ===
<pc group of size 8 with 3 generators>
{{sxhl|lang=gap-console|1=
<span style="color: darkblue;">gap></span> <span style="color: #B60000;">i:=IsomorphismPermGroup(G);</span> <span style="color: darkgray;"># Find an isomorphism from G to a group of permutations.</span>
gap> G:=SmallGroup(8,1); # Set G to be the 1st group (in GAP catalogue) of order 8.
<action isomorphism>
<pc group of size 8 with 3 generators>
<span style="color: darkblue;">gap></span> <span style="color: #B60000;">Image(i,G);</span> <span style="color: darkgray;"># The image of G under I - these are the generators of im G.</span>
<span style="color: darkblue;">gap></span> <span style="color: #B60000;">i:=IsomorphismPermGroup(G);</span> <span style="color: darkgray;"># Find an isomorphism from G to a group of permutations.</span>
Group([ (1,5,3,7,2,6,4,8), (1,3,2,4)(5,7,6,8), (1,2)(3,4)(5,6)(7,8) ])
<action isomorphism>
<span style="color: darkblue;">gap></span> <span style="color: #B60000;">Elements(Image(i,G));</span> <span style="color: darkgray;"># All the elements of im G.</span>
gap> Image(i,G); # Generators for the image of G under i - written as products of disjoint cyclic permutations.
<nowiki>[ (), (1,2)(3,4)(5,6)(7,8), (1,3,2,4)(5,7,6,8), (1,4,2,3)(5,8,6,7),
Group([ (1,5,3,7,2,6,4,8), (1,6,3,8,2,5,4,7), (15,7,4,5,26,8,3,6), (1,82)(3,4)(5,6,2,)(7,3,58) ]</nowiki>)
gap> Elements(Image(i,G)); # All the elements of im G.
Group([ (1),5 (1,2)(3,7,24)(5,6,4)(7,8), (1,3,2,4)(5,7,6,8), (1,4,2)(3,43)(5,8,6,7)(7,8) ])
<nowiki>[ (), (1,2)(5,3,4)(57,2,6)(7,4,8), (1,6,3,8,2,4)(5,74,6,87), (1,7,4,5,2,8,3,6), (51,8,4,6,2,7),3,5) ]
}}
 
=== [[Euclidean ring]] ===
{{sxhl|lang=gap-console|1=
gap> # test consistency of EuclideanDegree, EuclideanQuotient, EuclideanRemainder,
gap> # and QuotientRemainder for some ring and elements of it
gap> checkEuclideanRing :=
> function(R, colls...)
> local coll1, coll2, a, b, deg_b, deg_r, q, r, qr;
> if Length(colls) >= 1 then coll1:=colls[1];
> elif Size(R) <= 100 then coll1 := R;
> else coll1 := List([1..100],i->Random(R));
> fi;
> if Length(colls) >= 2 then coll2:=colls[2];
> elif Size(R) <= 100 then coll2 := R;
> else coll2 := List([1..100],i->Random(R));
> fi;
> for b in coll1 do
> if IsZero(b) then continue; fi;
> deg_b := EuclideanDegree(R, b);
> for a in coll2 do
> q := EuclideanQuotient(R, a, b); Assert(0, q in R);
> r := EuclideanRemainder(R, a, b); Assert(0, r in R);
> if a <> q*b + r then Error("a <> q*b + r for ", [R,a,b]); fi;
> deg_r := EuclideanDegree(R, r);
> if not IsZero(r) and deg_r >= deg_b then Error("Euclidean degree did not decrease for ",[R,a,b]); fi;
> qr := QuotientRemainder(R, a, b);
> if qr <> [q, r] then Error("QuotientRemainder inconsistent for ", [R,a,b]); fi;
> od;
> od;
> return true;
> end;;
 
gap> # rings in characteristic 0
gap> checkEuclideanRing(Integers,[-100..100],[-100..100]);
true
gap> checkEuclideanRing(Rationals);
true
gap> checkEuclideanRing(GaussianIntegers);
true
gap> checkEuclideanRing(GaussianRationals);
true
 
gap> # finite fields
gap> ForAll(Filtered([2..50], IsPrimePowerInt), q->checkEuclideanRing(GF(q)));
true
 
gap> # ZmodnZ
gap> ForAll([1..50], m -> checkEuclideanRing(Integers mod m));
true
gap> checkEuclideanRing(Integers mod ((2*3*5)^2));
true
gap> checkEuclideanRing(Integers mod ((2*3*5)^3));
true
gap> checkEuclideanRing(Integers mod ((2*3*5*7)^2));
true
gap> checkEuclideanRing(Integers mod ((2*3*5*7)^3));
true
}}<ref>https://pygments.org/docs/lexers/#pygments.lexers.algebra.GAPConsoleLexer {{Bare URL inline|date=August 2025}}</ref>
 
==See also==
Line 54 ⟶ 122:
 
==External links==
* {{Official website|httphttps://www.gap-system.org}}
* {{GitHub|gap-system}}
* [http://mooedit.sourceforge.net/ medit] - text editor, originally a component of GGAP
* [https://sourceforge.net/projects/ggap/ GGAP] - Front end for GAP
 
{{Computer algebra systems}}
Line 62 ⟶ 129:
{{DEFAULTSORT:Gap Computer Algebra System}}
[[Category:Computer algebra system software for Linux]]
[[Category:Computer algebra system software for MacOSmacOS]]
[[Category:Computer algebra system software for Windows]]
[[Category:Free computer algebra systems]]