ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 15 Apr 2013 07:48:13 +0200Problem using GAPhttps://ask.sagemath.org/question/10025/problem-using-gap/Hello,
I'm starting to use the GAP package/software with the follow commands to define a simple finite group:
gap> f := FreeGroup("x");
<free group on the generators [ x ]>
gap> AssignGeneratorVariables(f);
I Assigned the global variables [ x ]
gap> x^5 * x^-7;
x^-2
gap> g := f/[x^5];
<fp group on the generators [x]>
gap> AssignGeneratorVariables(g);
I Global Variable x already defined and will be overwritten
I Assigned the global variables [ x ]
gap> Size(g);
5
gap> List(g);
-------
**Here is the problem, I should get:**
**[ identity ..., x, x^2, x^3, x^4 ]**
but instead, I got:
**[ identity ..., x, x^-1, x^2, x^-2 ]**
1) What am I doing wrong, please?
**Also, the command:**
gap> MultTable(g);
Error, Variable: 'MultTable' must have a value
not in any function at line 8 of *stdin*
-----
Can someone please help with that? I have a lot of ideas on Group / Abstract Algebra but despite I use/read the GAP manual I can't create a simple multiplication table.
Any hint/help will be appreciate.
**Thank you in advance.**Sun, 14 Apr 2013 21:55:38 +0200https://ask.sagemath.org/question/10025/problem-using-gap/Answer by slelievre for <p>Hello,</p>
<p>I'm starting to use the GAP package/software with the follow commands to define a simple finite group:</p>
<p>gap> f := FreeGroup("x");</p>
<p><free group="" on="" the="" generators="" [="" x="" ]&gt;<="" p="">
</p><p>gap> AssignGeneratorVariables(f);</p>
<p>I Assigned the global variables [ x ]</p>
<p>gap> x^5 * x^-7;</p>
<p>x^-2</p>
<p>gap> g := f/[x^5];</p>
<p><fp group="" on="" the="" generators="" [x]&gt;<="" p="">
</p><p>gap> AssignGeneratorVariables(g);</p>
<p>I Global Variable x already defined and will be overwritten
I Assigned the global variables [ x ]</p>
<p>gap> Size(g);</p>
<p>5</p>
<p>gap> List(g);</p>
<hr/>
<p><strong>Here is the problem, I should get:</strong></p>
<p><strong>[ identity ..., x, x^2, x^3, x^4 ]</strong></p>
<p>but instead, I got:</p>
<p><strong>[ identity ..., x, x^-1, x^2, x^-2 ]</strong></p>
<p>1) What am I doing wrong, please?</p>
<p><strong>Also, the command:</strong></p>
<p>gap> MultTable(g);</p>
<p>Error, Variable: 'MultTable' must have a value
not in any function at line 8 of <em>stdin</em></p>
<hr/>
<p>Can someone please help with that? I have a lot of ideas on Group / Abstract Algebra but despite I use/read the GAP manual I can't create a simple multiplication table.</p>
<p>Any hint/help will be appreciate.</p>
<p><strong>Thank you in advance.</strong></p>
https://ask.sagemath.org/question/10025/problem-using-gap/?answer=14783#post-id-14783Regarding your first problem: in the group you defined, `x^-1` is the same as `x^4`, and `x^-2` is the same as `x^3`, so the answer returned by GAP is correct. I don't know if there is a way to ask GAP to display only positive powers.
As for the multiplication table, you need to spell it `MultiplicationTable` instead of `MultTable`:
gap> f := FreeGroup("x");
<free group on the generators [ x ]>
gap> AssignGeneratorVariables(f);
#I Assigned the global variables [ x ]
gap> x^5 * x^-7;
x^-2
gap> g := f/[x^5];
<fp group on the generators [ x ]>
gap> AssignGeneratorVariables(g);
#I Global variable `x' is already defined and will be overwritten
#I Assigned the global variables [ x ]
gap> Size(g);
5
gap> List(g);
[ <identity ...>, x, x^-1, x^2, x^-2 ]
gap> MultTable(g);
Error, Variable: 'MultTable' must have a value
not in any function at line 16 of *stdin*
gap> MultiplicationTable(g);
[ [ 1, 2, 3, 4, 5 ], [ 2, 3, 4, 5, 1 ], [ 3, 4, 5, 1, 2 ], [ 4, 5, 1, 2, 3 ], [ 5, 1, 2, 3, 4 ] ]
gap>
Mon, 15 Apr 2013 07:26:45 +0200https://ask.sagemath.org/question/10025/problem-using-gap/?answer=14783#post-id-14783Comment by Luiz Roberto Meier for <p>Regarding your first problem: in the group you defined, <code>x^-1</code> is the same as <code>x^4</code>, and <code>x^-2</code> is the same as <code>x^3</code>, so the answer returned by GAP is correct. I don't know if there is a way to ask GAP to display only positive powers.</p>
<p>As for the multiplication table, you need to spell it <code>MultiplicationTable</code> instead of <code>MultTable</code>:</p>
<pre><code>gap> f := FreeGroup("x");
<free group on the generators [ x ]>
gap> AssignGeneratorVariables(f);
#I Assigned the global variables [ x ]
gap> x^5 * x^-7;
x^-2
gap> g := f/[x^5];
<fp group on the generators [ x ]>
gap> AssignGeneratorVariables(g);
#I Global variable `x' is already defined and will be overwritten
#I Assigned the global variables [ x ]
gap> Size(g);
5
gap> List(g);
[ <identity ...>, x, x^-1, x^2, x^-2 ]
gap> MultTable(g);
Error, Variable: 'MultTable' must have a value
not in any function at line 16 of *stdin*
gap> MultiplicationTable(g);
[ [ 1, 2, 3, 4, 5 ], [ 2, 3, 4, 5, 1 ], [ 3, 4, 5, 1, 2 ], [ 4, 5, 1, 2, 3 ], [ 5, 1, 2, 3, 4 ] ]
gap>
</code></pre>
https://ask.sagemath.org/question/10025/problem-using-gap/?comment=17901#post-id-17901I thank you very much for your entire time/answer. That's correct! I will try to identify how to display or produce only positive powers and if I sucess I will post it here. Thank you again!Mon, 15 Apr 2013 07:48:13 +0200https://ask.sagemath.org/question/10025/problem-using-gap/?comment=17901#post-id-17901