3
$\begingroup$

How can I list the sizes of centers of groups of order $288$ in GAP? By GAP we know that there are $1045$ groups of this order by the command below:

G:=AllSmallGroups(288);;

I want to obtain Size(Center(G[i])) for $i = 1, \dots, 1045$ , respectively.

In fact I want to compute the difference between values of Size(Center(G[i])) and NrConjugacyClasses of corresponding G[i], for $i = 1, \dots, 1045$.

$\endgroup$
  • 1
    $\begingroup$ What is stopping you? $\endgroup$ – Tobias Kildetoft Jan 2 '17 at 10:18
  • 1
    $\begingroup$ By looping over all of the 1045 groups, I would guess? $\endgroup$ – TastyRomeo Jan 2 '17 at 10:20
  • 1
    $\begingroup$ If this is just about how to make GAP do this, then it is not a very good fit for this site, but I would suggest you look up the List function. $\endgroup$ – Tobias Kildetoft Jan 2 '17 at 10:35
  • $\begingroup$ It is time-consuming. I want a command or program which shows the list immediately. Like List(G,NrConjugacyClasses). $\endgroup$ – M. R. Jan 2 '17 at 10:35
  • 2
    $\begingroup$ Computing that difference took about 10-20 second on my 5-year old laptop. $\endgroup$ – Tobias Kildetoft Jan 2 '17 at 10:50
4
$\begingroup$

This is the way I do; I don't know more shortcult commands (but there are)!

G:=AllSmallGroups(288);;
l:=[ ];;
for i in [1..Size(G)] do
    Add(l, Size(Center(G[i])));
od;
l;
$\endgroup$
  • $\begingroup$ This is pretty much what the command List does (thought it might be implemented in a way that works slightly faster). $\endgroup$ – Tobias Kildetoft Jan 2 '17 at 12:23
  • $\begingroup$ yes; I have never practised it, but I have heard of it, so said "I don't know" but "there are!" $\endgroup$ – p Groups Jan 2 '17 at 12:24
  • 2
    $\begingroup$ @M.R. Ohh, actually, you should use Add instead of AddSet to get what I just said $\endgroup$ – Tobias Kildetoft Jan 2 '17 at 14:15
  • 2
    $\begingroup$ gap> for i in [1..Size(G)] do ..... gap> a:=NrConjugacyClasses(G[i]); ..... b:=Size(Center(G[i]));.... AddSet( l , [ i, a, b, a-b ] );.... fi;.... od; [I have written commands with gap of dots; these dots should not be considered in program. I think you will understood this modification of program of pGroups.) $\endgroup$ – Beginner Jan 2 '17 at 15:28
  • 1
    $\begingroup$ Note that shorter code may not be the most efficient one, especially if NrSmallGroups(n) is very large. You can iterate like for i in [1..NrSmallGroups(n)] do g:=SmallGroup(n,i); ... od. Also sometimes SmallGroupsInformation gives useful insights into how the groups of a given order are arranged in the library. I suggest to look at Software Carpentry lesson on GAP for some sample code. $\endgroup$ – Alexander Konovalov Jan 2 '17 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.