GAP — GeneratorsOfRing giving a list with repeated element

30 Views Asked by At

I put the following code in GAP:

R := Integers mod 8;

and I get the answer:

[ ZmodnZObj( 1, 8 ), ZmodnZObj( 1, 8 ) ]

Can someone explain why the generator is repeated there?

1

There are 1 best solutions below

0
On BEST ANSWER

What GAP really uses is GeneratorsOfRingWithOne (which is as you would expect). If you call GeneratorsOfRing, GAP goes into a generic routine that just always adds the one as an extra generator.

One can argue whether this is the best one can do, but so far (there is little implemented for rings without one) this has not been a practical problem.

How did I find this out: I checked (before asking for the GeneratorsOfRing) that GeneratorsOfRing were not yet stored

gap> HasGeneratorsOfRing(R);
false

and then used ApplicableMethod to get the actual code that computes the value:

gap> me:=ApplicableMethod(GeneratorsOfRing,[R],1);
#I  Searching Method for GeneratorsOfRing with 1 arguments:
#I  Total: 10 entries
#I  Method 3 : ``GeneratorsOfRing: for a ring-with-one with generators'' at /Users/hulpke/gap4/lib/ring.gi:291 , value: 30
function( R ) ... end
gap> Print(me);
function ( R )
    return Concatenation( GeneratorsOfRingWithOne( R ), [ One( R ) ] );
end