[GAP Forum] Failed to use the elements of the abstract group to create a group directly.
Hongyi Zhao
hongyi.zhao at gmail.com
Fri Apr 29 10:39:32 BST 2022
On Fri, Apr 29, 2022 at 3:27 PM Dima Pasechnik <dima at sagemath.org> wrote:
>
> On Fri, Apr 29, 2022 at 08:40:28AM +0800, Hongyi Zhao wrote:
> >
> > See the following testings:
> >
> > gap> g:=SmallGroup(8,1);
> > <pc group of size 8 with 3 generators>
> >
> > gap> Elements(g);
> > [ <identity> of ..., f1, f2, f3, f1*f2, f1*f3, f2*f3, f1*f2*f3 ]
> >
> > gap> ele:=Elements(g);
> > [ <identity> of ..., f1, f2, f3, f1*f2, f1*f3, f2*f3, f1*f2*f3 ]
> > gap> Group(ele);
> > <pc group with 8 generators>
> >
> > gap> Group([ <identity> of ..., f1, f2, f3, f1*f2, f1*f3, f2*f3, f1*f2*f3 ]);
> > Syntax error: expression expected
> > Group([ <identity> of ..., f1, f2, f3, f1*f2, f1*f3, f2*f3, f1*f2*f3 ]);
> > ^
>
> No surprise here, as very often GAP's output isn't even a syntactically correct GAP's input.
>
> What will work here is either
> gap> g.1;
> f1
>
> (and, more generally, g.<i> is f<i>)
>
> So you can either use these g.1, g.2, etc directly, or assign them to variables and use these,
> e.g.
>
> gap> a:=g.1;
>
> Another way to get group's generators is
> gap> GeneratorsOfGroup(g);
> [ f1, f2, f3 ]
>
> (and so you can use elements of this list)
>
> Yet another way is calling the following function, which performs the assignment of generators of g
> to the corr. global variables (only recommended for interactive work).
>
> gap> AssignGeneratorVariables(g);
> #I Assigned the global variables [ f1, f2, f3 ]
> gap> f1;
> f1
Really. All your above tips work:
gap> g:=SmallGroup(8,1);
<pc group of size 8 with 3 generators>
gap> GeneratorsOfGroup(g);
[ f1, f2, f3 ]
gap> Group(g.1, g.2, g.3);
<pc group with 3 generators>
gap> AssignGeneratorVariables(g);
#I Assigned the global variables [ f1, f2, f3 ]
gap> Group(f1, f2, f3);
<pc group with 3 generators>
Another question: How can I create a group that meets the following
requirements?
1. Create a group isomorphic to the above one from scratch.
2. Don't use the already existent generators.
3. Use an arbitrarily named element name.
4. Don't use the permutation group as the isomorphic base.
Yours,
HZ
More information about the Forum
mailing list