From m.fayers at qmul.ac.uk Thu Jan 2 15:36:47 2014 From: m.fayers at qmul.ac.uk (Matthew Fayers) Date: Thu, 2 Jan 2014 15:36:47 +0000 Subject: [GAP Forum] Orbits for subgroups of S_n Message-ID: <52C5878F.5090201@qmul.ac.uk> Dear GAP forum, I have a calculation that I want to carry out (repeatedly with the data varying) without running into memory difficulties. Let S_n denote the symmmetric group on {1,...,n}. I have subgroups H <= K <= S_n; these subgroups are defined by (small) generating sets. I have an element g in S_n. When subgroups of S_n act on S_n by conjugation, the K-orbit containing g is partitioned into H-orbits. I'd like to find representatives for these H-orbits (ideally, the representatives which are smallest in the usual GAP order for permutations). In practice, K is so large that computing the whole of the K-orbit containing g exceeds the available memory. Does anyone have any idea how I can accomplish this? Best wishes, Matt Fayers. _______________________________________________________________ Matthew Fayers School of Mathematics Queen Mary University of London Mile End Road London E1 4NS 020 7882 5479 From chaboksavar at gmail.com Fri Jan 3 00:39:41 2014 From: chaboksavar at gmail.com (Masoud Chaboksavar) Date: Fri, 3 Jan 2014 04:09:41 +0330 Subject: [GAP Forum] How I can act an automorphism of a group to a quotient group Message-ID: Dear Forum Hello Let G be a finite group and H a normal subgroup of it. Also Assume that G/H is a quotient and A is full automorphism group of G. I want calculate the image of a in A on G/H by GAP. For more details: if G/H={H, g1H, g2H, . . . , gnH} I want calculate {H, (g1)^aH, (g2)^aH, . . . , (gn)^aH} With best regards From lvluyen at gmail.com Fri Jan 3 14:10:07 2014 From: lvluyen at gmail.com (Le Van Luyen) Date: Fri, 3 Jan 2014 14:10:07 +0000 Subject: [GAP Forum] How I can act an automorphism of a group to a quotient group In-Reply-To: References: Message-ID: Dear Masoud, You could look the following GAP session: gap> G:=DihedralGroup(32); gap> H:=NormalSubgroups(G)[2]; ## H is a normal subgroup of G gap> p:=NaturalHomomorphismByNormalSubgroup(G,H); ## p: G->G/H gap> GH:=Range(p); ## GH is the quotient G/H gap> A:=AutomorphismGroup(G); ## A=AutG gap> a:=Random(A); ## f is a element in AutG gap> gH:=List(GH,x->PreImagesRepresentative(p,x)); ##gH is the list of representatives {g_1,g_2,...,g_n} gap> agH:=List(gH,x->x^a); ## agH:={g_1^a,g_2^a,...,g_n^a} gap> aGH:=List(agH,x->x^p); Then aGH is the list that you want to compute Best regards, Luyen From Thekiso.Seretlo at nwu.ac.za Wed Jan 8 12:06:46 2014 From: Thekiso.Seretlo at nwu.ac.za (Thekiso Seretlo) Date: Wed, 08 Jan 2014 14:06:46 +0200 Subject: [GAP Forum] Orbits Message-ID: <52CD5B76020000E70008538B@v-pgw-nlx2.p.nwu.ac.za> Dear Forum Collegues It is still new year and my mind is still at rest but I am desperately trying to get the orbitlengths bwhen $M_11$ acts on the set of conjugates of $M_22$. Thanks Thekiso Vrywaringsklousule / Disclaimer: http://www.nwu.ac.za/it/gov-man/disclaimer.html From williamdemeo at gmail.com Wed Jan 8 22:31:03 2014 From: williamdemeo at gmail.com (William DeMeo) Date: Wed, 8 Jan 2014 17:31:03 -0500 Subject: [GAP Forum] Ordering of group elements Message-ID: Hello Forum, We are working on an application involving functions defined on groups. In our programs functions are represented as vectors that are indexed by the elements of a given group. Therefore, the order in which group elements are listed is important when performing operations with these functions (e.g. convolution). I noticed that, in GAP, the default cyclic group of order 8 has 3 generators, and the elements of the group are listed as follows: gap> G:=CyclicGroup(8); gap> Elements(G); [ of ..., f1, f2, f3, f1*f2, f1*f3, f2*f3, f1*f2*f3 ] gap> GeneratorsOfGroup(G); [ f1, f2, f3 ] Suppose instead we want the 8 element cyclic group to be represented with one generator. We can do this as follows: gap> f:= FreeGroup("x"); gap> g:= f/[f.1^8]; gap> Elements(g); [ , x, x^2, x^4, x^3, x^-3, x^-2, x^-1 ] AsSet or AsList or AsSortedList or AsSSortedList all give the same ordering of the group elements as does the Elements function. Finally, here are my questions: Question 1: Why is the default ordering of the elements not one of the alternatives below? [ , x, x^2, x^3, x^4, x^-3, x^-2, x^-1 ] or [ , x, x^2, x^3, x^4, x^5, x^6, x^7 ] Question 2: Suppose our application requires the group elements be listed in this "natural" way. Is it possible to do this without having to inspect each group we use by hand? In other words, is it possible to anticipate the ordering that GAP will use for a given group, so that we can write our programs accordingly? Question 3: Is there no conventional or "natural" ordering of elements for certain groups, in particular the cyclic groups? And why does GAP prefer ...x^2, x^4, x^3... over ...x^2, x^3, x^4... in the example above? As another example, here is the cyclic group of order 16: gap> g:= f/[f.1^16]; gap> Elements(g); [ , x, x^2, x^4, x^8, x^3, x^5, x^9, x^6, x^10, x^12, x^7, x^11, x^13, x^14, x^15 ] Thank you in advance for any suggestions or advice. If there is no general way to anticipate how GAP will order elements of a group, then any comments on GAP's choice of element ordering for particular examples (like cyclic groups or symmetric groups) would be very much appreciated. Sincerely, William -- William DeMeo Department of Mathematics University of South Carolina 1523 Greene Street Columbia, SC 29208 USA phone: 803-261-9135 http://williamdemeo.org http://williamdemeo.github.io/CV -- From hulpke at fastmail.fm Wed Jan 8 23:29:20 2014 From: hulpke at fastmail.fm (Alexander Hulpke) Date: Wed, 8 Jan 2014 16:29:20 -0700 Subject: [GAP Forum] Ordering of group elements In-Reply-To: References: Message-ID: <3F236C3E-43FE-45B0-82C5-0C983CAE6FC2@fastmail.fm> Dear Forum, William DeMeo wrote: > Suppose instead we want the 8 element cyclic group to be represented > with one generator. We can do this as follows: > > gap> f:= FreeGroup("x"); > > > gap> g:= f/[f.1^8]; > > > gap> Elements(g); > [ , x, x^2, x^4, x^3, x^-3, x^-2, x^-1 ] > > AsSet or AsList or AsSortedList or AsSSortedList all give the same > ordering of the group elements as does the Elements function. > The comparison for elements of a finitely presented group is somewhat complicated because one cannot always guarantee an easy normal form. In particular we do not guarantee that such an element ordering is stable between different runs of GAP by default. The questions are probably answered most easily by explaining what GAP does: When asking to compare elements of an fp group, GAP will by default try to construct a faithful permutation representation (or isomorphism to a pc group). Comparison of elements then is based on the same comparison for the images of the elements. In the example this permutation representation probably does not use the default numbering: gap> IsomorphismPermGroup(g); [ x ] -> [ (1,2,4,6,8,7,5,3) ] and thus looks strange. What one could do it to tell GAP (before the first element comparison) to use normal forms: gap> SetReducedMultiplication(g); Then element comparison is instead based on comparison of the normal forms and might look more plausible. (The normal form uses a monoid with x^-1 Elements(g); [ , x^-1, x, x^-2, x^2, x^-3, x^3, x^4 ] If you wanted a bespoke ordering, you could create a function fct(left,right) that implements this ordering and then (before ever asking for the ordering) install it as FpElementComparisonMethod for the elements family. E.g. gap> a:=(1,2,3,4,5,6,7,8); (1,2,3,4,5,6,7,8) gap> myiso:=GroupHomomorphismByImages(g,Group(a),[g.1],[a]);; gap> fct:=function(left,right) return Image(myiso,left) SetFpElmComparisonMethod(FamilyObj(One(g)),fct); gap> Elements(g); [ , x, x^2, x^3, x^4, x^5, x^6, x^7 ] Alternatively, you could install a bespoke normal form method (SetFpElementNFFunction) and force reduced multiplication (which then would use your normal form). Admittedly either looks a bit overkill for cyclic groups, but the machinery is ste up for arbitrary finitely presented groups for whom this is a hard problem. Best, Alexander Hulpke > > Finally, here are my questions: > > > Question 1: Why is the default ordering of the elements not one of the > alternatives below? > > [ , x, x^2, x^3, x^4, x^-3, x^-2, x^-1 ] > > or > > [ , x, x^2, x^3, x^4, x^5, x^6, x^7 ] > > > Question 2: Suppose our application requires the group elements be > listed in this "natural" way. Is it possible to do this without > having to inspect each group we use by hand? In other words, is it > possible to anticipate the ordering that GAP will use for a given > group, so that we can write our programs accordingly? > > > Question 3: Is there no conventional or "natural" ordering of elements > for certain groups, in particular the cyclic groups? And why does GAP > prefer ...x^2, x^4, x^3... over ...x^2, x^3, x^4... in the example > above? > > > As another example, here is the cyclic group of order 16: > > gap> g:= f/[f.1^16]; > > > gap> Elements(g); > [ , x, x^2, x^4, x^8, x^3, x^5, x^9, x^6, x^10, x^12, > x^7, x^11, x^13, x^14, x^15 ] > > > Thank you in advance for any suggestions or advice. If there is no > general way to anticipate how GAP will order elements of a group, then > any comments on GAP's choice of element ordering for particular > examples (like cyclic groups or symmetric groups) would be very much > appreciated. > > > Sincerely, > > William > > > -- > William DeMeo > Department of Mathematics > University of South Carolina > 1523 Greene Street > Columbia, SC 29208 > USA > > phone: 803-261-9135 > http://williamdemeo.org > http://williamdemeo.github.io/CV > -- > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From chaboksavar at gmail.com Sun Jan 12 09:39:09 2014 From: chaboksavar at gmail.com (Masoud Chaboksavar) Date: Sun, 12 Jan 2014 13:09:09 +0330 Subject: [GAP Forum] How I can calculate the relations of Small Group Message-ID: Dear forum Hello I need to calculate the relations of a small group. I know that by command GeneratorsOfGroup I could calculate the generators of a group. But I do not know how I can get its relations. With best regards Masoud From stefan at mcs.st-and.ac.uk Sun Jan 12 10:14:38 2014 From: stefan at mcs.st-and.ac.uk (Stefan Kohl) Date: Sun, 12 Jan 2014 10:14:38 -0000 (UTC) Subject: [GAP Forum] How I can calculate the relations of Small Group In-Reply-To: References: Message-ID: On Sun, January 12, 2014 9:39 am, Masoud Chaboksavar wrote: > > I need to calculate the relations of a small group. I know that by command > GeneratorsOfGroup I could calculate the generators of a group. But I do not > know how I can get its relations. If your group is already represented as an fp group, you can obtain a list of the relators by the operation RelatorsOfFpGroup. If not, you need to convert your group into an fp group first -- thus if your group is G, you can get a list of relators by RelatorsOfFpGroup(Image(IsomorphismFpGroup(G))); -- note however that neither the choice of the isomorphism to an fp group nor the choice of the relators is unique. If this does not help you, I suggest you to be more specific about what you need. Best regards, Stefan Kohl ----------------------------------------------------------------------------- http://www.gap-system.org/DevelopersPages/StefanKohl/ ----------------------------------------------------------------------------- From max at quendi.de Mon Jan 13 09:12:52 2014 From: max at quendi.de (Max Horn) Date: Mon, 13 Jan 2014 10:12:52 +0100 Subject: [GAP Forum] Ordering of group elements In-Reply-To: References: Message-ID: Dear William, in addition to Alexander Hulpke's answer, let me point out that you could use the polycyclic package and the pcp groups it provides. This package is loaded by default, too. This is how your example looks with pcp groups: gap> G:=CyclicGroup(IsPcpGroup, 8); Pcp-group with orders [ 8 ] gap> Elements(G); [ g1^7, g1^6, g1^5, g1^4, g1^3, g1^2, g1, id ] gap> GeneratorsOfGroup(G); [ g1 ] The elements of cyclic Pcp group defined over a single-element generating set will always be of this "natural" kind. Technically, pcp groups can be considered as a refinement of the pc groups built into GAP, which you also tried (they are the default returned by CyclicGroup, if no other type is specified). The ordering of elements for both pc and pcp groups is always based on the exponents of the group elements. I.e., every group element of a pc / pcp group with generating set g1, ..., gn has a unique reduced expression of the form g1^e1 g2^e2 ... gn^en and GAP uses the lexicographical order on these exponents to order the elements. Thus, the ordering is always fully predictable. Hope that helps, Max From max at quendi.de Mon Jan 13 10:56:14 2014 From: max at quendi.de (Max Horn) Date: Mon, 13 Jan 2014 11:56:14 +0100 Subject: [GAP Forum] Orbits In-Reply-To: <52CD5B76020000E70008538B@v-pgw-nlx2.p.nwu.ac.za> References: <52CD5B76020000E70008538B@v-pgw-nlx2.p.nwu.ac.za> Message-ID: <0D5461B9-F9F1-411E-BC14-D222F81006C1@quendi.de> Dear Thekiso, On 08.01.2014, at 13:06, "Thekiso Seretlo" wrote: > Dear Forum Collegues > It is still new year and my mind is still at rest but I am desperately trying to get the orbitlengths bwhen $M_11$ acts on the set of conjugates of $M_22$. you told me in private communication that you are interested in these groups as subgroups of HS. Note that HS has two classes of maximal subgroups isomorphic to M11. If I understood your question correctly, one way to answer it is with the following GAP code: gap> LoadPackage("atlasrep"); true gap> g:= AtlasGroup( "HS" ); # Get the relevant maximal subgroups (ordered as in the atlas) gap> m22:=AtlasSubgroup(g, 1); gap> m11a:=AtlasSubgroup(g, 8); gap> m11b:=AtlasSubgroup(g, 9); # Let's verify their isomorphism type gap> StructureDescription(m22); "M22" gap> StructureDescription(m11a); "M11" gap> StructureDescription(m11b); "M11" # Finally, compute the orbit lengths of the two M11 acting on the conjugacy class of M22 gap> cc:=ConjugacyClassSubgroups(g, m22);; gap> OrbitLengthsDomain(m11a, cc); [ 66, 12, 22 ] gap> OrbitLengthsDomain(m11b, cc); [ 22, 12, 66 ] Hope that helps, Max From gletschereis at googlemail.com Wed Jan 15 19:46:24 2014 From: gletschereis at googlemail.com (Andreas Rabenstetter) Date: Wed, 15 Jan 2014 20:46:24 +0100 Subject: [GAP Forum] Work with PGammaL(n,q), APGammaL(n,q) and PSL. Message-ID: Dear GAP-Forum, Question1: I wanted to work with: PGammaL(n,q) or APGammaL(n,q):=, \tau is the Dynkin Automorphism, and it?s supgroup the Socle PSL(n,q). Therefore I defined the Group APGammaL(n,q) with the command "W:= PSL(n,q); G:=AutomorphismGroup(W); " . Since the PSL(n,q) (with the command "PSL(n,q)") isn?t regarded as a supgroup of AGammaL(n,q) or PGammaL(n,q), I have created the supgroup with the command "Socle( G )". Now my Computer doen?t calculate the Groups for (n,q) which are not even very high, because it is to much to calculate for the socle or the Autormorphism Group. Now I wanted to know, if it?s possible to create the whole situation with other commands which work faster. Or does GAP even know the structure. Question2: It would be possible for me to work not porjective. Then I have defined GammaL(n,q) with the command GAP knows. But how can I get the subgroup X, which is isomorph to SL(n,q)? I have tried the command solce, but then for (n,q)=(3,2^4) I get the wrong group: gap> G:=GammaL(3,2^4); GammaL(3,16) gap> Y:=Socle( G ); gap> IsSubgroup(G,Y); true gap> Size(Y); 15 gap> Thank you much for your kind help. Regards From hulpke at math.colostate.edu Thu Jan 16 17:16:59 2014 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Thu, 16 Jan 2014 10:16:59 -0700 Subject: [GAP Forum] Work with PGammaL(n,q), APGammaL(n,q) and PSL. In-Reply-To: References: Message-ID: Dear GAP-Forum, Andreas Rabenstetter asked: > Question1: I wanted to work with: > > > PGammaL(n,q) or APGammaL(n,q):=, > \tau is the Dynkin Automorphism, and it?s supgroup the Socle PSL(n,q). > > > Therefore I defined the Group APGammaL(n,q) with the command "W:= > PSL(n,q); G:=AutomorphismGroup(W); " . Since the PSL(n,q) (with the > command "PSL(n,q)") isn?t regarded as a supgroup of AGammaL(n,q) or > PGammaL(n,q), I have created the supgroup with the command "Socle( G )". > Now my Computer doen?t calculate the Groups for (n,q) which are not even > very high, because it is to much to calculate for the socle or the > Autormorphism Group. Now I wanted to know, if it?s possible to create the > whole situation with other commands which work faster. Or does GAP even > know the structure. at the moment GAP does not treat these groups specially but runs in the generic calculations for socle and automorphism group. As these are permutation groups of moderately large degree q^n and large order this takes a while. I have code in the development version that immediately writes down generators of the automorphism group, it will be part of GAP 4.8. The easiest way to do equivalently is probably to use the homomorphism SL->PSL explicitly: gap> sl:=SL(5,7); SL(5,7) gap> vecs:=NormedVectors(GF(7)^5);; gap> hom:=ActionHomomorphism(sl,vecs,OnLines,"surjective"); gap> psl:=Image(hom); now take generators of the automorphisms for sl: # induced by GL gap> auts:=List(GeneratorsOfGroup(gl),x->GroupHomomorphismByImagesNC(sl,sl,GeneratorsOfGroup(sl), > List(GeneratorsOfGroup(sl),y->y^x)));; # graph automorphism gap> Add(auts,GroupHomomorphismByImagesNC(sl,sl,GeneratorsOfGroup(sl), > List(GeneratorsOfGroup(sl),y->TransposedMat(y)^-1)));; If the field was nonprime, you need to add a generator of the Galois automorphisms. Transfer to psl: auts:=List(auts,x->InducedAutomorphism(hom,x));; and make a group out of it: gap> A:=Group(auts);; gap> SetIsGroupOfAutomorphismsFiniteGroup(A,true); # will trigger methods for automorphism groups Note that a command such as IsomorphismPermGroup' for A still will take a little while. > Question2: It would be possible for me to work not porjective. Then I have > defined GammaL(n,q) with the command GAP knows. But how can I get the > subgroup X, which is isomorph to SL(n,q)? I have tried the command solce, > but then for (n,q)=(3,2^4) I get the wrong group: > > gap> G:=GammaL(3,2^4); > GammaL(3,16) > gap> Y:=Socle( G ); > > gap> IsSubgroup(G,Y); > true > gap> Size(Y); > 15 No, that is the socle of GammaL (=its centre). You want the socle modulo the centre, probably PerfectResiduum will be easiest. Best, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke at math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke From robert.wolstenholme08 at imperial.ac.uk Thu Jan 16 16:34:44 2014 From: robert.wolstenholme08 at imperial.ac.uk (Wolstenholme, Robert) Date: Thu, 16 Jan 2014 16:34:44 +0000 Subject: [GAP Forum] Iteration Over List of Lists Message-ID: <5252654327565F489A4402B674A4F6AD8A65E705@icexch-m1.ic.ac.uk> Is there a way in GAP to easily iterate of lists of lists i.e. like the Python itertools.product() function? From robert.wolstenholme08 at imperial.ac.uk Thu Jan 16 20:03:38 2014 From: robert.wolstenholme08 at imperial.ac.uk (Wolstenholme, Robert) Date: Thu, 16 Jan 2014 20:03:38 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists Message-ID: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> Is there a way in GAP to 'quickly' iterate of lists of lists i.e. like the Python itertools.product() function? From alexander.konovalov at gmail.com Thu Jan 16 22:01:26 2014 From: alexander.konovalov at gmail.com (Alexander Konovalov) Date: Thu, 16 Jan 2014 22:01:26 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> Message-ID: <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> On 16 Jan 2014, at 20:03, "Wolstenholme, Robert" wrote: > Is there a way in GAP to 'quickly' iterate of lists of lists i.e. like the Python itertools.product() function? > Yes, see 21.20 Operations for Lists' from the GAP Reference Manual. You may enter ?Operations for Lists' in GAP or see it online at http://www.gap-system.org/Manuals/doc/ref/chap21.html#X7DF510F7848CBBFD A random example just to expose the syntax and some functions: gap> l:=List([1..10],i -> [1..i]); [ [ 1 ], [ 1, 2 ], [ 1 .. 3 ], [ 1 .. 4 ], [ 1 .. 5 ], [ 1 .. 6 ], [ 1 .. 7 ], [ 1 .. 8 ], [ 1 .. 9 ], [ 1 .. 10 ] ] gap> Sum( List( l, x -> Product( List( x, Fibonacci ) ) ) ); 124819000 HTH, Alexander From Bill.Allombert at math.u-bordeaux.fr Thu Jan 16 20:23:15 2014 From: Bill.Allombert at math.u-bordeaux.fr (Bill Allombert) Date: Thu, 16 Jan 2014 21:23:15 +0100 Subject: [GAP Forum] Iteration Over List of Lists In-Reply-To: <5252654327565F489A4402B674A4F6AD8A65E705@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E705@icexch-m1.ic.ac.uk> Message-ID: <20140116202315.GC9130@yellowpig> On Thu, Jan 16, 2014 at 04:34:44PM +0000, Wolstenholme, Robert wrote: > Is there a way in GAP to easily iterate of lists of lists i.e. like the > Python itertools.product() function? I suggest you give an example of what you want to do that does not require knowing about Python. Cheers, Bill. PS: Your previous post reached the list. From robert.wolstenholme08 at imperial.ac.uk Thu Jan 16 22:13:41 2014 From: robert.wolstenholme08 at imperial.ac.uk (Wolstenholme, Robert) Date: Thu, 16 Jan 2014 22:13:41 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk>, <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> Message-ID: <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> Thanks for the reply. I don't think I was clear enough with my initial question though so have given the example below: ################################################################################### Consider lists := [] lists[1] := [1,2,3] lists[2] := [4,5] I would now like to iterate over the cartesian product of lists[1] and lists[2] i.e. [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]. For an example this small, you could simply store the cartesian product itself in a list and iterate over that. This obviously becomes very inefficient if we have more lists with a larger number of values. A better way is, if we have n lists and size_rc[i] := Size(list[i]), we can avoid storing/calculating the Cartesian product with base := List([1..n], x -> 1); #We store the iteration step state in base while base <> size_rc do #Perform whatever list[i][base[i]] calculations here #Execute the incrementor base[1] := base[1] + 1; for j in [2..n] do if base[j-1] = size_rc[j-1] + 1 then base[j] := base[j] + 1; base[j-1] := 1; fi; od; od; then at each loop of the while base contains the values we need. However this is still far slower than the Python implementation I mentioned before. I was wondering if there was a way in GAP to speed up this iteration (maybe by pointing to the memory locations of the lists)? Thanks, Rob ________________________________________ From: Alexander Konovalov [alexander.konovalov at gmail.com] Sent: 16 January 2014 22:01 To: Wolstenholme, Robert Cc: forum at mail.gap-system.org Subject: Re: [GAP Forum] Iteration Over Lists of Lists On 16 Jan 2014, at 20:03, "Wolstenholme, Robert" wrote: > Is there a way in GAP to 'quickly' iterate of lists of lists i.e. like the Python itertools.product() function? > Yes, see 21.20 Operations for Lists' from the GAP Reference Manual. You may enter ?Operations for Lists' in GAP or see it online at http://www.gap-system.org/Manuals/doc/ref/chap21.html#X7DF510F7848CBBFD A random example just to expose the syntax and some functions: gap> l:=List([1..10],i -> [1..i]); [ [ 1 ], [ 1, 2 ], [ 1 .. 3 ], [ 1 .. 4 ], [ 1 .. 5 ], [ 1 .. 6 ], [ 1 .. 7 ], [ 1 .. 8 ], [ 1 .. 9 ], [ 1 .. 10 ] ] gap> Sum( List( l, x -> Product( List( x, Fibonacci ) ) ) ); 124819000 HTH, Alexander From alexander.konovalov at gmail.com Thu Jan 16 22:19:41 2014 From: alexander.konovalov at gmail.com (Alexander Konovalov) Date: Thu, 16 Jan 2014 22:19:41 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk>, <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> Message-ID: <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> Very briefly (sorry, don't have time for a larger explanation today) - in this case, see IteratorOfCartesianProduct. For example, after lists := []; lists[1] := [1,2,3]; lists[2] := [4,5]; try this: gap> for x in IteratorOfCartesianProduct(lists) do Print(x,"\n");od; [ 1, 4 ] [ 1, 5 ] [ 2, 4 ] [ 2, 5 ] [ 3, 4 ] [ 3, 5 ] This iterates over the cartesian product without generating the list of all tuples from it, and should work fast enough. Best wishes Alexander On 16 Jan 2014, at 22:13, "Wolstenholme, Robert" wrote: > Thanks for the reply. I don't think I was clear enough with my initial question though so have given the example below: > > ################################################################################### > Consider > > lists := [] > lists[1] := [1,2,3] > lists[2] := [4,5] > > I would now like to iterate over the cartesian product of lists[1] and lists[2] i.e. [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]. > > For an example this small, you could simply store the cartesian product itself in a list and iterate over that. This obviously becomes very inefficient if we have more lists with a larger number of values. > > > A better way is, if we have n lists and size_rc[i] := Size(list[i]), we can avoid storing/calculating the Cartesian product with > > base := List([1..n], x -> 1); #We store the iteration step state in base > while base <> size_rc do > > #Perform whatever list[i][base[i]] calculations here > > #Execute the incrementor > base[1] := base[1] + 1; > for j in [2..n] do > if base[j-1] = size_rc[j-1] + 1 then > base[j] := base[j] + 1; > base[j-1] := 1; > fi; > od; > od; > > then at each loop of the while base contains the values we need. > > However this is still far slower than the Python implementation I mentioned before. I was wondering if there was a way in GAP to speed up this iteration (maybe by pointing to the memory locations of the lists)? > > Thanks, > Rob > > ________________________________________ > From: Alexander Konovalov [alexander.konovalov at gmail.com] > Sent: 16 January 2014 22:01 > To: Wolstenholme, Robert > Cc: forum at mail.gap-system.org > Subject: Re: [GAP Forum] Iteration Over Lists of Lists > > On 16 Jan 2014, at 20:03, "Wolstenholme, Robert" wrote: > >> Is there a way in GAP to 'quickly' iterate of lists of lists i.e. like the Python itertools.product() function? >> > > Yes, see 21.20 Operations for Lists' from the GAP Reference Manual. You may enter ?Operations for Lists' in GAP or see it online at > > http://www.gap-system.org/Manuals/doc/ref/chap21.html#X7DF510F7848CBBFD > > A random example just to expose the syntax and some functions: > > gap> l:=List([1..10],i -> [1..i]); > [ [ 1 ], [ 1, 2 ], [ 1 .. 3 ], [ 1 .. 4 ], [ 1 .. 5 ], [ 1 .. 6 ], > [ 1 .. 7 ], [ 1 .. 8 ], [ 1 .. 9 ], [ 1 .. 10 ] ] > gap> Sum( List( l, x -> Product( List( x, Fibonacci ) ) ) ); > 124819000 > > > HTH, > Alexander > > > > From robert.wolstenholme08 at imperial.ac.uk Fri Jan 17 09:23:43 2014 From: robert.wolstenholme08 at imperial.ac.uk (Wolstenholme, Robert) Date: Fri, 17 Jan 2014 09:23:43 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk>, <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk>, <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> Message-ID: <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> Thanks, this is what I wanted. However, I timed it this morning and found it to actually be slower than the method I previously mentioned (currently speed is of significant importance for what I'm doing). I've included the test script below. You can vary the values of n (number of lists) and k (size of lists). Note for n=6 and k=9 I am getting, IteratorOfCartesianProduct Method: 452ms My Mentioned Method : 203ms Python for Reference : 066ms I was hoping for something nearer the speed of the Python implementation. Code (can be copied and pasted) #################################################################################### n := 6; k := 9; ############################ #IteratorOfCartesianProduct Method# ############################ lol := []; for i in [1..n] do lol[i] := [1..k]; od; a := 1; start := Runtime(); for x in IteratorOfCartesianProduct(lol) do #a := a + 1; #Print("x: ", x, "\n"); od; total1 := Runtime() - start; ################### #My Mentioned Method# ################### size_rc := List([1..n], x -> k); base := List([1..n], x -> 1); #We store the iteration step state in base a := 1; start := Runtime(); repeat #Perform whatever list[i][base[i]] calculations here #a := a + 1; #Print("Base: ", base, "\n"); #Execute the incrementor base[1] := base[1] + 1; for j in [2..n] do if base[j-1] = size_rc[j-1] + 1 then base[j] := base[j] + 1; base[j-1] := 1; fi; od; until base[n] = size_rc[n] + 1; total2 := Runtime() - start; Print("\nTotal1: ", total1, "\nTotal2: ", total2); #################################################################################### Thanks, Rob ________________________________________ From: Alexander Konovalov [alexander.konovalov at gmail.com] Sent: 16 January 2014 22:19 To: Wolstenholme, Robert Cc: forum at mail.gap-system.org Subject: Re: [GAP Forum] Iteration Over Lists of Lists Very briefly (sorry, don't have time for a larger explanation today) - in this case, see IteratorOfCartesianProduct. For example, after lists := []; lists[1] := [1,2,3]; lists[2] := [4,5]; try this: gap> for x in IteratorOfCartesianProduct(lists) do Print(x,"\n");od; [ 1, 4 ] [ 1, 5 ] [ 2, 4 ] [ 2, 5 ] [ 3, 4 ] [ 3, 5 ] This iterates over the cartesian product without generating the list of all tuples from it, and should work fast enough. Best wishes Alexander On 16 Jan 2014, at 22:13, "Wolstenholme, Robert" wrote: > Thanks for the reply. I don't think I was clear enough with my initial question though so have given the example below: > > ################################################################################### > Consider > > lists := [] > lists[1] := [1,2,3] > lists[2] := [4,5] > > I would now like to iterate over the cartesian product of lists[1] and lists[2] i.e. [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]. > > For an example this small, you could simply store the cartesian product itself in a list and iterate over that. This obviously becomes very inefficient if we have more lists with a larger number of values. > > > A better way is, if we have n lists and size_rc[i] := Size(list[i]), we can avoid storing/calculating the Cartesian product with > > base := List([1..n], x -> 1); #We store the iteration step state in base > while base <> size_rc do > > #Perform whatever list[i][base[i]] calculations here > > #Execute the incrementor > base[1] := base[1] + 1; > for j in [2..n] do > if base[j-1] = size_rc[j-1] + 1 then > base[j] := base[j] + 1; > base[j-1] := 1; > fi; > od; > od; > > then at each loop of the while base contains the values we need. > > However this is still far slower than the Python implementation I mentioned before. I was wondering if there was a way in GAP to speed up this iteration (maybe by pointing to the memory locations of the lists)? > > Thanks, > Rob > > ________________________________________ > From: Alexander Konovalov [alexander.konovalov at gmail.com] > Sent: 16 January 2014 22:01 > To: Wolstenholme, Robert > Cc: forum at mail.gap-system.org > Subject: Re: [GAP Forum] Iteration Over Lists of Lists > > On 16 Jan 2014, at 20:03, "Wolstenholme, Robert" wrote: > >> Is there a way in GAP to 'quickly' iterate of lists of lists i.e. like the Python itertools.product() function? >> > > Yes, see 21.20 Operations for Lists' from the GAP Reference Manual. You may enter ?Operations for Lists' in GAP or see it online at > > http://www.gap-system.org/Manuals/doc/ref/chap21.html#X7DF510F7848CBBFD > > A random example just to expose the syntax and some functions: > > gap> l:=List([1..10],i -> [1..i]); > [ [ 1 ], [ 1, 2 ], [ 1 .. 3 ], [ 1 .. 4 ], [ 1 .. 5 ], [ 1 .. 6 ], > [ 1 .. 7 ], [ 1 .. 8 ], [ 1 .. 9 ], [ 1 .. 10 ] ] > gap> Sum( List( l, x -> Product( List( x, Fibonacci ) ) ) ); > 124819000 > > > HTH, > Alexander > > > > From dmitrii.pasechnik at cs.ox.ac.uk Fri Jan 17 11:28:31 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dmitrii Pasechnik) Date: Fri, 17 Jan 2014 11:28:31 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> Message-ID: <20140117112830.GA15939@cs.ox.ac.uk> Dear Robert, you might want to combine Python with GAP using Sage (www.sagemath.org). Then you can benefit from the Python's (or even Cython's) speed and a fast interface to GAP for things you need to do in GAP. HTH, Dmitrii On Fri, Jan 17, 2014 at 09:23:43AM +0000, Wolstenholme, Robert wrote: > Thanks, this is what I wanted. > However, I timed it this morning and found it to actually be slower than the method I previously mentioned (currently speed is of significant importance for what I'm doing). I've included the test script below. You can vary the values of n (number of lists) and k (size of lists). Note for n=6 and k=9 I am getting, > > IteratorOfCartesianProduct Method: 452ms > My Mentioned Method : 203ms > Python for Reference : 066ms > > I was hoping for something nearer the speed of the Python implementation. > > Code (can be copied and pasted) > #################################################################################### > n := 6; > k := 9; > > ############################ > #IteratorOfCartesianProduct Method# > ############################ > lol := []; > for i in [1..n] do > lol[i] := [1..k]; > od; > > a := 1; > > start := Runtime(); > > for x in IteratorOfCartesianProduct(lol) do > #a := a + 1; > #Print("x: ", x, "\n"); > od; > > total1 := Runtime() - start; > > > ################### > #My Mentioned Method# > ################### > size_rc := List([1..n], x -> k); > base := List([1..n], x -> 1); #We store the iteration step state in base > a := 1; > > start := Runtime(); > repeat > > #Perform whatever list[i][base[i]] calculations here > #a := a + 1; > #Print("Base: ", base, "\n"); > > #Execute the incrementor > base[1] := base[1] + 1; > for j in [2..n] do > if base[j-1] = size_rc[j-1] + 1 then > base[j] := base[j] + 1; > base[j-1] := 1; > fi; > od; > until base[n] = size_rc[n] + 1; > > total2 := Runtime() - start; > > Print("\nTotal1: ", total1, "\nTotal2: ", total2); > #################################################################################### > > Thanks, > Rob > > ________________________________________ > From: Alexander Konovalov [alexander.konovalov at gmail.com] > Sent: 16 January 2014 22:19 > To: Wolstenholme, Robert > Cc: forum at mail.gap-system.org > Subject: Re: [GAP Forum] Iteration Over Lists of Lists > > Very briefly (sorry, don't have time for a larger explanation today) > - in this case, see IteratorOfCartesianProduct. For example, after > > lists := []; > lists[1] := [1,2,3]; > lists[2] := [4,5]; > > try this: > > gap> for x in IteratorOfCartesianProduct(lists) do Print(x,"\n");od; > [ 1, 4 ] > [ 1, 5 ] > [ 2, 4 ] > [ 2, 5 ] > [ 3, 4 ] > [ 3, 5 ] > > This iterates over the cartesian product without generating the list of all tuples from it, and should work fast enough. > > Best wishes > Alexander > > > > On 16 Jan 2014, at 22:13, "Wolstenholme, Robert" wrote: > > > Thanks for the reply. I don't think I was clear enough with my initial question though so have given the example below: > > > > ################################################################################### > > Consider > > > > lists := [] > > lists[1] := [1,2,3] > > lists[2] := [4,5] > > > > I would now like to iterate over the cartesian product of lists[1] and lists[2] i.e. [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]. > > > > For an example this small, you could simply store the cartesian product itself in a list and iterate over that. This obviously becomes very inefficient if we have more lists with a larger number of values. > > > > > > A better way is, if we have n lists and size_rc[i] := Size(list[i]), we can avoid storing/calculating the Cartesian product with > > > > base := List([1..n], x -> 1); #We store the iteration step state in base > > while base <> size_rc do > > > > #Perform whatever list[i][base[i]] calculations here > > > > #Execute the incrementor > > base[1] := base[1] + 1; > > for j in [2..n] do > > if base[j-1] = size_rc[j-1] + 1 then > > base[j] := base[j] + 1; > > base[j-1] := 1; > > fi; > > od; > > od; > > > > then at each loop of the while base contains the values we need. > > > > However this is still far slower than the Python implementation I mentioned before. I was wondering if there was a way in GAP to speed up this iteration (maybe by pointing to the memory locations of the lists)? > > > > Thanks, > > Rob > > > > ________________________________________ > > From: Alexander Konovalov [alexander.konovalov at gmail.com] > > Sent: 16 January 2014 22:01 > > To: Wolstenholme, Robert > > Cc: forum at mail.gap-system.org > > Subject: Re: [GAP Forum] Iteration Over Lists of Lists > > > > On 16 Jan 2014, at 20:03, "Wolstenholme, Robert" wrote: > > > >> Is there a way in GAP to 'quickly' iterate of lists of lists i.e. like the Python itertools.product() function? > >> > > > > Yes, see 21.20 Operations for Lists' from the GAP Reference Manual. You may enter ?Operations for Lists' in GAP or see it online at > > > > http://www.gap-system.org/Manuals/doc/ref/chap21.html#X7DF510F7848CBBFD > > > > A random example just to expose the syntax and some functions: > > > > gap> l:=List([1..10],i -> [1..i]); > > [ [ 1 ], [ 1, 2 ], [ 1 .. 3 ], [ 1 .. 4 ], [ 1 .. 5 ], [ 1 .. 6 ], > > [ 1 .. 7 ], [ 1 .. 8 ], [ 1 .. 9 ], [ 1 .. 10 ] ] > > gap> Sum( List( l, x -> Product( List( x, Fibonacci ) ) ) ); > > 124819000 > > > > > > HTH, > > Alexander > > > > > > > > > > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From burkhard at hoefling.name Fri Jan 17 11:57:59 2014 From: burkhard at hoefling.name (=?windows-1252?Q?Burkhard_H=F6fling?=) Date: Fri, 17 Jan 2014 12:57:59 +0100 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <20140117112830.GA15939@cs.ox.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> <20140117112830.GA15939@cs.ox.ac.uk> Message-ID: <59BC44BE-8562-4938-AC6E-8FABC1369189@hoefling.name> Dear Robert, >> Thanks, this is what I wanted. >> However, I timed it this morning and found it to actually be slower than the method I previously mentioned (currently speed is of significant importance for what I'm doing). I've included the test script below. You can vary the values of n (number of lists) and k (size of lists). Note for n=6 and k=9 I am getting, Iterators cause a lot of overhead per call. If you just modify your code a bit, you should get close to Python speed with GAP. On my machine, I get teratorOfCartesianProduct Method: 915 ms Your Mentioned Method : 493 ms variant below: : 125 ms (didn?t try Python). Cheers Burkhard. size_rc := List([1..n], x -> k); base := List([1..n], x -> 1); #We store the iteration step state in base a := 1; start := Runtime(); stop := false; repeat #Perform whatever list[i][base[i]] calculations here #a := a + 1; #Print("Base: ", base, "\n"); #Execute the incrementor base[1] := base[1] + 1; j := 1; while base[j] > size_rc[j] and j < n do base[j] := 1; j := j + 1; base[j] := base[j] + 1; od; until j = n and base[n] > size_rc[n]; total2 := Runtime() - start; From robert.wolstenholme08 at imperial.ac.uk Fri Jan 17 12:12:19 2014 From: robert.wolstenholme08 at imperial.ac.uk (Wolstenholme, Robert) Date: Fri, 17 Jan 2014 12:12:19 +0000 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <59BC44BE-8562-4938-AC6E-8FABC1369189@hoefling.name> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> <20140117112830.GA15939@cs.ox.ac.uk>, <59BC44BE-8562-4938-AC6E-8FABC1369189@hoefling.name> Message-ID: <5252654327565F489A4402B674A4F6AD8A65E7AE@icexch-m1.ic.ac.uk> Great, results for n=6, k=9 on my machine, IteratorOfCartesianProduct Method : 452ms Initial Mentioned Method : 203ms Burkhard's Method : 047ms Python : 066ms Many thanks everyone, Rob ________________________________________ From: Burkhard H?fling [burkhard at hoefling.name] Sent: 17 January 2014 11:57 To: forum at mail.gap-system.org Cc: Wolstenholme, Robert; Alexander Konovalov; Dmitrii Pasechnik Subject: Re: [GAP Forum] Iteration Over Lists of Lists Dear Robert, >> Thanks, this is what I wanted. >> However, I timed it this morning and found it to actually be slower than the method I previously mentioned (currently speed is of significant importance for what I'm doing). I've included the test script below. You can vary the values of n (number of lists) and k (size of lists). Note for n=6 and k=9 I am getting, Iterators cause a lot of overhead per call. If you just modify your code a bit, you should get close to Python speed with GAP. On my machine, I get teratorOfCartesianProduct Method: 915 ms Your Mentioned Method : 493 ms variant below: : 125 ms (didn?t try Python). Cheers Burkhard. size_rc := List([1..n], x -> k); base := List([1..n], x -> 1); #We store the iteration step state in base a := 1; start := Runtime(); stop := false; repeat #Perform whatever list[i][base[i]] calculations here #a := a + 1; #Print("Base: ", base, "\n"); #Execute the incrementor base[1] := base[1] + 1; j := 1; while base[j] > size_rc[j] and j < n do base[j] := 1; j := j + 1; base[j] := base[j] + 1; od; until j = n and base[n] > size_rc[n]; total2 := Runtime() - start; From frank.luebeck at math.rwth-aachen.de Fri Jan 17 22:34:03 2014 From: frank.luebeck at math.rwth-aachen.de (Frank =?iso-8859-1?Q?L=FCbeck?=) Date: Fri, 17 Jan 2014 23:34:03 +0100 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> Message-ID: <20140117223403.GA29871@alkor.math.rwth-aachen.de> Dear Robert, dear Forum, Burkhard already pointed out that the "fast" loop in Robert's example did some unnecessary checks that made it slower than necessary. The timing comparison with a loop over IteratorOfCartesianProduct(lol) is not quite fair, because running over this iterator really produces each element of the Cartesian product as a new GAP object. (that is List([1..n], i-> lol[i][base[i]]) in the notation of Robert's loop). So, if you are not really interested in these tuples as separate objects but just want to look at them in your loop, then using the iterator produces a lot of unnecessary garbage for GAP's memory manager. Robert's question reminded me that I have written a small utility function 'IteratedFor' which does an iterated for-loop. A function fun(tup) is applied to all elements tup of the Cartesian product of a list of lists (or other objects over which GAP can iterate). Note that here entries of tup are accessed by 'tup[i]' which is more efficent than 'lol[i][base[i]]'. I append this utility below together with some usage examples. (Maybe this should go into the GAP library?) With best regards, Frank ########################################################################### ## #F IteratedFor( lol, fun ) . . . . . . . . . . . . . iterated 'for'-loop ## ## lol: a list of lists ## fun( tup ): a function to be called for all tup running through the ## Cartesian product of the lists in lol in alphabetical order ## ## fun must return a value, when it returns 'false' the iterated loops ## are stopped (so, this is like a 'break' for all nested loops). ## ## The argument tup is the same GAP object in all calls of fun, the entries ## of tup are changed during the loop. This means that you should never change ## tup within fun. And if you want to store tup somewhere then make a ## ShallowCopy of it. ## IteratedForInternal := function(lol, fun, tup, i, lenlol) local loli, x, n; for x in lol[i] do tup[i] := x; if i = lenlol then if fun(tup) = false then return false; fi; else if IteratedForInternal(lol, fun, tup, i+1, lenlol) = false then return false; fi; fi; od; return true; end; IteratedFor := function(lol, fun) local tup, n; tup := EmptyPlist(Length(lol)); IteratedForInternal(lol, fun, tup, 1, Length(lol)); end; ############### EXAMPLES ########################################## IteratedFor([[1..2],[1..3],[1..4]], function(tup) Print(tup,"\n"); return true; end); # Robert's benchmark example n := 6; k := 9; lol := List([1..n], i-> [1..k]); a := 0; IteratedFor(lol, function(tup) ## do this if you want to change or store tup: #tup := ShallowCopy(tup); a := a+1; return true; end); time; # and here with a 'break' IteratedFor(lol, function(tup) a := a+1; if tup[3] = 7 then Print(tup); return false; else return true; fi; end); -- /// Dr. Frank L?beck, Lehrstuhl D f?r Mathematik, Templergraben 64, \\\ 52062 Aachen, Germany /// E-mail: Frank.Luebeck at Math.RWTH-Aachen.De \\\ WWW: http://www.math.rwth-aachen.de/~Frank.Luebeck/ From Bill.Allombert at math.u-bordeaux.fr Fri Jan 17 12:44:33 2014 From: Bill.Allombert at math.u-bordeaux.fr (Bill Allombert) Date: Fri, 17 Jan 2014 13:44:33 +0100 Subject: [GAP Forum] Iteration Over Lists of Lists In-Reply-To: <5252654327565F489A4402B674A4F6AD8A65E7AE@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A65E730@icexch-m1.ic.ac.uk> <9A646FF8-CE94-487E-AE2F-4B8ED291FEDE@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E774@icexch-m1.ic.ac.uk> <056A4CFB-F130-4742-9FC9-CE2823D4187E@gmail.com> <5252654327565F489A4402B674A4F6AD8A65E791@icexch-m1.ic.ac.uk> <20140117112830.GA15939@cs.ox.ac.uk> <59BC44BE-8562-4938-AC6E-8FABC1369189@hoefling.name> <5252654327565F489A4402B674A4F6AD8A65E7AE@icexch-m1.ic.ac.uk> Message-ID: <20140117124433.GC17080@yellowpig> On Fri, Jan 17, 2014 at 12:12:19PM +0000, Wolstenholme, Robert wrote: > Great, results for n=6, k=9 on my machine, > > IteratorOfCartesianProduct Method : 452ms > Initial Mentioned Method : 203ms > Burkhard's Method : 047ms > Python : 066ms You can also use the GAP compiler gac to speed things even more. Burkhard take 12ms once compiled on my laptop. Cheers, Bill. From matan at svgalib.org Mon Jan 20 12:29:28 2014 From: matan at svgalib.org (Matan Ziv-Av) Date: Mon, 20 Jan 2014 14:29:28 +0200 (IST) Subject: [GAP Forum] Utility functions for reading files Message-ID: Hello, When people distribute data in GAP format, they sometimes[1][2] do it using files that can be used with the Read() function, assigning the results to some predetermined named variables. This introduces a few problems, such as when wanting to read the results from a few files into a list, or when trying to read the results from within a function. Two examples: gap> PrintTo("file","a:=1;\n"); gap> b:=function() Read("file"); return a; end;; Syntax error: warning: unbound global variable b:=function() Read("file"); return a; end;; ^ Or: gap> a:=2; 2 gap> b:=function() local a; a:=3; Read("file"); return a; end;; gap> b(); 3 gap> a; 1 I think that including the following counterparts to ReadAsFunction() might allow people to distribute the data in a more convenient way. ReadAsList:=function(n) local f,e; f:=InputTextFile(n); e:=ReadAll(f); CloseStream(f); return EvalString(Concatenation("[",e,"]")); end; ReadAsExpression:=function(n) local f,e; f:=InputTextFile(n); e:=ReadAll(f); CloseStream(f); return EvalString(e); end; [1] http://math.shinshu-u.ac.jp/~hanaki/as/ [2] http://www.math.tu-dresden.de/~reichard/schur/ -- Matan. From anvita21 at gmail.com Tue Jan 21 12:01:08 2014 From: anvita21 at gmail.com (Anvita) Date: Tue, 21 Jan 2014 19:01:08 +0700 Subject: [GAP Forum] Understanding MatrixByBlockMatrix Message-ID: Dear Forum, How can I avoid getting an error when trying to convert a block matrix to an ordinary one in the following example? If I enter "return;" in the break loop, I get a "segmentation fault" followed by a crash of GAP session. Thank you. Anvita z:=Z(4); bm:=BlockMatrix( [[1,1,[[z]]], [2,2,[[z]]]],2,2); Display(bm); MatrixByBlockMatrix(bm); gap> z:=Z(4); Z(2^2) gap> gap> bm:=BlockMatrix( > [[1,1,[[z]]], > [2,2,[[z]]]],2,2); gap> gap> Display(bm); z = Z(4) z^1 . . z^1 gap> gap> MatrixByBlockMatrix(bm); Error, You cannot convert a locked vector compressed over GF(2) to GF(4) in mat{[ (i - 1) * blockmat!.rpb + 1 .. i * blockmat!.rpb ]}{ [ (j - 1) * blockmat!.cpb + 1 .. j * blockmat!.cpb ]} := MatrixByBlockMatrix( block[3] ); called from ( ) called from read-eval loop at line 17 of *stdin* You can return;' to ignore the conversion brk> return; Segmentation fault (core dumped) From w_becker at hotmail.com Thu Jan 23 15:49:41 2014 From: w_becker at hotmail.com (Walter Becker) Date: Thu, 23 Jan 2014 06:49:41 -0900 Subject: [GAP Forum] quotient group homomorphisms Message-ID: The question here is how to display the mapping (homomorphism) h:G---->G/N[i] on the generators of the group G. For a specific case try this: G is Ho,(C_4 X C_2) this is group number 259 in the Hall-Senior Tables and group number 138 in the Small group Library. A specific presentation here is f:=FreeGroup("a", "b", "c" ); g:=f/[f.1^2, f.2^2, f.3^2, (f.1^-1*f.2^-1*f.1*f.2)^2, (f.1^-1*f.3^-1*f.1*f.3)^2, (f.2^-1*f.3^-1*f.2*f.3), (f.1^-1*f.2^-1*f.1*f.2)^-1*f.3^-1*(f.1^-1*f.2^-1*f.1*f.2)*f.3* ((f.1^-1*f.3^-1*f.1*f.3)^-1*f.2^-1*(f.1^-1*f.3^-1*f.1*f.3)*f.2)^-1 ]; The subgroups of most interest here are (C_2 X C_2)wr C_2 of order 32 of which there are 3 cases. Most specivically what are the images h(f.1), h(f.2) and h(f.3). Thanks Walter Becker From anvita21 at gmail.com Sun Jan 26 11:27:01 2014 From: anvita21 at gmail.com (Anvita) Date: Sun, 26 Jan 2014 18:27:01 +0700 Subject: [GAP Forum] On character tables of O8+(7) and U6(4) Message-ID: Dear Forum, As I ran through the list of GAP's character table names of simple groups returned by AllCharacterTableNames(IsSimple,true); with the purpose to detect multiple names for the same table, I used the function NamesOfEquivalentLibraryCharacterTables successfully for all groups, except O8+(7) and U6(4). The commands NamesOfEquivalentLibraryCharacterTables(CharacterTable("O8+(7)")); NamesOfEquivalentLibraryCharacterTables(CharacterTable("U6(4)")); seem to never finish, even though groups much larger than those two present no problem: gap> NamesOfEquivalentLibraryCharacterTables(CharacterTable("M")); [ "M" ] I was just wondering if there is an explanation to this. Anvita From sam at Math.RWTH-Aachen.De Sun Jan 26 13:35:57 2014 From: sam at Math.RWTH-Aachen.De (Thomas Breuer) Date: Sun, 26 Jan 2014 14:35:57 +0100 Subject: [GAP Forum] On character tables of O8+(7) and U6(4) In-Reply-To: References: Message-ID: <20140126133557.GA17324@gemma.math.rwth-aachen.de> Dear GAP Forum, Anvita wrote > As I ran through the list of GAP's character table names of simple groups > returned by > > AllCharacterTableNames(IsSimple,true); > > with the purpose to detect multiple names for the same table, I used the > function > > NamesOfEquivalentLibraryCharacterTables > > successfully for all groups, except O8+(7) and U6(4). > The commands > > NamesOfEquivalentLibraryCharacterTables(CharacterTable("O8+(7)")); > NamesOfEquivalentLibraryCharacterTables(CharacterTable("U6(4)")); > > seem to never finish, even though groups much larger than those two present > no problem: > > gap> NamesOfEquivalentLibraryCharacterTables(CharacterTable("M")); > [ "M" ] > > I was just wondering if there is an explanation to this. The reason is that for these two tables, checking the equivalence of the table with itself takes a long time, due to the fact that no table automorphisms are stored for them. In the next version of the CTblLib package, this problem will disappear. Two more remarks: 1. For running over library tables of simple groups without duplicates, one can call 'AllCharacterTableNames( IsSimple, true, IsDuplicateTable, false )'. 2. Often the complexity of character theoretic computations depends much more on the number of conjugacy classes of the group in question than on the group order. This can be viewed as one of the strengths of character theory. All the best, Thomas Breuer From anvita21 at gmail.com Mon Jan 27 04:30:39 2014 From: anvita21 at gmail.com (Anvita) Date: Mon, 27 Jan 2014 11:30:39 +0700 Subject: [GAP Forum] On character tables of O8+(7) and U6(4) In-Reply-To: <20140126133557.GA17324@gemma.math.rwth-aachen.de> References: <20140126133557.GA17324@gemma.math.rwth-aachen.de> Message-ID: On Sun, Jan 26, 2014 at 8:35 PM, Thomas Breuer wrote: > 1. For running over library tables of simple groups without duplicates, > one can call > 'AllCharacterTableNames( IsSimple, true, IsDuplicateTable, false )'. > Unfortunately, this list does not seem to be duplicate-free as it contains, for example, "A10" and "Alt(10)" as distinct entries. Anvita From A.Langworthy at uea.ac.uk Mon Jan 27 13:46:33 2014 From: A.Langworthy at uea.ac.uk (Andrew Langworthy (MTH)) Date: Mon, 27 Jan 2014 13:46:33 +0000 Subject: [GAP Forum] Algebras Message-ID: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> Dear Forum, I am trying to define algebra maps between a free associative algebra with a one on n generators (modulo some relations), and itself. I am using the command "AlgebraGeneralMappingByImages", but keep getting errors, specifically the "no method found" one. (same thing happens for AlgebraWithOneGeneralMappingByImages) I have tried various "with/without one" combinations without success. I know that some of the algebra maps are not yet implemented in GAP (at least that is what it tells me when I try an use the command AlgebraHomomorphismByImages), but I cannot seem to get anywhere. Am I making some silly mistake? Thanks, Andrew In case anyone wants it, here is my code rewrite:=FreeAssociativeAlgebraWithOne(Rationals,n,"s"); genalg:=GeneratorsOfAlgebra(rewrite); rels1:=[]; for i in [1..n] do AddSet(rels1,genalg[i]^2-genalg[i]); for j in [1..n] do AddSet(rels1,genalg[i]*genalg[j]-genalg[j]*genalg[i]); od; od; RLalg:=rewrite/rels1; s:=GeneratorsOfAlgebra(RLalg); #EPSILON IN RLalg imep:=[1..n+1]; for i in [1..n+1] do imep[i]:=(0)*s[1]; od; for i in [2..n+1] do imep[1]:=imep[1]+s[i]; #Defines imep1 for j in [2..n+1] do imep[i]:=imep[i]+s[i]*s[j]; od; imep[i]:=imep[i]-s[i]*s[i]; #removes the duplicates od; epsilon:=AlgebraGeneralMappingByImages(RLalg,RLalg,s,imep); From sam at Math.RWTH-Aachen.De Mon Jan 27 16:22:12 2014 From: sam at Math.RWTH-Aachen.De (Thomas Breuer) Date: Mon, 27 Jan 2014 17:22:12 +0100 Subject: [GAP Forum] On character tables of O8+(7) and U6(4) In-Reply-To: References: <20140126133557.GA17324@gemma.math.rwth-aachen.de> Message-ID: <20140127162212.GA10815@gemma.math.rwth-aachen.de> Dear Anvita, you wrote > On Sun, Jan 26, 2014 at 8:35 PM, Thomas Breuer wrote: > > > 1. For running over library tables of simple groups without duplicates, > > one can call > > 'AllCharacterTableNames( IsSimple, true, IsDuplicateTable, false )'. > > > > > Unfortunately, this list does not seem to be duplicate-free as it contains, > for example, "A10" and "Alt(10)" as distinct entries. You are right. Some character tables contributed by the 'SpinSym' package are not known to the mechanism behind 'IsDuplicateTable'. This bug will be fixed in the next version of the Character Table Library. As a workaround for the moment, you can start GAP without the 'SpinSym' package when you are interested in running over character tables without duplicates. All the best, Thomas From max at quendi.de Tue Jan 28 00:33:26 2014 From: max at quendi.de (Max Horn) Date: Tue, 28 Jan 2014 01:33:26 +0100 Subject: [GAP Forum] quotient group homomorphisms In-Reply-To: References: Message-ID: Dear Walter, On 23.01.2014, at 16:49, Walter Becker wrote: > The question here is how to display the mapping (homomorphism) > > h:G---->G/N[i] > > on the generators of the group G. For a specific case try this: > > > > G is Ho,(C_4 X C_2) this is group number 259 in the Hall-Senior > > Tables and group number 138 in the Small group Library. It is not clear to me what N[i] is in your general description and/or in your specific example. Some normal subgroup, I assume, but which? > A specific presentation here is > > f:=FreeGroup("a", "b", "c" ); > g:=f/[f.1^2, > f.2^2, > f.3^2, > (f.1^-1*f.2^-1*f.1*f.2)^2, > (f.1^-1*f.3^-1*f.1*f.3)^2, > (f.2^-1*f.3^-1*f.2*f.3), > (f.1^-1*f.2^-1*f.1*f.2)^-1*f.3^-1*(f.1^-1*f.2^-1*f.1*f.2)*f.3* > ((f.1^-1*f.3^-1*f.1*f.3)^-1*f.2^-1*(f.1^-1*f.3^-1*f.1*f.3)*f.2)^-1 > ]; > > > > The subgroups of most interest here are (C_2 X C_2)wr C_2 > > of order 32 of which there are 3 cases. Do you mean that these are the normal subgroups you want to factor out? Anyway, I don't know which subgroups you mean exactly. But for the sake of argument, let's just take any. E.g. the normal closure of the subgroup generated by the first gneerator: gap> n:=NormalClosure(g, Subgroup(g,[g.1])); Group() gap> Size(n); 16 > Most specivically what are the images > > h(f.1), h(f.2) and h(f.3). This can be done as follows. First, you need to obtain the quotient map h: gap> h:=NaturalHomomorphismByNormalSubgroup(g,n); [ a, b, c ] -> [ (), (1,2)(3,4), (1,3)(2,4) ] Then you can use it to compute the images of the generators: gap> Image(h, g.1); () gap> Image(h, g.2); (1,2)(3,4) gap> Image(h, g.3); (1,3)(2,4) # There is also a shortcut notation: gap> g.3^h; (1,3)(2,4) Hope that helps, Max From max at quendi.de Tue Jan 28 09:11:49 2014 From: max at quendi.de (Max Horn) Date: Tue, 28 Jan 2014 10:11:49 +0100 Subject: [GAP Forum] Algebras In-Reply-To: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> Message-ID: <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> Dear Andrew, On 27.01.2014, at 14:46, "Andrew Langworthy (MTH)" wrote: > Dear Forum, > > I am trying to define algebra maps between a free associative algebra with a one on n generators (modulo some relations), and itself. I am using the command "AlgebraGeneralMappingByImages", but keep getting errors, specifically the "no method found" one. (same thing happens for AlgebraWithOneGeneralMappingByImages) > > I have tried various "with/without one" combinations without success. I know that some of the algebra maps are not yet implemented in GAP (at least that is what it tells me when I try an use the command AlgebraHomomorphismByImages), but I cannot seem to get anywhere. > > Am I making some silly mistake? Perhaps, perhaps not... Your concrete map strikes me as strange (see below). But in general: Not really -- it is simply as you already put it: A lot of that code is not (yet?) implemented in GAP. Basically nothing around free associative algebras (FAAs), to be precise. I guess this is partially due to a lack of need, partially due to the fact that many things related to FAAs are quite hard to do right and require e.g. non-commutative Gr?bner basis calculations... Though not really in your example. As a matter of fact, the code you give below executes just fine for me in the latest GAP development version (and I would hope in GAP 4.7.2). It is only when trying to compute an image under the homomorphism "epsilon" that things break down. Partially due to missing features, partially due to something strange about your "map" (which isn't a well-defined map, details at the end of mail). Anyway, in this particular case, it might be possible to fix that, but I am pretty sure you'd end up running into some other unimplemented feature :-/. However, if all the examples you are looking at are like the one you gave here, there is some hope: [...] > In case anyone wants it, here is my code > > rewrite:=FreeAssociativeAlgebraWithOne(Rationals,n,"s"); > > genalg:=GeneratorsOfAlgebra(rewrite); > rels1:=[]; > > for i in [1..n] do > AddSet(rels1,genalg[i]^2-genalg[i]); > > for j in [1..n] do > AddSet(rels1,genalg[i]*genalg[j]-genalg[j]*genalg[i]); ^^^ The code above basically says that all your generators commute, and have order 2. This should be tractable, even with less powerful things than FAAs. Indeed, your algebra is basically the group ring of an elementary abelian group of order 2^n. Try this: G:=ElementaryAbelianGroup(2^n); RLalg:=GroupRing(Rationals, G); Then, let's go on as with in your code: > > > s:=GeneratorsOfAlgebra(RLalg); > > #EPSILON IN RLalg > > imep:=[1..n+1]; > > for i in [1..n+1] do > imep[i]:=(0)*s[1]; > od; > > for i in [2..n+1] do > imep[1]:=imep[1]+s[i]; #Defines imep1 > > for j in [2..n+1] do > imep[i]:=imep[i]+s[i]*s[j]; > od; > > imep[i]:=imep[i]-s[i]*s[i]; #removes the duplicates > od; > > > epsilon:=AlgebraGeneralMappingByImages(RLalg,RLalg,s,imep); Now let's try to compute an image: gap> ImageElm(epsilon, s[1]); Error, must be single-valued and total called from ( ) called from read-eval loop at line 91 of *stdin* you can 'quit;' to quit to outer loop, or you can 'return;' to continue Huh? Turns out the "map" is not a mapping: gap> IsSingleValued(epsilon); false Indeed: gap> s; [ (1)* of ..., (1)*f1, (1)*f2, (1)*f3 ] gap> imep; [ (1)*f1+(1)*f2+(1)*f3, (1)*f1*f2+(1)*f1*f3, (1)*f1*f2+(1)*f2*f3, (1)*f1*f3+(1)*f2*f3 ] gap> You tell it to map the one of the ring to imep[1] = f1 + f2 + f3 But at the same time, you tell it to map f1 to f1*f2+f1*f3. But then 1 = f1^2 is als mapped to (f1*f2+f1*f3) = 2 + 2*f2*f3 So, the "map" is not well-defined. Cheers, Max From r_n_tsai at yahoo.com Tue Jan 28 19:29:44 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Tue, 28 Jan 2014 11:29:44 -0800 (PST) Subject: [GAP Forum] Algebras In-Reply-To: <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> Message-ID: <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> Dear Forum, I happen to be very interested in free associative algebras modulo some relations. So let me follow up this response with a few comments : - There appears to be a package for non commutative groebner basis (gbnp). See example? ? http://mathoverflow.net/questions/87338/basis-of-a-finite-dimensional-algebra-with-a-finitely-generated-relation-set-by - I tried this package with different relations but without luck; the program hits its internal recursion limit... What I'd like to ask is the following : How would the following algebras be defined as quotients of free associative algebras with one : (1)free abelian associative algebra ? ?(this should be as simple as adding relations [a*b-b*a,....] (2)clifford algebra ? ?(relations [a*a-1,b*b-1,....]) (3)weyl (or symplectic clifford) algebra ? ?(relations [a*b-b*a-1,....] Are the above examples doable within gap or any of the packages (including gbnp)? If so some code sniplets would be appreciated. If it is not doable, please let me know so I can stop trying :-) Thanks, R.N. On Tuesday, January 28, 2014 1:13 AM, Max Horn wrote: Dear Andrew, On 27.01.2014, at 14:46, "Andrew Langworthy (MTH)" wrote: > Dear Forum, > > I am trying to define algebra maps between a free associative algebra with a one on n generators (modulo some relations), and itself. I am using the command "AlgebraGeneralMappingByImages", but keep getting errors, specifically the "no method found" one. (same thing happens for AlgebraWithOneGeneralMappingByImages) > > I have tried various "with/without one" combinations without success. I know that some of the algebra maps are not yet implemented in GAP (at least that is what it tells me when I try an use the command AlgebraHomomorphismByImages), but I cannot seem to get anywhere. > > Am I making some silly mistake? Perhaps, perhaps not... Your concrete map strikes me as strange (see below). But in general: Not really -- it is simply as you already put it: A lot of that code is not (yet?) implemented in GAP. Basically nothing around free associative algebras (FAAs), to be precise. I guess this is partially due to a lack of need, partially due to the fact that many things related to FAAs are quite hard to do right and require e.g. non-commutative Gr?bner basis calculations... Though not really in your example. As a matter of fact, the code you give below executes just fine for me in the latest GAP development version (and I would hope in GAP 4.7.2). It is only when trying to compute an image under the homomorphism "epsilon" that things break down. Partially due to missing features, partially due to something strange about your "map" (which isn't a well-defined map, details at the end of mail). Anyway, in this particular case, it might be possible to fix that, but I am pretty sure you'd end up running into some other unimplemented feature :-/. However, if all the examples you are looking at are like the one you gave here, there is some hope: [...] > In case anyone wants it, here is my code > > rewrite:=FreeAssociativeAlgebraWithOne(Rationals,n,"s"); > > genalg:=GeneratorsOfAlgebra(rewrite); > rels1:=[]; > > for i in [1..n] do >? AddSet(rels1,genalg[i]^2-genalg[i]); > >? for j in [1..n] do >? ? ? AddSet(rels1,genalg[i]*genalg[j]-genalg[j]*genalg[i]); ^^^ The code above basically says that all your generators commute, and have order 2. This should be tractable, even with less powerful things than FAAs. Indeed, your algebra is basically the group ring of an elementary abelian group of order 2^n. Try this: G:=ElementaryAbelianGroup(2^n); RLalg:=GroupRing(Rationals, G); Then, let's go on as with in your code: > > > s:=GeneratorsOfAlgebra(RLalg); > >? ? ? ? ? ? ? #EPSILON IN RLalg > > imep:=[1..n+1]; > > for i in [1..n+1] do >? imep[i]:=(0)*s[1]; > od; > > for i in [2..n+1] do >? imep[1]:=imep[1]+s[i]; #Defines imep1 > >? for j in [2..n+1] do >? ? ? imep[i]:=imep[i]+s[i]*s[j]; >? od; > >? imep[i]:=imep[i]-s[i]*s[i]; #removes the duplicates > od; > > > epsilon:=AlgebraGeneralMappingByImages(RLalg,RLalg,s,imep); Now let's try to compute an image: gap> ImageElm(epsilon, s[1]); Error, must be single-valued and total called from ( ) called from read-eval loop at line 91 of *stdin* you can 'quit;' to quit to outer loop, or you can 'return;' to continue Huh? Turns out the "map" is not a mapping: gap> IsSingleValued(epsilon); false Indeed: gap> s; [ (1)* of ..., (1)*f1, (1)*f2, (1)*f3 ] gap> imep; [ (1)*f1+(1)*f2+(1)*f3, (1)*f1*f2+(1)*f1*f3, (1)*f1*f2+(1)*f2*f3, (1)*f1*f3+(1)*f2*f3 ] gap> You tell it to map the one of the ring to imep[1] = f1 + f2 + f3 But at the same time, you tell it to map f1 to f1*f2+f1*f3. But then 1 = f1^2 is als mapped to (f1*f2+f1*f3) = 2 + 2*f2*f3 So, the "map" is not well-defined. Cheers, Max _______________________________________________ Forum mailing list Forum at mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum From max at quendi.de Tue Jan 28 20:34:57 2014 From: max at quendi.de (Max Horn) Date: Tue, 28 Jan 2014 21:34:57 +0100 Subject: [GAP Forum] Algebras In-Reply-To: <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> Message-ID: <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> Dear R.N., On 28.01.2014, at 20:29, "R.N. Tsai" wrote: > Dear Forum, > > I happen to be very interested in free associative algebras modulo some relations. > > So let me follow up this response with a few comments : > > - There appears to be a package for non commutative groebner basis (gbnp). See example > http://mathoverflow.net/questions/87338/basis-of-a-finite-dimensional-algebra-with-a-finitely-generated-relation-set-by > > - I tried this package with different relations but without luck; the program hits its internal recursion limit... I have used GBNP successfully in the past with e.g. BMW algebras. But of course anything dealing with Gr?bner bases in free associative algebras is bound to hit some snags at some point... But in the examples you list below, GBNP should easily work... If you tell us what exactly you tried, perhaps we can give some advice. > > What I'd like to ask is the following : > > How would the following algebras be defined as quotients of free associative algebras with one : > > (1)free abelian associative algebra > (this should be as simple as adding relations [a*b-b*a,....] These are also known as "polynomial rings" ;-). So you can use these in GAP. > (2)clifford algebra > (relations [a*a-1,b*b-1,....]) These are finite dimensional, so one can deal with them in GAP via structure constants table. I have written some code for for that recently, as I have to deal with them in a research project. I am using another quadratic form (a^2 = -1) than the one you want (a^2 = +1), but that can be easily fixed by changing a single line. Code follows at the end of this email. > (3)weyl (or symplectic clifford) algebra > (relations [a*b-b*a-1,....] This one is not finite dimensional, and thus can't be dealt with in the way above. If I had to work with it, I'd try to use GBNP. Or possible I'd not use GAP and instead try the PLURAL library of the Singular project... (And I hope that in the not so distant future, both can in fact be used from within with help of the libsing project... but it's not yet ready). Note that I'd prefer if this was doable via the "naive" (or "logical"?) approach of taking a FreeAssociateAlgebra and factoring out an ideal of relations. Indeed, one way to implement that would be to take GBNP, and writing some wrappers around it. This would be a win for both GAP (gains functionality) and GBNP (gains a nicer user interface ;-). It might be a task for a bachelor student, or Google Summer of Code or so... > > Are the above examples doable within gap or any of the packages (including gbnp)? > If so some code sniplets would be appreciated. If it is not doable, please > let me know so I can stop trying :-) I hope the above helps you a bit! Finally, here is my code for clifford algebras (this mailing list doesn't allow attachments, so I am putting it inline). The line you need to change is marked with a comment. # F is the field (or ring) of coefficients, n the number of generators CliffordAlgebra := function(F, n) local elems, names, e, T, i, j, x, y, z, sign, k, tmp; elems := Combinations([1..n]); names := []; for e in elems do if e = [] then Add(names, "id"); else Add(names, Concatenation(List(e,i -> Concatenation("e",String(i))))); fi; od; T := EmptySCTable( 2^n, 0 ); for i in [1..2^n] do x := elems[i]; for j in [1..2^n] do y := elems[j]; # Determine x * y; z := Concatenation(x, y); sign := 1; # normalize while not IsSet(z) do for k in [1..Length(z)-1] do if z[k] = z[k+1] then Remove(z, k); Remove(z, k); sign := -sign; # remove this to get the form a^2=1 break; elif z[k] > z[k+1] then tmp := z[k]; z[k] := z[k+1]; z[k+1] := tmp; sign := -sign; fi; od; od; SetEntrySCTable( T, i, j, [ sign, Position(elems, z) ] ); od; od; return AlgebraByStructureConstants( F, T, names ); end; R := CliffordAlgebra(Rationals, 4); AssignGeneratorVariables(R); Cheers, Max From r_n_tsai at yahoo.com Wed Jan 29 00:06:03 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Tue, 28 Jan 2014 16:06:03 -0800 (PST) Subject: [GAP Forum] Algebras In-Reply-To: <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> Message-ID: <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> Dear Max and forum, >I have used GBNP successfully in the past with e.g. BMW algebras. But of course anything >dealing with Gr?bner bases in free associative algebras is bound to hit some snags at some >point... But in the examples you list below, GBNP should easily work... If you tell us what >exactly you tried, perhaps we can give some advice. That's encouraging. I was expecting this to work too but even with the simplest example it fails. Here's what I tried : LoadPackage("gbnp"); A := FreeAssociativeAlgebraWithOne(Rationals,"a","b"); a := A.a; b := A.b; # all three rels below produce the same error rels := [a*b-b*a]; rels := [a*b-b*a-One(A)]; rels := [a*b+b*a-One(A)]; K := GP2NPList(rels); ? ? ? ? ? ? ? ? ? ? ? ? ?? G := SGrobner(K); Display(DimQA(G,2)); PrintNPList(BaseQA(G, 2, 0)); I get the same error for all three cases :? Error, recursion depth trap (5000) ?in ? if GBNP.LookUpOccurTreePTSLRPos( pol, ROT, false, 1 ) = 0 ?then ? ? count := count + countfun( pol, (lvl + 1) ) + 1; ? ? Unbind( pol[lvl + 1] ); fi; called from? countfun( pol, lvl + 1 ) called from countfun( pol, lvl + 1 ) called from countfun( pol, lvl + 1 ) called from countfun( pol, lvl + 1 ) called from countfun( pol, lvl + 1 ) called from You'd expect at least in the first case ([a*b-b*a]) things would work; but maybe there's something subtle I missed that breaks things. Hopefully if it is fixed for one it will apply to all 3. >Note that I'd prefer if this was doable via the "naive" (or "logical"?) approach of taking a >FreeAssociateAlgebra and factoring out an ideal of relations. Indeed, one way to implement that >would be to take GBNP, and writing some wrappers around it. This would be a win for both GAP >(gains functionality) and GBNP (gains a nicer user interface ;-). It might be a task for a >bachelor student, or Google Summer of Code or so... I know the clifford algebra is finite dimensional and can be defined through structure constants. The Weyl algebra can also defined as the universal enveloping algebra of a finite dimensional (Heisenberg) algebra with a further mapping of the center to 1. But I prefer the "naive" approach since it deals with clifford and weyl on the same footing. >Finally, here is my code for clifford algebras (this mailing list doesn't allow attachments, so >I am putting it inline). The line you need to change is marked with a comment. Thanks for the code. I will use this if it turns out the naive approach is a dead end. R.N. From max at quendi.de Wed Jan 29 09:41:39 2014 From: max at quendi.de (Max Horn) Date: Wed, 29 Jan 2014 10:41:39 +0100 Subject: [GAP Forum] Algebras In-Reply-To: <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> Message-ID: <312B5ECD-F19A-48E9-AE39-2F996BC4995B@quendi.de> Dear R.N., On 29.01.2014, at 01:06, "R.N. Tsai" wrote: [...] > > LoadPackage("gbnp"); > A := FreeAssociativeAlgebraWithOne(Rationals,"a","b"); > a := A.a; > b := A.b; > > # all three rels below produce the same error > rels := [a*b-b*a]; > rels := [a*b-b*a-One(A)]; > rels := [a*b+b*a-One(A)]; > > K := GP2NPList(rels); > G := SGrobner(K); > Display(DimQA(G,2)); > PrintNPList(BaseQA(G, 2, 0)); > > I get the same error for all three cases : You are asking for a basis of an infinite dimensional algebra in all three cases, so (as per the documentation of GBNP) it is unsurprising you are running into an error. It tries to recursively enumerate a basis, and fails. [...] > You'd expect at least in the first case ([a*b-b*a]) things would work; As I said in my previous email, in that case the algebra is polynomial algebra K[a,b] and thus I wouldn't expect it to work :-). It does work for a Clifford algebra, though (as that is finite dimensional): rels := [a*b+b*a, a*a-One(A), b*b-One(A)]; correctly gives the basis 1, a, b, ab If you want to work in these algebras, you don't want to compute a quotient. Rather, you want to be able to compute normal forms of elements, or at least to be able to decide if two "linear combinations of words" describe the same element of the algebra. Both can be done with non-commutative Gr?bner bases (ncGB): If you are looking at the quotient F/I of a free algebra F by an ideal I, and G is a ncGB of I, then deciding equality amounts to an ideal membership test: for x,y\in F, we have x+I = y+I iff x-y \in I. Computing normal forms is also possible, in GBNP this is what StrongNormalFormNP does. Here is a helper that assumes you have computed the ncGB G, and uses that to compute a normal form for an element x of the free algebra F modulo the ideal (i.e. a canonical representative of the coset x + I) NormalFormMod := x -> NP2GP(StrongNormalFormNP(GP2NP(x), G), A); For example, using rels := [a*b-b*a], we get gap> NormalFormMod(a^5*b^2 - b^2*a^3 - b*a^2*b*a^3); (-1)*a^3*b^2 And so on. This is slightly inconvenient. Nicer would be to have a high-level wrapper around (resp. in) GBNP which implements NaturalHomomorphismByIdeal (or an analogue of it). Cheers, Max From mohamed.barakat at rwth-aachen.de Wed Jan 29 11:57:41 2014 From: mohamed.barakat at rwth-aachen.de (Mohamed Barakat) Date: Wed, 29 Jan 2014 12:57:41 +0100 Subject: [GAP Forum] Algebras In-Reply-To: <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> Message-ID: <7A3235B7-15C3-4F02-A6F6-72E6AF39DB0D@rwth-aachen.de> Dear Tsai, the Weyl algebra and the exterior algebra (including GB computations) are supported through the homalg project?s interface to Singular/Plural/SCA. The clifford algebra can also be supported easily: gap> LoadPackage( "RingsForHomalg" ); true If this returns fail then probably because the package io fails to load; in this case please compile io, using ./configure and make gap> Q := HomalgFieldOfRationalsInSingular( ); Q gap> R := PolynomialRing( Q, "x,y,z" ); Q[x,y,z] gap> A := RingOfDerivations( R, "Dx,Dy,Dz" ); Q[x,y,z] All this and more is documented: gap> ?RingsForHomalg:Singular AssignGeneratorVariables does not yet work properly for Weyl algebras. This will be fixed in the next GAP release. For the moment: gap> x := "x" / A; x gap> Dx := "Dx" / A; Dx gap> Dx * x; x*Dx+1 The homalg project has at the moment its own matrix interface: gap> ?HomalgMatrix We are planning to comply with the new matrix interface in GAP once it becomes widely used. gap> mat := HomalgMatrix( "[x*Dy, Dx*x, z*Dx, 1+Dy]", 2, 2, A ); gap> Display( mat ); x*Dy,x*Dx+1, z*Dx,Dy+1 See also: gap> ?MatricesForHomalg:Matrices Best wishes, Mohamed From benjamin.sambale at gmail.com Wed Jan 29 15:27:15 2014 From: benjamin.sambale at gmail.com (Benjamin Sambale) Date: Wed, 29 Jan 2014 16:27:15 +0100 Subject: [GAP Forum] Order and Size Message-ID: <52E91DD3.1090606@gmail.com> Dear GAP users, I'm using GAP 4.7.2 and just ran into the following strange behavior: G:=AbelianGroup([4,4,4]);; A:=AutomorphismGroup(G);; x:=First(A,a->Order(a)<>Size(Group(a))); [ f1*f2*f3, f5, f1*f2*f6 ] -> [ f1, f1*f2*f4*f5*f6, f2*f3*f6 ] I thought that the order of an element is the same as the size of the generated group?? Indeed: x^Order(x); Pcgs([ f1, f2, f3, f4, f5, f6 ]) -> [ f1, f2, f3, f4, f4*f5*f6, f6 ] Any ideas? Best wishes, Benjamin From hulpke at fastmail.fm Wed Jan 29 16:14:25 2014 From: hulpke at fastmail.fm (Alexander Hulpke) Date: Wed, 29 Jan 2014 09:14:25 -0700 Subject: [GAP Forum] Order and Size In-Reply-To: <52E91DD3.1090606@gmail.com> References: <52E91DD3.1090606@gmail.com> Message-ID: <990F41C1-D063-4FF1-A12D-F25FD7CA04C3@fastmail.fm> Dear Forum, On Jan 29, 2014, at 1/29/14 8:27, Benjamin Sambale wrote: > Dear GAP users, > > I'm using GAP 4.7.2 and just ran into the following strange behavior: > > G:=AbelianGroup([4,4,4]);; > A:=AutomorphismGroup(G);; > x:=First(A,a->Order(a)<>Size(Group(a))); > [ f1*f2*f3, f5, f1*f2*f6 ] -> [ f1, f1*f2*f4*f5*f6, f2*f3*f6 ] Thank you for the report. This is a small oversight in the new method for element order for automorphisms. It only arises if an automorphism phi has a power phi^n that will be given on a longer generating set. (Automorphisms of abelian groups are the prime case of this I think.) This will be corrected in the next release. Regards, Alexander Hulpke From max at quendi.de Wed Jan 29 16:30:37 2014 From: max at quendi.de (Max Horn) Date: Wed, 29 Jan 2014 17:30:37 +0100 Subject: [GAP Forum] Order and Size In-Reply-To: <52E91DD3.1090606@gmail.com> References: <52E91DD3.1090606@gmail.com> Message-ID: <19A08756-9894-48A7-89B9-FA4A07AC81A0@quendi.de> Dear Benjamin, On 29.01.2014, at 16:27, Benjamin Sambale wrote: > Dear GAP users, > > I'm using GAP 4.7.2 and just ran into the following strange behavior: > > G:=AbelianGroup([4,4,4]);; > A:=AutomorphismGroup(G);; > x:=First(A,a->Order(a)<>Size(Group(a))); > [ f1*f2*f3, f5, f1*f2*f6 ] -> [ f1, f1*f2*f4*f5*f6, f2*f3*f6 ] > > I thought that the order of an element is the same as the size of the generated group?? Indeed: > > x^Order(x); > Pcgs([ f1, f2, f3, f4, f5, f6 ]) -> [ f1, f2, f3, f4, f4*f5*f6, f6 ] > > Any ideas? This is a bug in GAP :-(. It will be fixed in the next GAP release. In the meantime, you can paste this code into your GAP session to fix the issue: InstallMethod(Order,"for automorphisms",true,[IsGroupHomomorphism],0, function(hom) local map,phi,o,lo,i,start,img; o:=1; phi:=hom; map:=MappingGeneratorsImages(phi); i:=1; while i <= Length(map[1]) do lo:=1; start:=map[1][i]; img:=map[2][i]; while img<>start do img:=ImagesRepresentative(phi,img); lo:=lo+1; # do the bijectivity test only if high local order, then it does not # matter if lo=1000 and not IsBijective(hom) then Error(" must be bijective"); fi; od; if lo>1 then o:=o*lo; if i References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> <312B5ECD-F19A-48E9-AE39-2F996BC4995B@quendi.de> Message-ID: <1391035795.4835.YahooMailNeo@web121205.mail.ne1.yahoo.com> Dear Max and forum, > If you want to work in these algebras, you don't want to compute a quotient.? > Rather, you want to be able to compute normal forms of elements, You're absolutely right; this is all I needed. I didn't know GBNP had it already. > NormalFormMod := x -> NP2GP(StrongNormalFormNP(GP2NP(x), G), A); Very helpful...everything is working beautifully now for both weyl and cliford algebras...it's also fairly fast. How do I add GBNP to the list of packages that get loaded automatically? I couldn't figure that out from the gap manual. Thanks, R.N. From r_n_tsai at yahoo.com Wed Jan 29 23:20:33 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Wed, 29 Jan 2014 15:20:33 -0800 (PST) Subject: [GAP Forum] Algebras In-Reply-To: <7A3235B7-15C3-4F02-A6F6-72E6AF39DB0D@rwth-aachen.de> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> <7A3235B7-15C3-4F02-A6F6-72E6AF39DB0D@rwth-aachen.de> Message-ID: <1391037633.24458.YahooMailNeo@web121204.mail.ne1.yahoo.com> Dear Mohamed and forum, >the Weyl algebra and the exterior algebra (including GB computations) are supported through the >homalg project?s interface to Singular/Plural/SCA. The clifford algebra can also be supported >easily: gap> LoadPackage( "RingsForHomalg" ); true This seems to load ok but when I issue other commands I get errors about Singular not found... I'm pretty sure it's because I don't have Singular installed (I'm running under windows for now). I do have access to linux machines where I can configure Singular,... I'll try that there later. Thanks for your suggestion, R.N. _______________________________________________ Forum mailing list Forum at mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum From gordon.royle at uwa.edu.au Thu Jan 30 03:18:20 2014 From: gordon.royle at uwa.edu.au (Gordon Royle) Date: Thu, 30 Jan 2014 11:18:20 +0800 Subject: [GAP Forum] Strange sequence at beginning of GAP output Message-ID: <6B475AEF-81C8-4462-A93F-BDF7713CDFEE@uwa.edu.au> I am running some GAP commands that produce output that goes to a file. gap -q < input > output The GAP itself works ok, but the output ends up with the first line (only) starting with some invisible characters, here made visible with the Unix command ?od" 033 [ ? 1 0 3 4 h The ASCII 033 is a backslash so the actual string is \[?1034h Googling this indicates that it has something to do with the readline library, but it is most often associated with Python scripts, all of which is mysterious to me. All I want to know is how to stop GAP producing it. (OS is RedHat Enterprise Linux) Professor Gordon Royle School of Mathematics and Statistics University of Western Australia Gordon.Royle at uwa.edu.au From benjamin.sambale at gmail.com Thu Jan 30 07:46:09 2014 From: benjamin.sambale at gmail.com (Benjamin Sambale) Date: Thu, 30 Jan 2014 08:46:09 +0100 Subject: [GAP Forum] Order and Size In-Reply-To: <19A08756-9894-48A7-89B9-FA4A07AC81A0@quendi.de> References: <52E91DD3.1090606@gmail.com> <19A08756-9894-48A7-89B9-FA4A07AC81A0@quendi.de> Message-ID: <52EA0341.7010701@gmail.com> Thanks for the fix! It seems to work now. Benjamin Am 29.01.2014 17:30, schrieb Max Horn: > Dear Benjamin, > > On 29.01.2014, at 16:27, Benjamin Sambale wrote: > >> Dear GAP users, >> >> I'm using GAP 4.7.2 and just ran into the following strange behavior: >> >> G:=AbelianGroup([4,4,4]);; >> A:=AutomorphismGroup(G);; >> x:=First(A,a->Order(a)<>Size(Group(a))); >> [ f1*f2*f3, f5, f1*f2*f6 ] -> [ f1, f1*f2*f4*f5*f6, f2*f3*f6 ] >> >> I thought that the order of an element is the same as the size of the generated group?? Indeed: >> >> x^Order(x); >> Pcgs([ f1, f2, f3, f4, f5, f6 ]) -> [ f1, f2, f3, f4, f4*f5*f6, f6 ] >> >> Any ideas? > This is a bug in GAP :-(. It will be fixed in the next GAP release. In the meantime, you can paste this code into your GAP session to fix the issue: > > InstallMethod(Order,"for automorphisms",true,[IsGroupHomomorphism],0, > function(hom) > local map,phi,o,lo,i,start,img; > o:=1; > phi:=hom; > map:=MappingGeneratorsImages(phi); > i:=1; > while i <= Length(map[1]) do > lo:=1; > start:=map[1][i]; > img:=map[2][i]; > while img<>start do > img:=ImagesRepresentative(phi,img); > lo:=lo+1; > # do the bijectivity test only if high local order, then it does not > # matter > if lo=1000 and not IsBijective(hom) then > Error(" must be bijective"); > fi; > od; > if lo>1 then > o:=o*lo; > if i phi:=phi^lo; > map:=MappingGeneratorsImages(phi); > i:=0; > fi; > fi; > i:=i+1; > od; > return o; > end); > > > Thanks for the report, > Max From aner_2005 at hotmail.com Thu Jan 30 19:34:58 2014 From: aner_2005 at hotmail.com (Aner Ben-Efraim) Date: Thu, 30 Jan 2014 21:34:58 +0200 Subject: [GAP Forum] Fixed point free permutations of specific order Message-ID: Dear Forum, I am interested in getting all permutations of order n (order 2 is also good) in the group SymmetricGroup([2..m]), which keep no point in place. I have tried to use Filtered(SymmetricGroup([2..m]),x->Order(x)=n and NrMovedPoints(x)=m-1), but this gets extremely slow when m is double digit. I was wondering if there is a way to do this in reasonable time on my PC, at least for m up to say 17, or even 33 if possible. Thanks,Aner From dmitrii.pasechnik at cs.ox.ac.uk Thu Jan 30 20:54:33 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dmitrii Pasechnik) Date: Thu, 30 Jan 2014 20:54:33 +0000 Subject: [GAP Forum] Fixed point free permutations of specific order In-Reply-To: References: Message-ID: <20140130205432.GA11271@cs.ox.ac.uk> Dear Aner, On 30 January 2014 19:34, Aner Ben-Efraim wrote: > Dear Forum, > I am interested in getting all permutations of order n (order 2 is > also good) in the group SymmetricGroup([2..m]), which keep no point in > place. > I have tried to use Filtered(SymmetricGroup([2..m]),x->Order(x)=n and > NrMovedPoints(x)=m-1), but this gets extremely slow when m is double > digit. I was wondering if there is a way to do this in reasonable time > on my PC, at least for m up to say 17, or even 33 if possible. You probably will have to stop earlier than 33; indeed, for order 2 case you essentially ask for the list of 1-factors of the complete graph on m vertices (here m must be even). The number of these things grows quite fast, in fact it is equal to (n/2-1)!! (double factorial of n/2-1). See http://oeis.org/A001147 Going through them one by one would really take quite a long time on any "ordinary" modern computer in reasonable time for m=32 (the number would be 191898783962510625). Anyhow, to do this as fast as possible you (IMHO) should not rely on GAP, but rather write your own code (or find it somewhere). Namely, for a given partition m_1+...+m_k=m of m, with all m_j>1 and dividing n, you just have to fill in the k vectors of lengths m_1,..,m_k with numbers from 1,...,m such that in each vector you have a cyclically minimal sequence. Now, do this for all such partitions (they represent possible cyclic structures of fixed point free elements of order n). This will give you all the permutations you are after, in cyclic notation. HTH, Dmitrii From hebert.perez at gmail.com Fri Jan 31 09:25:22 2014 From: hebert.perez at gmail.com (=?ISO-8859-1?B?SGViZXJ0IFDpcmV6LVJvc+lz?=) Date: Fri, 31 Jan 2014 10:25:22 +0100 Subject: [GAP Forum] Changing line when printing to a text file Message-ID: Hi all, I am printing a function's output simultaneously to the standard output (the screen) and to a text file. On the screen the output appears correctly, but in the text file everything appears as a single line, i.e. there is no change of line. Here's my code: LogOutputTo("C:/Tempo/GAP/outgraph.txt"); Print(n, " ", m, "\n"); for i in [1..m] do Print(out[i][1], " ", out[i][2], "\n"); od; LogOutputTo(); What happens to the "\n" character? Thank you very much in advance, Hebert. From williamdemeo at gmail.com Fri Jan 31 10:03:59 2014 From: williamdemeo at gmail.com (William DeMeo) Date: Fri, 31 Jan 2014 05:03:59 -0500 Subject: [GAP Forum] Changing line when printing to a text file In-Reply-To: References: Message-ID: Dear Herbert, You might try outfile:= OutputTextFile(filename, false) ; SetPrintFormattingStatus(outfile, false); Then a line like yours, Print(outfile, " ", out[i][2], "\n"); might do what you expect. It seems to work for me. You could also read Section 10.4-8 of the manual. I believe the following link will take you directly there:: http://www.gap-system.org/Manuals/doc/ref/chap10.html#X8663FCD57E8BC390 Hope that helps. Good luck! Sincerely, William -- William DeMeo Department of Mathematics University of South Carolina 1523 Greene Street Columbia, SC 29208 USA phone: 803-261-9135 http://williamdemeo.org http://williamdemeo.github.io/CV -- On Friday, January 31, 2014, Hebert P?rez-Ros?s wrote: > > Hi all, > > I am printing a function's output simultaneously to the standard output > (the screen) and to a text file. On the screen the output appears > correctly, but in the text file everything appears as a single line, i.e. > there is no change of line. Here's my code: > > LogOutputTo("C:/Tempo/GAP/outgraph.txt"); > Print(n, " ", m, "\n"); > for i in [1..m] do > Print(out[i][1], " ", out[i][2], "\n"); > od; > LogOutputTo(); > > What happens to the "\n" character? > > Thank you very much in advance, > Hebert. > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From hebert.perez at gmail.com Fri Jan 31 11:05:57 2014 From: hebert.perez at gmail.com (=?ISO-8859-1?B?SGViZXJ0IFDpcmV6LVJvc+lz?=) Date: Fri, 31 Jan 2014 12:05:57 +0100 Subject: [GAP Forum] Changing line when printing to a text file In-Reply-To: References: Message-ID: Thanks a lot William, but it still doesn't work :-). By the way, according to Section 10.4-8, shouldn't it be SetPrintFormattingStatus(outfile, true); ? In any case, I've tried both options (true and false), and it still does not change lines. Maybe it's a Windows thing (I'm running GAP on Windows), or maybe it's an old bug that has already been corrected (I'm using GAP version 4.4.12). Any hint will be most welcome. Cheers, Hebert. 2014-01-31 William DeMeo : > Dear Herbert, > > You might try > > outfile:= OutputTextFile(filename, false) ; > SetPrintFormattingStatus(outfile, false); > > Then a line like yours, > > Print(outfile, " ", out[i][2], "\n"); > > might do what you expect. It seems to work for me. > > You could also read Section 10.4-8 of the manual. I believe the > following link will take you directly there:: > > http://www.gap-system.org/Manuals/doc/ref/chap10.html#X8663FCD57E8BC390 > > Hope that helps. Good luck! > > Sincerely, > > William > > -- > William DeMeo > Department of Mathematics > University of South Carolina > 1523 Greene Street > Columbia, SC 29208 > USA > > phone: 803-261-9135 > http://williamdemeo.org > http://williamdemeo.github.io/CV > -- > > > On Friday, January 31, 2014, Hebert P?rez-Ros?s > wrote: > > > > Hi all, > > > > I am printing a function's output simultaneously to the standard output > > (the screen) and to a text file. On the screen the output appears > > correctly, but in the text file everything appears as a single line, i.e. > > there is no change of line. Here's my code: > > > > LogOutputTo("C:/Tempo/GAP/outgraph.txt"); > > Print(n, " ", m, "\n"); > > for i in [1..m] do > > Print(out[i][1], " ", out[i][2], "\n"); > > od; > > LogOutputTo(); > > > > What happens to the "\n" character? > > > > Thank you very much in advance, > > Hebert. > > _______________________________________________ > > Forum mailing list > > Forum at mail.gap-system.org > > http://mail.gap-system.org/mailman/listinfo/forum > From dmitrii.pasechnik at cs.ox.ac.uk Fri Jan 31 11:33:19 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dmitrii Pasechnik) Date: Fri, 31 Jan 2014 11:33:19 +0000 Subject: [GAP Forum] Changing line when printing to a text file In-Reply-To: References: Message-ID: <20140131113319.GA26104@cs.ox.ac.uk> On Fri, Jan 31, 2014 at 12:05:57PM +0100, Hebert P?rez-Ros?s wrote: > Thanks a lot William, but it still doesn't work :-). By the way, according > to Section 10.4-8, shouldn't it be > > SetPrintFormattingStatus(outfile, true); ? > > In any case, I've tried both options (true and false), and it still does > not change lines. Maybe it's a Windows thing (I'm running GAP on Windows), > or maybe it's an old bug that has already been corrected (I'm using GAP > version 4.4.12). Any hint will be most welcome. On Windows "\n" need not be the right character sequence for the end of line. You might want to try "\r\n" instead. HTH, Dmitrii > > Cheers, > Hebert. > > > > 2014-01-31 William DeMeo : > > > Dear Herbert, > > > > You might try > > > > outfile:= OutputTextFile(filename, false) ; > > SetPrintFormattingStatus(outfile, false); > > > > Then a line like yours, > > > > Print(outfile, " ", out[i][2], "\n"); > > > > might do what you expect. It seems to work for me. > > > > You could also read Section 10.4-8 of the manual. I believe the > > following link will take you directly there:: > > > > http://www.gap-system.org/Manuals/doc/ref/chap10.html#X8663FCD57E8BC390 > > > > Hope that helps. Good luck! > > > > Sincerely, > > > > William > > > > -- > > William DeMeo > > Department of Mathematics > > University of South Carolina > > 1523 Greene Street > > Columbia, SC 29208 > > USA > > > > phone: 803-261-9135 > > http://williamdemeo.org > > http://williamdemeo.github.io/CV > > -- > > > > > > On Friday, January 31, 2014, Hebert P?rez-Ros?s > > wrote: > > > > > > Hi all, > > > > > > I am printing a function's output simultaneously to the standard output > > > (the screen) and to a text file. On the screen the output appears > > > correctly, but in the text file everything appears as a single line, i.e. > > > there is no change of line. Here's my code: > > > > > > LogOutputTo("C:/Tempo/GAP/outgraph.txt"); > > > Print(n, " ", m, "\n"); > > > for i in [1..m] do > > > Print(out[i][1], " ", out[i][2], "\n"); > > > od; > > > LogOutputTo(); > > > > > > What happens to the "\n" character? > > > > > > Thank you very much in advance, > > > Hebert. > > > _______________________________________________ > > > Forum mailing list > > > Forum at mail.gap-system.org > > > http://mail.gap-system.org/mailman/listinfo/forum > > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From hebert.perez at gmail.com Fri Jan 31 12:17:37 2014 From: hebert.perez at gmail.com (=?ISO-8859-1?B?SGViZXJ0IFDpcmV6LVJvc+lz?=) Date: Fri, 31 Jan 2014 13:17:37 +0100 Subject: [GAP Forum] Changing line when printing to a text file In-Reply-To: <20140131113319.GA26104@cs.ox.ac.uk> References: <20140131113319.GA26104@cs.ox.ac.uk> Message-ID: Now it works !! Thank you, Dimitri. 2014-01-31 Dmitrii Pasechnik : > On Fri, Jan 31, 2014 at 12:05:57PM +0100, Hebert P?rez-Ros?s wrote: > > Thanks a lot William, but it still doesn't work :-). By the way, > according > > to Section 10.4-8, shouldn't it be > > > > SetPrintFormattingStatus(outfile, true); ? > > > > In any case, I've tried both options (true and false), and it still does > > not change lines. Maybe it's a Windows thing (I'm running GAP on > Windows), > > or maybe it's an old bug that has already been corrected (I'm using GAP > > version 4.4.12). Any hint will be most welcome. > > On Windows "\n" need not be the right character sequence for the end of > line. > You might want to try "\r\n" instead. > > HTH, > Dmitrii > > > > Cheers, > > Hebert. > > > > > > > > 2014-01-31 William DeMeo : > > > > > Dear Herbert, > > > > > > You might try > > > > > > outfile:= OutputTextFile(filename, false) ; > > > SetPrintFormattingStatus(outfile, false); > > > > > > Then a line like yours, > > > > > > Print(outfile, " ", out[i][2], "\n"); > > > > > > might do what you expect. It seems to work for me. > > > > > > You could also read Section 10.4-8 of the manual. I believe the > > > following link will take you directly there:: > > > > > > > http://www.gap-system.org/Manuals/doc/ref/chap10.html#X8663FCD57E8BC390 > > > > > > Hope that helps. Good luck! > > > > > > Sincerely, > > > > > > William > > > > > > -- > > > William DeMeo > > > Department of Mathematics > > > University of South Carolina > > > 1523 Greene Street > > > Columbia, SC 29208 > > > USA > > > > > > phone: 803-261-9135 > > > http://williamdemeo.org > > > http://williamdemeo.github.io/CV > > > -- > > > > > > > > > On Friday, January 31, 2014, Hebert P?rez-Ros?s < > hebert.perez at gmail.com> > > > wrote: > > > > > > > > Hi all, > > > > > > > > I am printing a function's output simultaneously to the standard > output > > > > (the screen) and to a text file. On the screen the output appears > > > > correctly, but in the text file everything appears as a single line, > i.e. > > > > there is no change of line. Here's my code: > > > > > > > > LogOutputTo("C:/Tempo/GAP/outgraph.txt"); > > > > Print(n, " ", m, "\n"); > > > > for i in [1..m] do > > > > Print(out[i][1], " ", out[i][2], "\n"); > > > > od; > > > > LogOutputTo(); > > > > > > > > What happens to the "\n" character? > > > > > > > > Thank you very much in advance, > > > > Hebert. > > > > _______________________________________________ > > > > Forum mailing list > > > > Forum at mail.gap-system.org > > > > http://mail.gap-system.org/mailman/listinfo/forum > > > > > _______________________________________________ > > Forum mailing list > > Forum at mail.gap-system.org > > http://mail.gap-system.org/mailman/listinfo/forum > From r_n_tsai at yahoo.com Wed Feb 5 18:00:44 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Wed, 5 Feb 2014 10:00:44 -0800 (PST) Subject: [GAP Forum] ELIAS package for Lie algebra reps Message-ID: <1391623244.26638.YahooMailNeo@web121203.mail.ne1.yahoo.com> Dear forum, I ran across this page which references a GAP4 package used to construct finite dimensional representations of Lie algebras (ELIAS). ftp://ftp.gap-system.org/pub/gap/NEU/Info/oldevents.html I didn't find ELIAS in the list of packages. Does anyone know if this is still available. Thanks, R.N. From degraaf at science.unitn.it Thu Feb 6 09:06:01 2014 From: degraaf at science.unitn.it (Willem de Graaf) Date: Thu, 6 Feb 2014 10:06:01 +0100 Subject: [GAP Forum] ELIAS package for Lie algebra reps In-Reply-To: <1391623244.26638.YahooMailNeo@web121203.mail.ne1.yahoo.com> References: <1391623244.26638.YahooMailNeo@web121203.mail.ne1.yahoo.com> Message-ID: Dear R. N. Tsai, ELIAS stands for Eindhoven LIe Algebra System. It was the name used for a body of code for working with Lie algebras. All of it is available in the GAP library, and for that reason there is no package. Best wishes, Willem de Graaf On Wed, Feb 5, 2014 at 7:00 PM, R.N. Tsai wrote: > Dear forum, > I ran across this page which references a GAP4 package used to construct > finite dimensional representations of Lie algebras (ELIAS). > > ftp://ftp.gap-system.org/pub/gap/NEU/Info/oldevents.html > > > I didn't find ELIAS in the list of packages. Does anyone know if this is > still available. > Thanks, > R.N. > > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum > From tanyanlan at ualberta.ca Sat Feb 8 06:11:30 2014 From: tanyanlan at ualberta.ca (yilan tan) Date: Fri, 7 Feb 2014 23:11:30 -0700 Subject: [GAP Forum] Computation using GAP Message-ID: Dear All: I am a Ph.D student at the University of Alberta. My research interest is the representation theory of Yangian. I used GAP to find weight of weight vectors, quickly and efficiently. I feel GAP is so powerful. I would like to seek more applications of GAP to my research. Here is one of my questions. Suppose that I have some elements from an algebra, $h_i$ and $x_i$, where $0\leq i\leq 6$. The defining relations are: 1. $[h_0,x_i]=cx_i$, where c is a natural number and [, ] denoting the Lie bracket. 2.$[h_i,x_j]=[h_{i-1},x_{j+1}]+(c/2)(h_{i-1}x_{j}+x_jh_{i-1})$. We can get at least two things immediately from the defining relations. 3. $[h_i,x_0]=\sum_{s} c_s x_s+\sum_{a,b} c_{a, b} x_ah_b$, here both $c_s$ and $c_ {a, b}$ are rational numbers. 4.inductively, $[h_i,(x_0)^m]=\sum_{s_1,\ldots, s_m}c_{s_1,\ldots,s_m)x_{s_1}\ldots x_{s_m)+\sum_{a_1,\ldots, a_m,b} c_{a_1,\ldots, a_m,b} x_{s_1}\ldots x_{s_m)h_b$. If some of you can kindly answer my questions: 1. How to define the orders of x_j precedes h_i. Which chapters I should read? 2. How to define (3) in GAP system? 3. If it is possible to define an associative algebra with infinite generators? Thank you very much for reading my question. I would appreciate if you can comment my questions. All the best. Peter Tan From benjamin.sambale at gmail.com Mon Feb 10 14:55:44 2014 From: benjamin.sambale at gmail.com (Benjamin) Date: Mon, 10 Feb 2014 15:55:44 +0100 Subject: [GAP Forum] automorphisms of "large" 2-groups Message-ID: <52F8E870.4050800@gmail.com> Dear GAP users, I need some help with the following task: Consider P:=SmallGroup(2^9,10477010); This group satisfies Z(P)=Phi(P)=Omega(P) and Z(P) has order 8. All I want to know is if Aut(P) is a 2-group. The commands AutomorphismGroup(P) and AutomorphismGroupPGroup(P) (using the AutPGrp package) seem to take very long (have been running for hours). Therefore I guess Aut(P) is quite big and definitely not a 2-group. On the other hand, I tried to extend automorphisms of odd order of subgroups and quotient groups without success. In fact, I believe I showed that any nontrivial automorphism of odd order must have order 7 (with regular action on Z(P)). In any case it would be nice to write down a nontrivial automorphism of odd order without knowing them all. Otherwise I would appreciate any argument that Aut(P) is in fact a 2-group. Many thanks, Benjamin From benjamin.sambale at gmail.com Mon Feb 10 19:02:26 2014 From: benjamin.sambale at gmail.com (Benjamin Sambale) Date: Mon, 10 Feb 2014 20:02:26 +0100 Subject: [GAP Forum] automorphisms of "large" 2-groups In-Reply-To: <52F8E870.4050800@gmail.com> References: <52F8E870.4050800@gmail.com> Message-ID: <52F92242.8040204@gmail.com> Thank you for several replies! Heiko Dietrich pointed out that the computation can be done with Magma in a matter of seconds. Also Eamonn O'Brien provided a concrete automorphism of order 7. I like to add that I had no problems with GAP computing automorphism groups of very similar groups (of order 2^9). Best wishes, Benjamin Am 10.02.2014 15:55, schrieb Benjamin: > Dear GAP users, > > I need some help with the following task: Consider > > P:=SmallGroup(2^9,10477010); > > This group satisfies Z(P)=Phi(P)=Omega(P) and Z(P) has order 8. All I > want to know is if Aut(P) is a 2-group. The commands > AutomorphismGroup(P) and AutomorphismGroupPGroup(P) (using the AutPGrp > package) seem to take very long (have been running for hours). > Therefore I guess Aut(P) is quite big and definitely not a 2-group. On > the other hand, I tried to extend automorphisms of odd order of > subgroups and quotient groups without success. In fact, I believe I > showed that any nontrivial automorphism of odd order must have order 7 > (with regular action on Z(P)). > > In any case it would be nice to write down a nontrivial automorphism > of odd order without knowing them all. Otherwise I would appreciate > any argument that Aut(P) is in fact a 2-group. > > Many thanks, > Benjamin > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum > From max at quendi.de Mon Feb 10 19:29:37 2014 From: max at quendi.de (Max Horn) Date: Mon, 10 Feb 2014 20:29:37 +0100 Subject: [GAP Forum] automorphisms of "large" 2-groups In-Reply-To: <52F92242.8040204@gmail.com> References: <52F8E870.4050800@gmail.com> <52F92242.8040204@gmail.com> Message-ID: Dear Benjamin, dear All, On 10.02.2014, at 20:02, Benjamin Sambale wrote: > Thank you for several replies! > Heiko Dietrich pointed out that the computation can be done with Magma in a matter of seconds. Also Eamonn O'Brien provided a concrete automorphism of order 7. > I like to add that I had no problems with GAP computing automorphism groups of very similar groups (of order 2^9). I had a closer look at the cause for this slowdown. Since I've been working (jointly with Bettina Eick) on somewhat related code dealing with arbitrary finite solvable groups, I am more or less familiar with what's going on there, and after a quick glance, the issue seemed rather familiar... :-) Indeed, the problem is that autpgrp tries to compute a stabilizer via a "naive" orbit-stabilizer computation; but the orbit involved has size 119,992,320 which means it would take a lot of time and memory to actually compute it. This is made worse by the fact that orbit-stabilizer implementation in autpgrp is not running in time linear in the orbit size (as it should), but rather quadratic... so there is no chance for it to complete in the foreseeable future. :-). At first I only fixed the autpgrp to work linear instead of quadratic, but after computing an estimate for the orbit size, I realized this wouldn't be enough (at least not if you are impatient and on a train ride like me ;-). So I did some heart surgery on my local copy of autpgrp, and changed it to use the genss package to compute this stabilizer. For now, this means using a probabilistic algorithm, but I asked it to compute the result with an error probability below 1/2^30, so I am quite hopeful the result is correct. (It should be possible to turn this back into an exact computation, but I didn't bother for this experiment). With that change, GAP + autpgrp + genss also take only a few seconds to compute the automorphism group, which seems to be of size 2^18*7 -- does that match the result Magma gives you? Finally, a concrete automorphism of order 7 is given by Pcgs([ f1, f2, f3, f4, f5, f6, f7, f8, f9 ]) -> [ f1*f2*f5*f7*f8*f9, f3*f8, f1*f7*f8*f9, f4*f5, f5*f6, f4, f9, f7*f9, f8 ] Cheers, Max From anvita21 at gmail.com Tue Feb 11 06:08:22 2014 From: anvita21 at gmail.com (Anvita) Date: Tue, 11 Feb 2014 13:08:22 +0700 Subject: [GAP Forum] The order of Out(S4(8)) Message-ID: Dear Forum, According to the ATLAS, the simple group S4(8) has outer automorphism group of order 6, but the following calculation, if I am interpreting it correctly, seems to suggest that it has order 3. Anvita gap> S:=PSp(4,8); gap> A:=AutomorphismGroup(S); gap> Size(A)/Size(S); 3 From dmitrii.pasechnik at cs.ox.ac.uk Tue Feb 11 10:32:49 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dmitrii Pasechnik) Date: Tue, 11 Feb 2014 10:32:49 +0000 Subject: [GAP Forum] The order of Out(S4(8)) In-Reply-To: References: Message-ID: <20140211103249.GB26329@cs.ox.ac.uk> Dear Forum, it works for me (on OSX 10.6.8): ********* GAP, Version 4.6.4 of 04-May-2013 (free software, GPL) * GAP * http://www.gap-system.org ********* Architecture: x86_64-apple-darwin10.8.0-gcc-default64 Libs used: gmp, readline Loading the library and packages ... Packages: Alnuth 3.0.0, AutPGrp 1.5, CTblLib 1.2.2, FactInt 1.5.3, GAPDoc 1.5.1, LAGUNA 3.6.3, Polycyclic 2.11 Try '?help' for help. See also '?copyright' and '?authors' gap> S:=PSp(4,8); gap> OrbitLength(S,1); 585 gap> NormalSubgroups(S); [ Group(()), ] gap> A:=AutomorphismGroup(S); gap> Order(A)/Order(S); 6 gap> Size(A)/Size(S); 6 What version of GAP are you using, and on which OS/hardware? On Tue, Feb 11, 2014 at 01:08:22PM +0700, Anvita wrote: > Dear Forum, > > According to the ATLAS, the simple group S4(8) has outer automorphism group > of order 6, > but the following calculation, if I am interpreting it correctly, seems to > suggest that it has order 3. > > Anvita > > > gap> S:=PSp(4,8); > > gap> A:=AutomorphismGroup(S); > > gap> Size(A)/Size(S); > 3 > _______________________________________________ From anvita21 at gmail.com Tue Feb 11 11:09:05 2014 From: anvita21 at gmail.com (Anvita) Date: Tue, 11 Feb 2014 18:09:05 +0700 Subject: [GAP Forum] The order of Out(S4(8)) In-Reply-To: <20140211103249.GB26329@cs.ox.ac.uk> References: <20140211103249.GB26329@cs.ox.ac.uk> Message-ID: Dear Dmitrii, Here is a more detailed output which includes GAP version and architecture. ????????? GAP, Version 4.7.2 of 01-Dec-2013 (free software, GPL) ? GAP ? http://www.gap-system.org ????????? Architecture: x86_64-unknown-linux-gnu-gcc-default64 Libs used: gmp, readline Loading the library and packages ... Components: trans 1.0, prim 2.1, small* 1.0, id* 1.0 Packages: AClib 1.2, Alnuth 3.0.0, AtlasRep 1.5.0, AutPGrp 1.5, Browse 1.8.3, CRISP 1.3.7, Cryst 4.1.12, CrystCat 1.1.6, CTblLib 1.2.2, FactInt 1.5.3, FGA 1.2.0, GAPDoc 1.5.1, IO 4.2, IRREDSOL 1.2.3, LAGUNA 3.6.4, Polenta 1.3.1, Polycyclic 2.11, RadiRoot 2.6, ResClasses 3.3.2, Sophus 1.23, SpinSym 1.5, TomLib 1.2.4 Try '?help' for help. See also '?copyright' and '?authors' gap> S:=PSp(4,8); gap> A:=AutomorphismGroup(S); gap> Size(A)/Size(S); 3 gap> Please, note that the number of generators of Aut(S) differs from that in your calculation, too. Anvita On Tue, Feb 11, 2014 at 5:32 PM, Dmitrii Pasechnik < dmitrii.pasechnik at cs.ox.ac.uk> wrote: > Dear Forum, > it works for me (on OSX 10.6.8): > > ********* GAP, Version 4.6.4 of 04-May-2013 (free software, GPL) > * GAP * http://www.gap-system.org > ********* Architecture: x86_64-apple-darwin10.8.0-gcc-default64 > Libs used: gmp, readline > Loading the library and packages ... > Packages: Alnuth 3.0.0, AutPGrp 1.5, CTblLib 1.2.2, FactInt 1.5.3, > GAPDoc 1.5.1, LAGUNA 3.6.3, Polycyclic 2.11 > Try '?help' for help. See also '?copyright' and '?authors' > gap> S:=PSp(4,8); > > gap> OrbitLength(S,1); > 585 > gap> NormalSubgroups(S); > [ Group(()), ] > gap> A:=AutomorphismGroup(S); > > gap> Order(A)/Order(S); > 6 > gap> Size(A)/Size(S); > 6 > > > What version of GAP are you using, and on which OS/hardware? > > On Tue, Feb 11, 2014 at 01:08:22PM +0700, Anvita wrote: > > Dear Forum, > > > > According to the ATLAS, the simple group S4(8) has outer automorphism > group > > of order 6, > > but the following calculation, if I am interpreting it correctly, seems > to > > suggest that it has order 3. > > > > Anvita > > > > > > gap> S:=PSp(4,8); > > > > gap> A:=AutomorphismGroup(S); > > > > gap> Size(A)/Size(S); > > 3 > > _______________________________________________ > From matliumh at gmail.com Tue Feb 11 11:31:39 2014 From: matliumh at gmail.com (Minghui Liu) Date: Tue, 11 Feb 2014 19:31:39 +0800 Subject: [GAP Forum] A Question about For Loops Message-ID: Dear All, In GAP I would like to create a free group with 200 generators and call the nth generator dn. I tried the following commands but it does not work: gap> F:=FreeGroup(200); gap> a:=[1..200]; gap> for x in a do > dx:=F.x; > od; The error message is From matliumh at gmail.com Tue Feb 11 11:32:42 2014 From: matliumh at gmail.com (Minghui Liu) Date: Tue, 11 Feb 2014 19:32:42 +0800 Subject: [GAP Forum] A Question about For Loops In-Reply-To: References: Message-ID: Sorry the above message was incomplete. The error message is Error, illegal access to record component obj.x' of the object . (Objects by default do not have record components. The error might be a relic from translated GAP3 code.) called from called from ( ) called from read-eval loop at line 28 of *stdin* you can 'quit;' to quit to outer loop, or you can 'return;' to continue Anyone could help me with it? Many thanks!! Zuriel On 11 February 2014 19:31, Minghui Liu wrote: > Dear All, > > In GAP I would like to create a free group with 200 generators and call > the nth generator dn. I tried the following commands but it does not work: > > gap> F:=FreeGroup(200); > gap> a:=[1..200]; > gap> for x in a do > > dx:=F.x; > > od; > > The error message is > > > > > From rm43 at evansville.edu Tue Feb 11 11:40:10 2014 From: rm43 at evansville.edu (Robert Morse) Date: Tue, 11 Feb 2014 12:40:10 +0100 Subject: [GAP Forum] A Question about For Loops In-Reply-To: References: Message-ID: gap> F := FreeGroup(200,"d"); should give you what you what. Robert On Tue, Feb 11, 2014 at 12:31 PM, Minghui Liu wrote: > Dear All, > > In GAP I would like to create a free group with 200 generators and call the > nth generator dn. I tried the following commands but it does not work: > > gap> F:=FreeGroup(200); > gap> a:=[1..200]; > gap> for x in a do >> dx:=F.x; >> od; > > The error message is > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From alexk at mcs.st-andrews.ac.uk Tue Feb 11 11:41:36 2014 From: alexk at mcs.st-andrews.ac.uk (Alexander Konovalov) Date: Tue, 11 Feb 2014 11:41:36 +0000 Subject: [GAP Forum] A Question about For Loops In-Reply-To: References: Message-ID: Dear Minghui Liu, On 11 Feb 2014, at 11:31, Minghui Liu wrote: > Dear All, > > In GAP I would like to create a free group with 200 generators and call the > nth generator dn. I tried the following commands but it does not work: > > gap> F:=FreeGroup(200); > gap> a:=[1..200]; > gap> for x in a do >> dx:=F.x; >> od; > > The error message is The reason is that GAP parses F.x as an access to the component 'x' of the object F. Clearly that does not work in this context. To enforce evaluation of x to get F.1, F.2 etc, use F.(x), for example gap> F:=FreeGroup(200); gap> a:=[1..200]; [ 1 .. 200 ] gap> for x in a do > dx:=F.(x); > od; gap> dx; f200 The difference between r.name and r.(name) constructions is explained in "29.2 Accessing Record Elements" in the reference manual. Hope this helps Alexander From resteban at mat.upv.es Tue Feb 11 11:56:43 2014 From: resteban at mat.upv.es (Ramon Esteban-Romero) Date: Tue, 11 Feb 2014 12:56:43 +0100 Subject: [GAP Forum] The order of Out(S4(8)) In-Reply-To: References: <20140211103249.GB26329@cs.ox.ac.uk> Message-ID: <52FA0FFB.8030809@mat.upv.es> Dear colleagues, I have also found some differences between GAP versions: ????????? GAP, Version 4.7.2 of 01-Dec-2013 (free software, GPL) ? GAP ? http://www.gap-system.org ????????? Architecture: i686-pc-linux-gnu-gcc-default32 Libs used: gmp Loading the library and packages ... Components: trans 1.0, prim 2.1, small* 1.0, id* 1.0 Packages: AClib 1.2, Alnuth 3.0.0, AtlasRep 1.5.0, AutPGrp 1.5, CRISP 1.3.7, Cryst 4.1.12, CrystCat 1.1.6, CTblLib 1.2.2, FactInt 1.5.3, FGA 1.2.0, GAPDoc 1.5.1, IRREDSOL 1.2.3, LAGUNA 3.6.4, Polenta 1.3.1, Polycyclic 2.11, RadiRoot 2.6, ResClasses 3.3.2, Sophus 1.23, SpinSym 1.5, TomLib 1.2.4 Try '?help' for help. See also '?copyright' and '?authors' gap> S:=PSp(4,8); gap> A:=AutomorphismGroup(S); gap> Size(A)/Size(S); 3 ????????? GAP, Version 4.6.5 of 20-Jul-2013 (free software, GPL) ? GAP ? http://www.gap-system.org ????????? Architecture: i686-pc-linux-gnu-gcc-default32 Libs used: gmp Loading the library and packages ... Components: trans 1.0, prim 2.1, small* 1.0, id* 1.0 Packages: AClib 1.2, Alnuth 3.0.0, AutPGrp 1.5, CRISP 1.3.7, Cryst 4.1.11, CrystCat 1.1.6, CTblLib 1.2.2, FactInt 1.5.3, FGA 1.2.0, GAPDoc 1.5.1, IO 4.2, IRREDSOL 1.2.3, LAGUNA 3.6.3, Polenta 1.3.1, Polycyclic 2.11, RadiRoot 2.6, ResClasses 3.3.0, Sophus 1.23, SpinSym 1.5, TomLib 1.2.2 Try '?help' for help. See also '?copyright' and '?authors' gap> S:=PSp(4,8); gap> A:=AutomorphismGroup(S); gap> Size(A)/Size(S); 6 Best wishes, -- Ramon Clau p?blica PGP/Llave p?blica PGP/Clef publique PGP/PGP public key: http://www.rediris.es/cert/servicios/keyserver/ http://www.uv.es/estebanr/resteban.asc Nou tel?fon/nuevo tel?fono/nouveau t?l?phone/new phone: (+34)9635 44367 Al 11/02/14 12:09, En/na Anvita ha escrit:> Dear Dmitrii, > > Here is a more detailed output which includes GAP version and architecture. > > ????????? GAP, Version 4.7.2 of 01-Dec-2013 (free software, GPL) > ? GAP ? http://www.gap-system.org > ????????? Architecture: x86_64-unknown-linux-gnu-gcc-default64 > Libs used: gmp, readline > Loading the library and packages ... > Components: trans 1.0, prim 2.1, small* 1.0, id* 1.0 > Packages: AClib 1.2, Alnuth 3.0.0, AtlasRep 1.5.0, AutPGrp 1.5, > Browse 1.8.3, CRISP 1.3.7, Cryst 4.1.12, CrystCat 1.1.6, > CTblLib 1.2.2, FactInt 1.5.3, FGA 1.2.0, GAPDoc 1.5.1, IO 4.2, > IRREDSOL 1.2.3, LAGUNA 3.6.4, Polenta 1.3.1, Polycyclic 2.11, > RadiRoot 2.6, ResClasses 3.3.2, Sophus 1.23, SpinSym 1.5, > TomLib 1.2.4 > Try '?help' for help. See also '?copyright' and '?authors' > gap> S:=PSp(4,8); > > gap> A:=AutomorphismGroup(S); > > gap> Size(A)/Size(S); > 3 > gap> > > Please, note that the number of generators of Aut(S) differs from that in > your calculation, too. > > Anvita > > > On Tue, Feb 11, 2014 at 5:32 PM, Dmitrii Pasechnik < > dmitrii.pasechnik at cs.ox.ac.uk> wrote: > >> Dear Forum, >> it works for me (on OSX 10.6.8): >> >> ********* GAP, Version 4.6.4 of 04-May-2013 (free software, GPL) >> * GAP * http://www.gap-system.org >> ********* Architecture: x86_64-apple-darwin10.8.0-gcc-default64 >> Libs used: gmp, readline >> Loading the library and packages ... >> Packages: Alnuth 3.0.0, AutPGrp 1.5, CTblLib 1.2.2, FactInt 1.5.3, >> GAPDoc 1.5.1, LAGUNA 3.6.3, Polycyclic 2.11 >> Try '?help' for help. See also '?copyright' and '?authors' >> gap> S:=PSp(4,8); >> >> gap> OrbitLength(S,1); >> 585 >> gap> NormalSubgroups(S); >> [ Group(()), ] >> gap> A:=AutomorphismGroup(S); >> >> gap> Order(A)/Order(S); >> 6 >> gap> Size(A)/Size(S); >> 6 >> >> >> What version of GAP are you using, and on which OS/hardware? >> >> On Tue, Feb 11, 2014 at 01:08:22PM +0700, Anvita wrote: >>> Dear Forum, >>> >>> According to the ATLAS, the simple group S4(8) has outer automorphism >> group >>> of order 6, >>> but the following calculation, if I am interpreting it correctly, seems >> to >>> suggest that it has order 3. >>> >>> Anvita >>> >>> >>> gap> S:=PSp(4,8); >>> >>> gap> A:=AutomorphismGroup(S); >>> >>> gap> Size(A)/Size(S); >>> 3 >>> _______________________________________________ >> > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum > From rm43 at evansville.edu Tue Feb 11 12:04:38 2014 From: rm43 at evansville.edu (Robert Morse) Date: Tue, 11 Feb 2014 13:04:38 +0100 Subject: [GAP Forum] A Question about For Loops In-Reply-To: References: Message-ID: Try gennames:= Concatenation(List([1..5], x->Concatenation("a",String(x))), List([1..100],x->Concatenation("b",String(x))), List([1..95],x->Concatenation("c",String(x)))); F := FreeGroup(gennames); Robert On Tue, Feb 11, 2014 at 12:53 PM, Minghui Liu wrote: > Thanks Robert! What if I need to modify some subscript? Say I will define > the first five generators as a1, a2, a3, a4, a5, then the next 100 > generators as b1, b2, ..., b100, then the last 95 as c1, ..., c95? > > Thank you!! > From hulpke at fastmail.fm Tue Feb 11 16:04:11 2014 From: hulpke at fastmail.fm (Alexander Hulpke) Date: Tue, 11 Feb 2014 09:04:11 -0700 Subject: [GAP Forum] The order of Out(S4(8)) In-Reply-To: References: Message-ID: <9ABC38FE-3977-4C6C-BAA3-91F6DFEFF968@fastmail.fm> Dear Forum, Dear Anvita, Thank you very much for the bug report. This bug will be fixed in the next release of GAP. Let me briefly explain what happened, as this indeed looks weird: In GAP 4.7, the algorithm for automorphism groups of simple groups uses a table of automorphism group orders (ATLAS, page xvi) to be able to terminate quickly once all automorphisms were found. This typically produces a very subtantial speedup, as most time is spent in verifying there are no further automorphisms. Now the group in question is PSp(4,8) which in Lie-language is C2(8). However this group is isomorphic to B2(8) which would be O5(8). As the ATLAS describes the group as Sp4, GAP also does so, i.e. it recognizes the group as C2(8). The ATLAS table now gives an exception (the missing 2) for the automorphism group of B2 and does not repeat this exception for C2 explicitly (and only says Cn for n>=3). This special case was not covered, and GAP deduced the wrong automorphism group size (outer 3, not 3*2) and stopped once it was found. This is corrected now. If you call (after defining S) gap> SetDataAboutSimpleGroup(S, > rec( allExtensions := [ [ 2, "2" ], [ 3, "3" ], [ 6, "6" ] ], classicalId := rec( parameter := [ 5, 8 ], series := "O" ), > fullAutGroup := [ 6, "6" ], idSimple := rec( name := "B(2,8) = O(5,8) ~ C(2,8) = S(4,8)", parameter := [ 2, 8 ], > series := "B" ), tomName := "O5(8)" )); you explicitly set this correct data and the automorphism group calculation will perform fine. Apologies for the problem! Alexander From alexk at mcs.st-andrews.ac.uk Thu Feb 13 20:43:07 2014 From: alexk at mcs.st-andrews.ac.uk (Alexander Konovalov) Date: Thu, 13 Feb 2014 20:43:07 +0000 Subject: [GAP Forum] Algebras In-Reply-To: <1391035795.4835.YahooMailNeo@web121205.mail.ne1.yahoo.com> References: <07CE6D08A49ABA4EACEB953BF52571C450B750DE@ueastfexch02.UEA.AC.UK> <954EBEBD-5621-46A1-8659-5D5638B3764A@quendi.de> <1390937384.14260.YahooMailNeo@web121203.mail.ne1.yahoo.com> <60F08277-87C9-4240-8A42-9FD69A44E6E6@quendi.de> <1390953963.67369.YahooMailNeo@web121202.mail.ne1.yahoo.com> <312B5ECD-F19A-48E9-AE39-2F996BC4995B@quendi.de> <1391035795.4835.YahooMailNeo@web121205.mail.ne1.yahoo.com> Message-ID: Dear all, On 29 Jan 2014, at 22:49, R.N. Tsai wrote: > Dear Max and forum, > >> If you want to work in these algebras, you don't want to compute a quotient. >> Rather, you want to be able to compute normal forms of elements, > > You're absolutely right; this is all I needed. I didn't know GBNP had it already. > >> NormalFormMod := x -> NP2GP(StrongNormalFormNP(GP2NP(x), G), A); > > Very helpful...everything is working beautifully now for both weyl and cliford > algebras...it's also fairly fast. > > How do I add GBNP to the list of packages that get loaded automatically? > I couldn't figure that out from the gap manual. In GAP 4.7.2 this is documented in "3.2-3 Configuring User preferences" (enter ?WriteGapIniFile' in GAP to see that section). You may call WriteGapIniFile(); to create gap.ini file where you may specify user preferences. Its output will tell the path to this file, then you may edit it around the lines ## A list of names of packages which should be loaded during startup. For ## backwards compatibility, the default lists most of packages that were ## autoloaded in GAP 4.4 (add or remove packages as you like). # SetUserPreference( "PackagesToLoad", [ "autpgrp", "alnuth", "crisp", "ctbllib", "factint", "fga", "irredsol", "laguna", "polenta", "polycyclic", "resclasses", "sophus", "tomlib" ] ); uncommenting the last command and modifying its argument, adding packages you want to load in addition to those already listed there. Best regards Alexander From robert.wolstenholme08 at imperial.ac.uk Fri Feb 14 19:37:12 2014 From: robert.wolstenholme08 at imperial.ac.uk (Wolstenholme, Robert) Date: Fri, 14 Feb 2014 19:37:12 +0000 Subject: [GAP Forum] Compiling GAP for Use in C Program Message-ID: <5252654327565F489A4402B674A4F6AD8A666057@icexch-m1.ic.ac.uk> I want to compile some of my GAP functions into static libraries for use in a C program. I have compiled them using gac -c on Ubuntu but I 'm not sure how to now call these functions in my C program. I tried a few things but whenever I tried to link and create a binary I got an error. For example I initially tried a "Hello World" example with HelloWorld.g = -------------------------------------------------------------+ PrintEO := function ( n ) Print( "Hello World" ); end; | -------------------------------------------------------------+ HelloWorldMain.c = -----------------------+ #include | | '''?void PrintEO()?'''' | int main() | { | '''?PrintEO()?''' | return 0; | } | -----------------------+ Where I don't know what to put for the '''?PrintEO()?'''. I analysed the created source code using gac -C but it still wasn't clear to me. How would I go about getting this to work? Rob From dmitrii.pasechnik at cs.ox.ac.uk Fri Feb 14 20:44:06 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dima Pasechnik) Date: Fri, 14 Feb 2014 20:44:06 +0000 Subject: [GAP Forum] Compiling GAP for Use in C Program In-Reply-To: <5252654327565F489A4402B674A4F6AD8A666057@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A666057@icexch-m1.ic.ac.uk> Message-ID: <20140214204406.GA21224@nash> Dear Robert, On Fri, Feb 14, 2014 at 07:37:12PM +0000, Wolstenholme, Robert wrote: > I want to compile some of my GAP functions into static libraries for use in a C program. I have compiled them using gac -c on Ubuntu but I 'm not sure how to now call these functions in my C program. I tried a few things but whenever I tried to link and create a binary I got an error. One way is to use libGAP, which comes with Sage (http://www.sagemath.org), but can also be used to create standalone C programs which call GAP functions. See either the link above or https://bitbucket.org/vbraun/libgap where in particular libGAP/test/test.c is an example of a standalone C program calling GAP. (or, certainly, if you might as well call GAP from Python (or Cython) then Sage is all you need :-)) HTH, Dmitrii From caj21 at st-andrews.ac.uk Sat Feb 15 12:04:51 2014 From: caj21 at st-andrews.ac.uk (Chris Jefferson) Date: Sat, 15 Feb 2014 12:04:51 +0000 Subject: [GAP Forum] Compiling GAP for Use in C Program In-Reply-To: <5252654327565F489A4402B674A4F6AD8A666057@icexch-m1.ic.ac.uk> References: <5252654327565F489A4402B674A4F6AD8A666057@icexch-m1.ic.ac.uk> Message-ID: <52FF57E3.2020708@st-andrews.ac.uk> While this is not at all the answer to what you asked, you could consider using SCSCP, which is a library which lets you communicate with GAP. I have a very simple C++ SCSCP library here: https://bitbucket.org/ChrisJefferson/miniscscp, although it is easy to use SCSCP (except you have to use an XML library) If you are making many very cheap calls to GAP this can be a bit slow, but it also makes it easy to parallelise your code as well. Chris On 14/02/14 19:37, Wolstenholme, Robert wrote: > I want to compile some of my GAP functions into static libraries for use in a C program. I have compiled them using gac -c on Ubuntu but I 'm not sure how to now call these functions in my C program. I tried a few things but whenever I tried to link and create a binary I got an error. > > For example I initially tried a "Hello World" example with > > HelloWorld.g = > -------------------------------------------------------------+ > PrintEO := function ( n ) Print( "Hello World" ); end; | > -------------------------------------------------------------+ > > HelloWorldMain.c = > -----------------------+ > #include | > | > '''?void PrintEO()?'''' | > int main() | > { | > '''?PrintEO()?''' | > return 0; | > } | > -----------------------+ > Where I don't know what to put for the '''?PrintEO()?'''. I analysed the created source code using gac -C but it still wasn't clear to me. How would I go about getting this to work? > > Rob > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From r_n_tsai at yahoo.com Sun Feb 16 19:56:42 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Sun, 16 Feb 2014 11:56:42 -0800 (PST) Subject: [GAP Forum] semsimple algebras and subalgebras Message-ID: <1392580602.83900.YahooMailNeo@web121206.mail.ne1.yahoo.com> Dear forum, I am using the sla package to do calcualtions with semisimple lie algebras and their subalgebras. The calculations involve decomposing an irrep of the main algebra into irreps of one of its subalgebras. The "Branching" functions works great at providing this data. I'd like to extract some more information on this decomposition for the adjoint irrep of the main algebra. I'd like to identify the subalgebra irreps with concrete subspaces of the main algebra. Is there a (hopefully simple) way to extract this information? Here's an example for main algebra "G2" and its "A2" subalgebra : LoadPackage("sla"); # get all semisimple subalgebras of "G2" LS:=LieAlgebraAndSubalgebras("G2"); # alg is "G2" alg:=LS.liealg; # subalgebra number 5 is "A2";? sub:=LS.subalgs[5]; # rep with highest weight [0,1] is adjoint rep of "G2" rep:=[0,1]; # get branching of G2 rep to A2 reps bra:=Branching(alg,sub,rep); # display results for k in [1..Length(bra[1])] do? ?Print("subspcace ",k," "); ?Print("weight=",bra[1][k]," "); ?Print("multiplicity = ",bra[2][k]," "); ?Print("dimensions = ",Dimension(HighestWeightModule(sub,bra[1][k]))," "); ?Print("\n"); od; in shorthand this says that G2 decomposes as 14 = 8 + 3 + 3' under A2. Here 14=G2, 8=A2, 3 and 3' are 3-dimensional subspaces of G2 invraiant under A2. I'd like for example to multiply elements of 3 with those of 3'... As a side question, for G2 I happen to know that heighst weight rep [0,1] is the adjoint rep; is there a general way to get the weight of the adjoint rep for an arbitrary semisimple algebra? Thanks, R.N. From degraaf at science.unitn.it Mon Feb 17 08:39:44 2014 From: degraaf at science.unitn.it (Willem de Graaf) Date: Mon, 17 Feb 2014 09:39:44 +0100 Subject: [GAP Forum] semsimple algebras and subalgebras In-Reply-To: <1392580602.83900.YahooMailNeo@web121206.mail.ne1.yahoo.com> References: <1392580602.83900.YahooMailNeo@web121206.mail.ne1.yahoo.com> Message-ID: Dear R.N. Tsai, You asked: > I'd like to identify > the subalgebra irreps with concrete subspaces of the main algebra. Is there > a (hopefully simple) way to extract this information? Not directly, however it is not so difficult to write some code for that. At the bottom of this message please find a GAP function that does that. It is followed by an example. One remark: in your piece of code you use the command Dimension(HighestWeightModule(sub,bra[1][k])) It is much more efficient to use DimensionOfHighestWeughtModule( sub, bra[1][k] ); as this avoids constructing the module. You also asked: > is there a general way to get the weight of the adjoint rep for an > arbitrary semisimple algebra? If the Lie algebra is denoted L, then you can do wt:= PositiveRootsAsWeights( RootSystem(L) );; hw:= wt[ Length(wt) ]; I am glad that the sla package is of use to you. Best wishes, Willem de Graaf # function: DecomposeAdRep:= function( L, K ) # K is a subalgebra of L, both semisimple in char 0; # we return the decomposition of L as K module. local cg, e, x, ad, i, spaces, spaces0, h, ww, sp, mat, es, hwv; cg:= CanonicalGenerators( RootSystem(K) ); e:= List( Basis(L), x -> [ ] ); for x in cg[1] do ad:= TransposedMat( AdjointMatrix(Basis(L),x) ); for i in [1..Length(ad)] do Append( e[i], ad[i] ); od; od; spaces:= [ List( NullspaceMat(e), u -> u*Basis(L) ) ]; for h in cg[3] do spaces0:= [ ]; for ww in spaces do sp:= Basis( Subspace(L,ww), ww ); mat:= List( ww, u-> Coefficients(sp,h*u) ); es:= Eigenspaces( LeftActingDomain(L), mat ); for i in [1..Length(es)] do Add( spaces0, List( Basis(es[i]), x -> x*ww ) ); od; od; spaces:= spaces0; od; hwv:= Concatenation( spaces ); spaces:= [ ]; for i in [1..Length(hwv)] do Add( spaces, MutableBasisOfClosureUnderAction( LeftActingDomain(L), cg[2], "left", [ hwv[i] ], \*, Zero(L), Dimension(L) ) ); od; return List( spaces, u -> Subspace(L,BasisVectors(u)) ); end; # example: gap> r:= LieAlgebraAndSubalgebras("G2");; gap> L:= r.liealg;; gap> K:= r.subalgs[5];; gap> DecomposeAdRep( L, K ); [ , , ] From r_n_tsai at yahoo.com Mon Feb 17 20:32:15 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Mon, 17 Feb 2014 12:32:15 -0800 (PST) Subject: [GAP Forum] semsimple algebras and subalgebras In-Reply-To: References: <1392580602.83900.YahooMailNeo@web121206.mail.ne1.yahoo.com> Message-ID: <1392669135.40466.YahooMailNeo@web121205.mail.ne1.yahoo.com> Dear Willem and forum, Thanks for the quick response. The function you created "DecomposeAdRep" is exactly what I was looking for. Also getting the highest weight of the adjoint rep works for simple algebras; but I think it has trouble with direct sum of simple algebras : # A1+A1 -> A1 (or D2->D1 or O4->O3 ) branching rule for adjoint rep : gap> r:=LieAlgebraAndSubalgebras("A1 A1");; gap> L:= r.liealg;; gap> K:= r.subalgs[1];; # this gives the correct decomposition : 6->3+1+1+1; gap> dec:=DecomposeAdRep( L, K ); [ , ,? ? , ] # however this has a problem; dim should be 6. gap> wt:= PositiveRootsAsWeights( RootSystem(L) );; gap> hw:= wt[ Length(wt) ]; [ 0, 2 ] gap> dim:=DimensionOfHighestWeightModule(L,hw); 3 Regards, R.N. On Monday, February 17, 2014 12:39 AM, Willem de Graaf wrote: Dear?R.N. Tsai, You asked: > I'd like to identify > the subalgebra irreps with concrete subspaces of the main algebra. Is there > a (hopefully simple) way to extract this information? Not directly, however it is not so difficult to write some code for that. At the bottom of this message please find a GAP function that does that. It is followed by an example.? One remark: in your piece of code you use the command ? ? ? Dimension(HighestWeightModule(sub,bra[1][k])) It is much more efficient to use? ? ? ? DimensionOfHighestWeughtModule( sub, bra[1][k] ); as this avoids constructing the module. You also asked: > is there a general way to get the weight of the adjoint rep for an > arbitrary semisimple algebra? If the Lie algebra is denoted L, then you can do wt:= PositiveRootsAsWeights( RootSystem(L) );; hw:= wt[ Length(wt) ]; I am glad that the sla package is of use to you. Best wishes, Willem de Graaf # function: DecomposeAdRep:= function( L, K )? ? ? ? ? # K is a subalgebra of L, both semisimple in char 0; ? ? ? ? # we return the decomposition of L as K module. ? ? local cg, e, x, ad, i, spaces, spaces0, h, ww, sp, mat, es, hwv; ? ? cg:= CanonicalGenerators( RootSystem(K) ); ? ? e:= List( Basis(L), x -> [ ] ); ? ? for x in cg[1] do ? ? ? ? ad:= TransposedMat( AdjointMatrix(Basis(L),x) ); ? ? ? ? for i in [1..Length(ad)] do ? ? ? ? ? ? Append( e[i], ad[i] ); ? ? ? ? od; ? ? od; ? ? spaces:= [ List( NullspaceMat(e), u -> u*Basis(L) ) ]; ? ? for h in cg[3] do ? ? ? ? spaces0:= [ ]; ? ? ? ? for ww in spaces do? ? ? ? ? ? ? sp:= Basis( Subspace(L,ww), ww ); ? ? ? ? ? ? mat:= List( ww, u-> Coefficients(sp,h*u) ); ? ? ? ? ? ? ? es:= Eigenspaces( LeftActingDomain(L), mat ); ? ? ? ? ? ? for i in [1..Length(es)] do ? ? ? ? ? ? ? ? Add( spaces0, List( Basis(es[i]), x -> x*ww ) ); ? ? ? ? ? ? od; ? ? ? ? od; ? ? ? ? spaces:= spaces0; ? ? od; ? ? hwv:= Concatenation( spaces ); ? ? spaces:= [ ]; ? ? for i in [1..Length(hwv)] do ? ? ? ? Add( spaces, MutableBasisOfClosureUnderAction( LeftActingDomain(L), ? ? ? ? ? ? ? ? ?cg[2], "left", [ hwv[i] ], \*, Zero(L), Dimension(L) ) ); ? ? od; ? ? return List( spaces, u -> Subspace(L,BasisVectors(u)) ); end; # example: gap> r:= LieAlgebraAndSubalgebras("G2");; gap> L:= r.liealg;; gap> K:= r.subalgs[5];; gap> DecomposeAdRep( L, K ); [ ,? ? ,? ? ] From degraaf at science.unitn.it Mon Feb 17 22:19:50 2014 From: degraaf at science.unitn.it (Willem de Graaf) Date: Mon, 17 Feb 2014 23:19:50 +0100 Subject: [GAP Forum] semsimple algebras and subalgebras In-Reply-To: <1392669135.40466.YahooMailNeo@web121205.mail.ne1.yahoo.com> References: <1392580602.83900.YahooMailNeo@web121206.mail.ne1.yahoo.com> <1392669135.40466.YahooMailNeo@web121205.mail.ne1.yahoo.com> Message-ID: Dear R. N. Tsai, > Also getting the highest weight of the > adjoint rep works for simple algebras; but I think it has trouble with > direct sum of simple algebras : In that case the module is not irreducible, so there is no single highest weight. All the best, Willem de Graaf On Mon, Feb 17, 2014 at 9:32 PM, R.N. Tsai wrote: > Dear Willem and forum, > > Thanks for the quick response. The function you created "DecomposeAdRep" is > exactly what I was looking for. Also getting the highest weight of the > adjoint rep works for simple algebras; but I think it has trouble with > direct sum of simple algebras : > > # A1+A1 -> A1 (or D2->D1 or O4->O3 ) branching rule for adjoint rep : > gap> r:=LieAlgebraAndSubalgebras("A1 A1");; > gap> L:= r.liealg;; > gap> K:= r.subalgs[1];; > # this gives the correct decomposition : 6->3+1+1+1; > gap> dec:=DecomposeAdRep( L, K ); > [ , 1 over Rationals>, > , 1 over Rationals> ] > > # however this has a problem; dim should be 6. > gap> wt:= PositiveRootsAsWeights( RootSystem(L) );; > gap> hw:= wt[ Length(wt) ]; > [ 0, 2 ] > gap> dim:=DimensionOfHighestWeightModule(L,hw); > 3 > > Regards, > R.N. > > > On Monday, February 17, 2014 12:39 AM, Willem de Graaf < > degraaf at science.unitn.it> wrote: > Dear R.N. Tsai, > > > You asked: > > > I'd like to identify > > the subalgebra irreps with concrete subspaces of the main algebra. Is > there > > a (hopefully simple) way to extract this information? > > Not directly, however it is not so difficult to write some code for that. > At the bottom of this message please find a GAP function that does that. > It is followed by an example. > > One remark: in your piece of code you use the command > > Dimension(HighestWeightModule(sub,bra[1][k])) > > It is much more efficient to use > > DimensionOfHighestWeughtModule( sub, bra[1][k] ); > > as this avoids constructing the module. > > You also asked: > > > is there a general way to get the weight of the adjoint rep for an > > arbitrary semisimple algebra? > > If the Lie algebra is denoted L, then you can do > > wt:= PositiveRootsAsWeights( RootSystem(L) );; > hw:= wt[ Length(wt) ]; > > I am glad that the sla package is of use to you. > > Best wishes, > > Willem de Graaf > > # function: > > DecomposeAdRep:= function( L, K ) > > # K is a subalgebra of L, both semisimple in char 0; > # we return the decomposition of L as K module. > > local cg, e, x, ad, i, spaces, spaces0, h, ww, sp, mat, es, hwv; > > cg:= CanonicalGenerators( RootSystem(K) ); > e:= List( Basis(L), x -> [ ] ); > for x in cg[1] do > ad:= TransposedMat( AdjointMatrix(Basis(L),x) ); > for i in [1..Length(ad)] do > Append( e[i], ad[i] ); > od; > od; > spaces:= [ List( NullspaceMat(e), u -> u*Basis(L) ) ]; > > for h in cg[3] do > spaces0:= [ ]; > for ww in spaces do > sp:= Basis( Subspace(L,ww), ww ); > mat:= List( ww, u-> Coefficients(sp,h*u) ); > es:= Eigenspaces( LeftActingDomain(L), mat ); > for i in [1..Length(es)] do > Add( spaces0, List( Basis(es[i]), x -> x*ww ) ); > od; > od; > spaces:= spaces0; > od; > > hwv:= Concatenation( spaces ); > spaces:= [ ]; > for i in [1..Length(hwv)] do > Add( spaces, MutableBasisOfClosureUnderAction( LeftActingDomain(L), > cg[2], "left", [ hwv[i] ], \*, Zero(L), Dimension(L) ) ); > od; > return List( spaces, u -> Subspace(L,BasisVectors(u)) ); > > end; > > # example: > > gap> r:= LieAlgebraAndSubalgebras("G2");; > gap> L:= r.liealg;; > gap> K:= r.subalgs[5];; > gap> DecomposeAdRep( L, K ); > [ , > , > ] > > > > > From markvs at gmail.com Tue Feb 18 11:42:47 2014 From: markvs at gmail.com (Mark Sapir) Date: Tue, 18 Feb 2014 05:42:47 -0600 Subject: [GAP Forum] Forum Digest, Vol 119, Issue 2 In-Reply-To: References: Message-ID: Dear All, I finally got a 128 Gb RAM machine and I am trying to run the following program commuting a non-commutative Groebner basis. After a a couple of hours GAP says that it is out of RAM. I guess I need to change the way I call GAP so that it knows that more memory can be used. Also if anybody can tell me about a different, stand alone, programs that compute non-commutative Groebner bases, I would appreciate it. LoadPackage("GBNP", "0", false); SetInfoLevel(InfoGBNP,1); SetInfoLevel(InfoGBNPTime,1); K:=GaloisField(2); A:=FreeAssociativeAlgebra(K," a","b","c","d"); a:=A.a;;b:=A.b;;c:=A.c;;d:=A.d;; Irels:=[ a-a*a*c-d*a*b, b-a*b*c-d*b*b, c-a*c*c-d*c*b, d-a*d*c-d*d*b, a*b*c-a*c*b-b*c*a+b*a*c, ]; GBR:=SGrobner(GP2NPList(Irels));;PrintNPList(GBR); Best regards, Mark Sapir From dmitrii.pasechnik at cs.ox.ac.uk Tue Feb 18 12:32:31 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dmitrii Pasechnik) Date: Tue, 18 Feb 2014 12:32:31 +0000 Subject: [GAP Forum] Forum Digest, Vol 119, Issue 2 In-Reply-To: References: Message-ID: <20140218123231.GA19616@cs.ox.ac.uk> Dear Mark, On Tue, Feb 18, 2014 at 05:42:47AM -0600, Mark Sapir wrote: > I finally got a 128 Gb RAM machine and I am trying to run the > following program commuting a non-commutative Groebner basis. After a > a couple of hours GAP says that it is out of RAM. I guess I need to > change the way I call GAP so that it knows that more memory can be > used. There is a useful GAP function: 7.11-3 GasmanLimits GasmanLimits( ) ( function ) GasmanLimits returns a record with three components: min is the minimum workspace size as set by the -m command line option in kilobytes. The workspace size will never be reduced below this by the garbage collector. max is the maximum workspace size, as set by the '-o' command line option, also in kilobytes. If the workspace would need to grow past this point, GAP will enter a break loop to warn the user. A value of 0 indicates no limit. kill is the absolute maximum, set by the -K command line option. The workspace will never be allowed to grow past this limit. E.g.: gap> GasmanLimits( ); rec( kill := 0, max := 2097152, min := 24576 ) What matters is that kill=0 (i.e. nothing will happen no matter how much RAM you get) max is about 2GB. So in your case max should be set by -o option to something much bigger > Also if anybody can tell me about a different, stand alone, > programs that compute non-commutative Groebner bases, I would > appreciate it. Singular can apparently compute non-commutatibe GBs: http://www.singular.uni-kl.de/Manual/latest/sing_539.htm#SEC590 HTH, Dima > > > LoadPackage("GBNP", "0", false); > SetInfoLevel(InfoGBNP,1); > SetInfoLevel(InfoGBNPTime,1); > K:=GaloisField(2); > A:=FreeAssociativeAlgebra(K," > a","b","c","d"); > a:=A.a;;b:=A.b;;c:=A.c;;d:=A.d;; > Irels:=[ > a-a*a*c-d*a*b, > b-a*b*c-d*b*b, > c-a*c*c-d*c*b, > d-a*d*c-d*d*b, > > a*b*c-a*c*b-b*c*a+b*a*c, > > ]; > > GBR:=SGrobner(GP2NPList(Irels));;PrintNPList(GBR); > > Best regards, > > Mark Sapir > > _______________________________________________ > Forum mailing list > Forum at mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum From dream--1234 at hotmail.com Mon Feb 17 10:22:14 2014 From: dream--1234 at hotmail.com (=?ks_c_5601-1987?B?rNyl4aLnpeV6rN5hIC4=?=) Date: Mon, 17 Feb 2014 13:22:14 +0300 Subject: [GAP Forum] please help me Message-ID: Hi How can I extend the "permitted memory" for GAP I used return; after the loop is broken but the window of GAP IS closes ( My computer system is windos ) please help me From r_n_tsai at yahoo.com Thu Feb 20 06:17:10 2014 From: r_n_tsai at yahoo.com (R.N. Tsai) Date: Wed, 19 Feb 2014 22:17:10 -0800 (PST) Subject: [GAP Forum] value of casimir elements Message-ID: <1392877030.8462.YahooMailNeo@web121205.mail.ne1.yahoo.com> Dear forum, For a simple lie algebra (of rank n) and a highest weight representation (w1,...wn); is it possible to calculate the values of the n casimir invariants (as functions of w1,...,wn) within GAP or any of its packages? Thanks, R.N. ? From hulpke at math.colostate.edu Mon Feb 24 17:40:28 2014 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Mon, 24 Feb 2014 10:40:28 -0700 Subject: [GAP Forum] Conference: Software, algorithms, and applications of Computational Group Theory, Aug 2014, Seoul References: <20140212085411.6c73acb8ca0d03dd345a9738@monash.edu> Message-ID: Dear Colleagues, (With apologies to anyone who is receiving this notice more than once) We are organizing a special session: "Software, algorithms, and applications of Computational Group Theory" at the 4th International Congress on Mathematical Software (ICMS), Aug 5-9, 2014 (Hanyang University, Seoul, South Korea) which is a satellite conference of the ICM 2014. This session will host talks on current aspects and recent progress of algorithms and software for computing with groups, incorporating all areas of algorithmic development. Talks on work in other areas, involving nontrivial computations in groups or related structures are also welcome, as will be talks that outline problems from other areas of computational mathematics that arise as obstacles in the context of group theoretic calculations. We invite you to attend this conference, and to submit an abstract for a talk. (To be considered for a talk, you must submit a short abstract to us by March 31, 2014.) For more information: ICMS 2014: http://voronoi.hanyang.ac.kr/icms2014/ Special Session: http://users.monash.edu.au/~heikod/ICMSCGT.html Guidelines on talk submissions: http://voronoi.hanyang.ac.kr/icms2014/Submission.html Please circulate this information to anyone who might be interested to attend. With best wishes, The organizers: Heiko Dietrich (Monash University, Melbourne, Australia) Alexander Hulpke (Colorado State University, Fort Collins, CO, USA) From alexk at mcs.st-andrews.ac.uk Mon Feb 24 17:46:32 2014 From: alexk at mcs.st-andrews.ac.uk (Alexander Konovalov) Date: Mon, 24 Feb 2014 17:46:32 +0000 Subject: [GAP Forum] GAP 4.7.4 release announcement Message-ID: Dear GAP Forum, This is to announce the release of GAP 4.7.4. You can download GAP 4.7.4 from http://www.gap-system.org/Releases/ The alternative GAP distributions listed at http://www.gap-system.org/Download/#alternatives will be updated in due course. We haven't announced GAP 4.7.3 last week, since we prepared GAP 4.7.4 immediately after that to revert a change in the GAP parser that (only on Windows) caused error messages in one of the packages. The overview of changes in GAP 4.7.4 versus GAP 4.7.2 is given below. Fixed bugs which could lead to incorrect results: * Incorrect result returned by AutomorphismGroup(PSp(4,2^n)). [Reported by Anvita] * The Order (Reference: Order) method for group homomorphisms newly introduced in GAP 4.7 had a bug that caused it to sometimes return incorrect results. [Reported by Benjamin Sambale] Fixed bugs that could lead to break loops: * Several bugs were fixed and missing methods were introduced in the new code for transformations, partial permutations and semigroups that was first included in GAP 4.7. Some minor corrections were made in the documentation for transformations. * Break loop in IsomorphismFpMonoid when prefixes in generators names were longer than one letter. [Reported by Dmytro Savchuk and Yevgen Muntyan] * Break loop while displaying the result of MagmaWithInversesByMultiplicationTable [Reported by Grahame Erskine] Improved functionality: * Better detection of UTF-8 terminal encoding on some systems. [Suggested by Andries Brouwer] In addition to the improved functionality and fixed bugs in the core GAP system, the following packages have been updated since GAP 4.7.2 release: AutomGrp, AutPGrp, CoReLG, CRISP, Float, FR, HAP, IRREDSOL, LieRing, MatricesForHomalg, RingsForHomalg and SimpComp. We encourage all users to upgrade to GAP 4.7.4. If you need any help or would like to report any problems, please do not hesitate to contact us at support at gap-system.org. Please note that we regularly update the GAP distribution to include new versions of GAP packages, but we may not announce each of them to the Forum. We intend to use the Forum to announce updates of the core GAP system and only of some packages which may fix serious issues or have major influence on GAP. Wishing you fun and success using GAP, The GAP Group From steve.linton at st-andrews.ac.uk Sat Feb 22 16:26:19 2014 From: steve.linton at st-andrews.ac.uk (Stephen Linton) Date: Sat, 22 Feb 2014 16:26:19 +0000 Subject: [GAP Forum] Embedding GAP functions in C code Message-ID: <7AFDA5A4-07D5-495B-9B0A-4BDEEEBDF7E6@st-andrews.ac.uk> Dear Robert, On Fri, Feb 14, 2014 at 07:37:12PM +0000, Wolstenholme, Robert wrote: > I want to compile some of my GAP functions into static libraries for use in a C program. I have compiled them using gac -c on Ubuntu but I 'm not sure how to now call these functions in my C program. I tried a few things but whenever I tried to link and create a binary I got an error. There is no ?official? way to do this. The gac compiler converts GAP into C code which can be loaded as an extension to the GAP kernel, but it still needs the rest of the kernel and very possibly large parts of the library in order to run. See http://www.gap-system.org/Faq/faq.html#8.1 Relatively recently, some of the SAGE developers have produced libGAP, which allows the entire GAP system to be embedded as a C library. You still can?t embed individual functions by themselves though and the first call to libGAP still has invoke the full GAP start-up sequence. Alternatively, there are a number of ways of running GAP as a server process and calling it from C or C++ programs. SCSCP is probably the simplest of these to use. Seehttp://www.gap-system.org/Packages/scscp.html for the GAP side. There are various C and C++ libraries that implement the client side. Yours Steve Linton From graham.ellis at nuigalway.ie Tue Feb 25 08:41:10 2014 From: graham.ellis at nuigalway.ie (Ellis, Grahamj) Date: Tue, 25 Feb 2014 08:41:10 +0000 Subject: [GAP Forum] simpcomp Message-ID: Dear GAP Forum, It is my pleasure to announce that the simpcomp package has been accepted as an official GAP package. The package, authored by Felix Effenberger and Jonathan Spreer, is a great addition to GAP's functionality in the area of simplicial complexes. ( https://code.google.com/p/simpcomp/ ) simpcomp is a GAP package for working with simplicial complexes. It allows the computation of many properties of simplicial complexes (such as the f-, g- and h-vectors, the face lattice, the automorphism group, (co-)homology with explicit basis computation, intersection form, etc.) and provides the user with functions to compute new complexes from old (simplex links and stars, connected sums, cartesian products, handle additions, bistellar flips, etc.). Furthermore, it comes with an extensive library of known triangulations of manifolds and provides the user with the possibility to create own complex libraries. simpcomp was awarded the "Best Software Presentation Award" by the Fachgruppe Computeralgebra for a presentation given at ISSAC 2010 in Munich, July 26, 2010. Graham School of Mathematics, Statistics & Applied Mathematics National University of Ireland, Galway University Road, Galway Ireland http://hamilton.nuigalway.ie tel: 091 493011 From beick at tu-bs.de Tue Feb 25 10:20:38 2014 From: beick at tu-bs.de (Bettina Eick) Date: Tue, 25 Feb 2014 11:20:38 +0100 (CET) Subject: [GAP Forum] The CoReLG package Message-ID: Dear GAP Forum, it is my great pleasure to announce that the CoReLG package has been officially accepted as GAP package. The package is authored by Heiko Dietrich (Melbourne, Australia), Paolo Faccin (Trento, Italy) and Willem de Graaf (Trento, Italy). The CoReLG package contains methods for computing with finite dimensional semisimple real Lie algebras. In particular, the CoReLG package gives access to the classification of the real forms of a simple complex Lie algebra. Hence the package provides a method to construct simple and thus semisimple Lie algebras over the real numbers. The package also contains methods to compute Cartan subalgebras and root systems for semisimple real Lie algebras. See http://www.gap-system.org/Packages/corelg.html for further information on this new GAP package. Best wishes, Bettina Eick From bilal_hasanat at yahoo.com Wed Mar 5 05:01:49 2014 From: bilal_hasanat at yahoo.com (Bilal Hasanat) Date: Tue, 4 Mar 2014 21:01:49 -0800 (PST) Subject: [GAP Forum] SemiDirect product Message-ID: <1393995709.10811.YahooMailNeo@web121002.mail.ne1.yahoo.com> Dear Gap users I am interested in group theory. Kindly, I need a help to construct a GAP algorithm or used certain installed packages if exist, that is for finding the semidirect?product of (C25?C25) and ?C25. I do not concern on how C5 acts on?(C25?C25). I need to find many issues for the group obtained from this product; such as: the order of the group, the number of generators, the order of each generator and other properties. I will be very grateful for your help.? Kind regards ? Bilal From mborges at csd.uo.edu.cu Sat Mar 8 17:30:02 2014 From: mborges at csd.uo.edu.cu (Borges-Trenard) Date: Sat, 8 Mar 2014 18:30:02 +0100 Subject: [GAP Forum] Iterated algebraic extensions. Message-ID: <73477FDCD3FD4955A3C3D376D5546C08@uva219d20b1dcb> Dear GAP forum, I am trying to compute the finite field F_{3^6} by means of extending first F_3 through x^2+2*x+2 and then the second extension with y^3+a1*y^2+a1*y+a1^3, where a1 is a root of x^2+2*x+2. Then I have used the following instructions (GAP 4.7.2): gap> x := Indeterminate( GF( 3 ) );; SetName( x, "x" );; gap> e1 := AlgebraicExtension( GF( 3 ), x^2 + 2 * x + 2 );; gap> a1 := RootOfDefiningPolynomial( e1 );; gap> y := Indeterminate( e1 );; SetName( y, "y" );; gap> e2 := AlgebraicExtension( e1, y^3 + a1 * y^2 + a1 * y + a1^3 );; gap> a2 := RootOfDefiningPolynomial( e2 );; Now I face at least two troubles: 1) I can perform operations with a1 and a2 but the result is not clear, for example: gap> a1 * a2; a*a The point is that RootOfDefiningPolynomial always prints like "a", I have not found a way to change it. 2) A simple operation like the following one is not already possible: gap> a2^2; I will be very grateful for any help. Many thanks, Miguel. -- Se integran todos los eventos de Ciencias T?cnicas de la Universidad de Oriente: *- Convenci?n Internacional de Ciencias T?cnicas 23 al 27 de Junio de 2014: http://cienciastecnicas.eventos.uo.edu.cu/ Convocatoria a nuestro evento internacional de mayor experiencia: *- 21 Conferencia de Qu?mica: 3 al 5 de diciembre de 2014 http://ciq.eventos.uo.edu.cu/ -- From matliumh at gmail.com Tue Mar 11 04:23:32 2014 From: matliumh at gmail.com (Minghui Liu) Date: Tue, 11 Mar 2014 12:23:32 +0800 Subject: [GAP Forum] Generators of Factor Groups Message-ID: Dear GAP Forum, I am trying to find generators of a factor group. I have input dozens of generators and relations and when I use the command AbelianInvariants(F/relations); the result was something like 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5 (I have reduced the number of 0's for simplicity.) My question is, the result shows that the Abelianization of F/relations is a direct sum of some Z's and some finite cyclic groups; how can I find an explicit set of generators? I am especially interested in how to find the elements of order 2, 3, 4, 5, respectively. Any assistance will be greatly appreciated. Minghui From dmitrii.pasechnik at cs.ox.ac.uk Tue Mar 11 12:33:58 2014 From: dmitrii.pasechnik at cs.ox.ac.uk (Dmitrii Pasechnik) Date: Tue, 11 Mar 2014 12:33:58 +0000 Subject: [GAP Forum] Generators of Factor Groups In-Reply-To: References: Message-ID: <20140311123357.GA12722@cs.ox.ac.uk> Dear Minghui Liu, On Tue, Mar 11, 2014 at 12:23:32PM +0800, Minghui Liu wrote: > I am trying to find generators of a factor group. I have input dozens > of generators and relations and when I use the command > > AbelianInvariants(F/relations); Have you looked at SmithNormalFormIntegerMat SmithNormalFormIntegerMatTransforms The transformation to apply to your original generators should be readable from the output of SmithNormalFormIntegerMatTransforms. IMHO it would be nice to have a more explicit function for the task at hand. HTH, Dima > > the result was something like > > 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5 > > (I have reduced the number of 0's for simplicity.) > > My question is, the result shows that the Abelianization of > F/relations is a direct sum of some Z's and some finite cyclic groups; > how can I find an explicit set of generators? I am especially > interested in how to find the elements of order 2, 3, 4, 5, > respectively. > > Any assistance will be greatly appreciated. > > Minghui From max at quendi.de Tue Mar 11 13:02:38 2014 From: max at quendi.de (Max Horn) Date: Tue, 11 Mar 2014 14:02:38 +0100 Subject: [GAP Forum] Generators of Factor Groups In-Reply-To: References: Message-ID: <2CD07E78-67A5-471D-973F-014175E18E6F@quendi.de> On 11.03.2014, at 05:23, Minghui Liu wrote: > Dear GAP Forum, > > I am trying to find generators of a factor group. I have input dozens > of generators and relations and when I use the command > > AbelianInvariants(F/relations); > > the result was something like > > 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5 > > (I have reduced the number of 0's for simplicity.) > > My question is, the result shows that the Abelianization of > F/relations is a direct sum of some Z's and some finite cyclic groups; > how can I find an explicit set of generators? I am especially > interested in how to find the elements of order 2, 3, 4, 5, > respectively. > > Any assistance will be greatly appreciated. This is quite easy to do using the commands MaximalAbelianQuotient() and IndependentGeneratorsOfAbelianGroup(). The following example should tell you everything you need to know. But feel free to ask for further hints. # Let's enter a group (I just picked some generators "at random") gap> F:=FreeGroup(3); gap> R:=[Comm(F.1,F.2), F.3^10, F.1*F.2*F.3]; [ f1^-1*f2^-1*f1*f2, f3^10, f1*f2*f3 ] gap> G:=F/R; # Compute the abelian invariants, and an epimorphism phi: G -> G/G' gap> AbelianInvariants(G); [ 0, 2, 5 ] gap> phi:=MaximalAbelianQuotient(G); [ f1, f2, f3 ] -> [ f1*f2^-1*f3^-1, f3, f2 ] gap> H:=Image(phi); # Get generators of the quotient H = G / G' which correspond exactly # to the abelian invariants. This is by design and described as such # in the manual. But we can also verify it in this example. gap> gens:=IndependentGeneratorsOfAbelianGroup(H); [ f3, f2^5, f2^2 ] # ... verification ... gap> Order(gens[2]); 2 gap> Order(gens[3]); 5 gap> Index(H, Subgroup(H,[gens[1]])); 10 # We can also map these generators back to elements of the original group; # but usually you will want to work in the abelian quotient H for this. gap> List(gens, x -> PreImagesRepresentative(phi, x)); [ f2, f3^5, f3^2 ] Cheers, Max From jdc at uwo.ca Tue Mar 11 15:56:45 2014 From: jdc at uwo.ca (Dan Christensen) Date: Tue, 11 Mar 2014 11:56:45 -0400 Subject: [GAP Forum] increasing -o memory limit at runtime Message-ID: <874n34buf6.fsf@uwo.ca> Is there a GAP command that can be used to increase the memory limit (as would specified by the -o option) at run time, instead of using -o on the command line? (I'm using GAP via the sage cloud interface and haven't been able to figure out how to get gap started with a -o option.) Incidentally, is the default 256MB? That seems really low for modern systems. Thanks, Dan From max at 9hoeffer.de Wed Mar 12 19:28:27 2014 From: max at 9hoeffer.de (Max Neunhoeffer) Date: Wed, 12 Mar 2014 20:28:27 +0100 Subject: [GAP Forum] The LieRing package Message-ID: <20140312192826.GA6030@sams.9hoeffer.de> Dear GAP Forum, it is my great pleasure to announce that the LieRing package has been officially accepted as GAP package. The package is authored by Serena Cicalo (Trento, Italy) and Willem de Graaf (Trento, Italy). The LieRing package implements methods to construct and work with Lie rings. It contains methods to construct finitely-presented Lie rings, to compute the Lazard correspondence and it contains a database of "largest" n-Engel Lie rings. The package in its current version 2.2 is already contained in the latest official GAP distribution 4.7.4 which was released on 20.2.2014. See http://gap-system.org/Packages/liering.html for further information on this GAP package. Best regards, Max Neunh?ffer From astaroletov at gmail.com Mon Mar 17 11:17:12 2014 From: astaroletov at gmail.com (Alexey Staroletov) Date: Mon, 17 Mar 2014 18:17:12 +0700 Subject: [GAP Forum] Galois Rings in GAP Message-ID: Dear GAP forum, Is it possible to obtain finite Galois Rings and their multiplicative group of units in GAP? Namely, factor rings of Z_{p^n}[x] by a basic irreducible polynomial over Z_{p^n}. I know how to build PolynomialRing but can't obtain factor rings by ideals. This is an output of my GAP (4.6.3) session : gap> T:=Integers mod 4; (Integers mod 4) gap> x:= Indeterminate( T, "x" ); x gap> Pol:=x^4+x+1; x^4+x+ZmodnZObj(1,4) gap> R:=PolynomialRing( T );