Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GAP (computer algebra system)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Sample session== === [[Permutation group]] === {{sxhl|lang=gap-console|1= gap> G:=SmallGroup(8,1); # Set G to be the 1st group (in GAP catalogue) of order 8. <pc group of size 8 with 3 generators> gap> i:=IsomorphismPermGroup(G); # Find an isomorphism from G to a group of permutations. <action isomorphism> gap> Image(i,G); # Generators for the image of G under i - written as products of disjoint cyclic permutations. 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) ]) gap> Elements(Image(i,G)); # All the elements of im G. [ (), (1,2)(3,4)(5,6)(7,8), (1,3,2,4)(5,7,6,8), (1,4,2,3)(5,8,6,7), (1,5,3,7,2,6,4,8), (1,6,3,8,2,5,4,7), (1,7,4,5,2,8,3,6), (1,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</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)