From 2b74d1d4ed5409a696136e7217c4287a5a85ebcd Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 13:29:01 +0530 Subject: [PATCH 01/22] Added a method to deal with non solvable groups --- lib/grp.gi | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/lib/grp.gi b/lib/grp.gi index 76c8861eb5..efd850f3ff 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -130,9 +130,96 @@ end); InstallOtherMethod(MinimalGeneratingSet,"fallback method to inform user",true, [IsObject],0, function(G) + local + check,GbyGk, + Gkm1byGk, + Gkm1byGk_L, + Gkm1byGk_elem_reps, + Gkm1byGk_gen, + Gkm1byGk_gen_reps, + mingenset_km1_reps, + mingenset_k_reps, + temp,i,j,l,L,x,xl,y,last,gmod,N,g,g0,g1,s,r,stop, + cs,phi_GbyG1,GbyG1,Gk,Gkm1,phi_GbyGk,phi_Gkm1byGk,k; if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); else + cs := ChiefSeries(G); + phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); + GbyG1 := ImagesSource(phi_GbyG1); + mingenset_k_reps := List(SmallGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); + for k in [3..Length(cs)] do # Lifting + mingenset_km1_reps := mingenset_k_reps; + Gk := cs[k]; + Gkm1 := cs[k-1]; + phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,Gk); + phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(Gkm1,Gk); + Gkm1byGk := ImagesSource(phi_Gkm1byGk); + GbyGk := ImagesSource(phi_GbyGk); + check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); + Gkm1byGk_elem_reps := List(AsList(Gkm1byGk),x -> PreImagesRepresentative(phi_Gkm1byGk,x)); + Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); + Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); + g := ShallowCopy(mingenset_km1_reps); + stop := false; + if IsAbelian(Gkm1byGk) then + if check(g) then mingenset_k_reps := g; fi; + for i in [1..Length(g)] do + if stop then break; fi; + for j in [1..Length(Gkm1byGk_gen_reps)] do + temp := g[i]; + g[i] := temp * Gkm1byGk_gen_reps[j]; + if check(g) then + mingenset_k_reps := g; + stop := true; + break; + fi; + g[i] := temp; + od; + od; + Add(g,Gkm1byGk_gen_reps[1]); + mingenset_k_reps := g; + else + g0 := ShallowCopy(mingenset_km1_reps); + g := ShallowCopy(mingenset_km1_reps); + Add(g,Gkm1byGk_elem_reps[1]); + g1 := ShallowCopy(g); + for g in [g0,g1] do + if stop then break;fi; + l := Length(g); + L := Length(Gkm1byGk_elem_reps); + s := L^l; + last := []; + for i in [l,l-1..1] do last[i] := 1; od; + gmod := ShallowCopy(g); + for x in [0..s-1] do + xl := []; + for i in [1..l] do xl[i] := 0; od; + i := 1; + while x > 0 do + r := RemInt(x,L); + x := QuoInt(x,L); + xl[i]:=r; + i:= i+1; + od; + for i in [1..l] do + if xl[i] <> last[i] then + gmod[i] := g[i] * Gkm1byGk_elem_reps[xl[i]+1]; + fi; + od; + if check(gmod) then + mingenset_k_reps := gmod; + stop := true; + break; + fi; + last := xl; + od; + od; + fi; + od; + if G = GroupByGenerators(mingenset_k_reps) then return mingenset_k_reps; fi; + Print("Calculated mingen doesn't generate the group."); + return mingenset_k_reps; Error( "`MinimalGeneratingSet' currently assumes that the group is solvable, or\n", "already possesses a generating set of size 2.\n", From 3534ad74e4ac70f847cda27af28be0aa69af507b Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 13:31:33 +0530 Subject: [PATCH 02/22] Removed the Error log --- lib/grp.gi | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index efd850f3ff..c22346abcc 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -218,13 +218,7 @@ function(G) fi; od; if G = GroupByGenerators(mingenset_k_reps) then return mingenset_k_reps; fi; - Print("Calculated mingen doesn't generate the group."); return mingenset_k_reps; - Error( - "`MinimalGeneratingSet' currently assumes that the group is solvable, or\n", - "already possesses a generating set of size 2.\n", - "In general, try `SmallGeneratingSet' instead, which returns a generating\n", - "set that is small but not of guaranteed smallest cardinality"); fi; end); From 5d00602f771ac9e2d62cb4fd960c3a1514645a48 Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 13:59:57 +0530 Subject: [PATCH 03/22] Minor Changes --- lib/grp.gi | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index c22346abcc..a638d8c5c4 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -139,7 +139,7 @@ function(G) Gkm1byGk_gen_reps, mingenset_km1_reps, mingenset_k_reps, - temp,i,j,l,L,x,xl,y,last,gmod,N,g,g0,g1,s,r,stop, + temp,i,j,l,L,x,xl,y,prev,gmod,N,g,g0,g1,s,r,stop, cs,phi_GbyG1,GbyG1,Gk,Gkm1,phi_GbyGk,phi_Gkm1byGk,k; if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); @@ -164,12 +164,12 @@ function(G) stop := false; if IsAbelian(Gkm1byGk) then if check(g) then mingenset_k_reps := g; fi; - for i in [1..Length(g)] do + for i in [1..Length(g)] do if stop then break; fi; for j in [1..Length(Gkm1byGk_gen_reps)] do temp := g[i]; g[i] := temp * Gkm1byGk_gen_reps[j]; - if check(g) then + if check(g) then mingenset_k_reps := g; stop := true; break; @@ -184,26 +184,26 @@ function(G) g := ShallowCopy(mingenset_km1_reps); Add(g,Gkm1byGk_elem_reps[1]); g1 := ShallowCopy(g); - for g in [g0,g1] do + for g in [g0,g1] do if stop then break;fi; l := Length(g); L := Length(Gkm1byGk_elem_reps); s := L^l; - last := []; - for i in [l,l-1..1] do last[i] := 1; od; + prev := []; + for i in [l,l-1..1] do prev[i] := 1; od; gmod := ShallowCopy(g); - for x in [0..s-1] do + for x in [0..s-1] do xl := []; for i in [1..l] do xl[i] := 0; od; i := 1; - while x > 0 do + while x > 0 do r := RemInt(x,L); x := QuoInt(x,L); xl[i]:=r; i:= i+1; od; - for i in [1..l] do - if xl[i] <> last[i] then + for i in [1..l] do + if xl[i] <> prev[i] then gmod[i] := g[i] * Gkm1byGk_elem_reps[xl[i]+1]; fi; od; @@ -212,7 +212,7 @@ function(G) stop := true; break; fi; - last := xl; + prev := xl; od; od; fi; From af0531f0be97c4a6c2a8875346c7f2b882249ab9 Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 15:31:42 +0530 Subject: [PATCH 04/22] Minor Changes --- lib/grp.gi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/grp.gi b/lib/grp.gi index a638d8c5c4..783bc6eef7 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -143,7 +143,7 @@ function(G) cs,phi_GbyG1,GbyG1,Gk,Gkm1,phi_GbyGk,phi_Gkm1byGk,k; if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); - else + elif IsGroup(G) and IsFinite(G) then cs := ChiefSeries(G); phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); GbyG1 := ImagesSource(phi_GbyG1); @@ -219,6 +219,8 @@ function(G) od; if G = GroupByGenerators(mingenset_k_reps) then return mingenset_k_reps; fi; return mingenset_k_reps; + else + Error("MinimalGeneratingSet assumes that input group is finite or solvable or finitely generated nilpotent."); fi; end); From 9ee8e9a1d941e19c657f76c94bd4b8c2a5389a74 Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 15:53:25 +0530 Subject: [PATCH 05/22] Small Changes --- lib/grp.gi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 783bc6eef7..957a842bc5 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -140,20 +140,19 @@ function(G) mingenset_km1_reps, mingenset_k_reps, temp,i,j,l,L,x,xl,y,prev,gmod,N,g,g0,g1,s,r,stop, - cs,phi_GbyG1,GbyG1,Gk,Gkm1,phi_GbyGk,phi_Gkm1byGk,k; + cs,phi_GbyG1,GbyG1,phi_GbyGk,phi_Gkm1byGk,k; if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); elif IsGroup(G) and IsFinite(G) then cs := ChiefSeries(G); phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); GbyG1 := ImagesSource(phi_GbyG1); - mingenset_k_reps := List(SmallGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); + mingenset_k_reps := List(MinimalGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); + # GbyG1 is a simple group, so it can be handelled by GbyG1 for k in [3..Length(cs)] do # Lifting mingenset_km1_reps := mingenset_k_reps; - Gk := cs[k]; - Gkm1 := cs[k-1]; - phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,Gk); - phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(Gkm1,Gk); + phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); + phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); Gkm1byGk := ImagesSource(phi_Gkm1byGk); GbyGk := ImagesSource(phi_GbyGk); check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); @@ -220,7 +219,8 @@ function(G) if G = GroupByGenerators(mingenset_k_reps) then return mingenset_k_reps; fi; return mingenset_k_reps; else - Error("MinimalGeneratingSet assumes that input group is finite or solvable or finitely generated nilpotent."); + Error("MinimalGeneratingSet assumes that input group is", + "finite or solvable or already has a generating set of 2 elements"); fi; end); From 25ed7d89cf362f70aa4d9fa587d80ce45ead07ce Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 21:06:10 +0530 Subject: [PATCH 06/22] Fixed an error --- lib/grp.gi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 957a842bc5..9c502f7bd5 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -176,8 +176,14 @@ function(G) g[i] := temp; od; od; - Add(g,Gkm1byGk_gen_reps[1]); - mingenset_k_reps := g; + if not stop then + Add(g,Gkm1byGk_gen_reps[1]); + if check(g) then + mingenset_k_reps := g; + else + Error("The algorithm is failing"); + fi; + fi; else g0 := ShallowCopy(mingenset_km1_reps); g := ShallowCopy(mingenset_km1_reps); From 99bd539f9a0be01bc4b7f119ff1fb01f76dfd57f Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 17 May 2024 23:51:22 +0530 Subject: [PATCH 07/22] Small Changes --- lib/grp.gi | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 9c502f7bd5..fe9725ac91 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -144,11 +144,14 @@ function(G) if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); elif IsGroup(G) and IsFinite(G) then + #This algorithm is described in the paper + #"The Minimum Generating Set Problem" by Dhara Thakar and Andrea Lucchini. + #link : https://arxiv.org/abs/2306.07633 cs := ChiefSeries(G); phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); GbyG1 := ImagesSource(phi_GbyG1); mingenset_k_reps := List(MinimalGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); - # GbyG1 is a simple group, so it can be handelled by GbyG1 + # GbyG1 is a simple group, so it has a 2 size generating set which can be found easily. for k in [3..Length(cs)] do # Lifting mingenset_km1_reps := mingenset_k_reps; phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); @@ -156,7 +159,6 @@ function(G) Gkm1byGk := ImagesSource(phi_Gkm1byGk); GbyGk := ImagesSource(phi_GbyGk); check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); - Gkm1byGk_elem_reps := List(AsList(Gkm1byGk),x -> PreImagesRepresentative(phi_Gkm1byGk,x)); Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); g := ShallowCopy(mingenset_km1_reps); @@ -185,11 +187,11 @@ function(G) fi; fi; else + Gkm1byGk_elem_reps := List(Gkm1byGk,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); g0 := ShallowCopy(mingenset_km1_reps); - g := ShallowCopy(mingenset_km1_reps); - Add(g,Gkm1byGk_elem_reps[1]); - g1 := ShallowCopy(g); - for g in [g0,g1] do + g1 := ShallowCopy(mingenset_km1_reps); + Add(g1,Gkm1byGk_elem_reps[1]); + for g in [g0,g1] do if stop then break;fi; l := Length(g); L := Length(Gkm1byGk_elem_reps); @@ -222,7 +224,9 @@ function(G) od; fi; od; - if G = GroupByGenerators(mingenset_k_reps) then return mingenset_k_reps; fi; + if not G = GroupByGenerators(mingenset_k_reps) then + Error("The algorithm is failing. (Computed generating set doesn't generate G)"); + fi; return mingenset_k_reps; else Error("MinimalGeneratingSet assumes that input group is", From e4234d141a13ae75c7bca413278419f6c2c85b9f Mon Sep 17 00:00:00 2001 From: Pranav Date: Sat, 18 May 2024 00:46:44 +0530 Subject: [PATCH 08/22] Changed location of function --- lib/grp.gi | 190 +++++++++++++++++++++++++++++------------------------ 1 file changed, 105 insertions(+), 85 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index fe9725ac91..d5d88ef9f9 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -11,6 +11,110 @@ ## This file contains generic methods for groups. ## +BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) + #This algorithm is described in the paper + #"The Minimum Generating Set Problem" by Dhara Thakar and Andrea Lucchini. + #link : https://arxiv.org/abs/2306.07633 + local + cs, # The chief series of G + check, # A function to check if GbyGk is generated by cosets with given representative + GbyGk, # The quotient group of G with the k+1 st group in its chief series (1st is G) + Gkm1byGk, # Quotient of the kth and k-1 th groups in chief series of G. + Gkm1byGk_elem_reps, # The coset representatives of Gkm1byGk + Gkm1byGk_gen, # A (small) generating set of Gkm1byGk + Gkm1byGk_gen_reps, # The coset representatives (CR) of elements Gkm1byGk_gen + mingenset_km1_reps, # The CR of minimum generating set (MGS) of GbyGkm1 + mingenset_k_reps, # The CR of MGS of GbyGk + phi_GbyG1, # Homomorphism for quotient group GbyG1 + GbyG1, # Quotient of G and 2nd group in its chief series + phi_GbyGk, # Homomorphism for quotient group GbyG1 + phi_Gkm1byGk, # Homomorphism for quotient group Gkm1byGk + temp,i,j,l,L,x,xl,y,prev,gmod,N,g,g0,g1,s,r,stop,k; + cs := ChiefSeries(G); + phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); + GbyG1 := ImagesSource(phi_GbyG1); + mingenset_k_reps := List(MinimalGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); + # GbyG1 is a simple group, so it has a 2 size generating set which can be found easily. + # I'll rely on MinimalGeneratingSet to do this. + for k in [3..Length(cs)] do # Lifting + mingenset_km1_reps := mingenset_k_reps; + # We wish to compute mingenset_k_reps, the CR of MGS of GbyGk, + #given mingenset_km1_reps, the CR of MGS of GbyGkm1 . + phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); + phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); + Gkm1byGk := ImagesSource(phi_Gkm1byGk); + GbyGk := ImagesSource(phi_GbyGk); + check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); + Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); + Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); + g := ShallowCopy(mingenset_km1_reps); + stop := false; + if IsAbelian(Gkm1byGk) then + if check(g) then mingenset_k_reps := g; fi; + for i in [1..Length(g)] do + if stop then break; fi; + for j in [1..Length(Gkm1byGk_gen_reps)] do + temp := g[i]; + g[i] := temp * Gkm1byGk_gen_reps[j]; + if check(g) then + mingenset_k_reps := g; + stop := true; + break; + fi; + g[i] := temp; + od; + od; + if not stop then + Add(g,Gkm1byGk_gen_reps[1]); + if check(g) then + mingenset_k_reps := g; + else + Error("The algorithm is failing"); + fi; + fi; + else + Gkm1byGk_elem_reps := List(Gkm1byGk,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); + g0 := ShallowCopy(mingenset_km1_reps); + g1 := ShallowCopy(mingenset_km1_reps); + Add(g1,Gkm1byGk_elem_reps[1]); + for g in [g0,g1] do + if stop then break;fi; + l := Length(g); + L := Length(Gkm1byGk_elem_reps); + s := L^l; + prev := []; + for i in [l,l-1..1] do prev[i] := 1; od; + gmod := ShallowCopy(g); + for x in [0..s-1] do + xl := []; + for i in [1..l] do xl[i] := 0; od; + i := 1; + while x > 0 do + r := RemInt(x,L); + x := QuoInt(x,L); + xl[i]:=r; + i:= i+1; + od; + for i in [1..l] do + if xl[i] <> prev[i] then + gmod[i] := g[i] * Gkm1byGk_elem_reps[xl[i]+1]; + fi; + od; + if check(gmod) then + mingenset_k_reps := gmod; + stop := true; + break; + fi; + prev := xl; + od; + od; + fi; + od; + if not G = GroupByGenerators(mingenset_k_reps) then + Error("The algorithm is failing. (Computed generating set doesn't generate G)"); + fi; + return mingenset_k_reps; +end); ############################################################################# ## @@ -133,7 +237,6 @@ function(G) local check,GbyGk, Gkm1byGk, - Gkm1byGk_L, Gkm1byGk_elem_reps, Gkm1byGk_gen, Gkm1byGk_gen_reps, @@ -144,90 +247,7 @@ function(G) if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); elif IsGroup(G) and IsFinite(G) then - #This algorithm is described in the paper - #"The Minimum Generating Set Problem" by Dhara Thakar and Andrea Lucchini. - #link : https://arxiv.org/abs/2306.07633 - cs := ChiefSeries(G); - phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); - GbyG1 := ImagesSource(phi_GbyG1); - mingenset_k_reps := List(MinimalGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); - # GbyG1 is a simple group, so it has a 2 size generating set which can be found easily. - for k in [3..Length(cs)] do # Lifting - mingenset_km1_reps := mingenset_k_reps; - phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); - phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); - Gkm1byGk := ImagesSource(phi_Gkm1byGk); - GbyGk := ImagesSource(phi_GbyGk); - check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); - Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); - Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); - g := ShallowCopy(mingenset_km1_reps); - stop := false; - if IsAbelian(Gkm1byGk) then - if check(g) then mingenset_k_reps := g; fi; - for i in [1..Length(g)] do - if stop then break; fi; - for j in [1..Length(Gkm1byGk_gen_reps)] do - temp := g[i]; - g[i] := temp * Gkm1byGk_gen_reps[j]; - if check(g) then - mingenset_k_reps := g; - stop := true; - break; - fi; - g[i] := temp; - od; - od; - if not stop then - Add(g,Gkm1byGk_gen_reps[1]); - if check(g) then - mingenset_k_reps := g; - else - Error("The algorithm is failing"); - fi; - fi; - else - Gkm1byGk_elem_reps := List(Gkm1byGk,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); - g0 := ShallowCopy(mingenset_km1_reps); - g1 := ShallowCopy(mingenset_km1_reps); - Add(g1,Gkm1byGk_elem_reps[1]); - for g in [g0,g1] do - if stop then break;fi; - l := Length(g); - L := Length(Gkm1byGk_elem_reps); - s := L^l; - prev := []; - for i in [l,l-1..1] do prev[i] := 1; od; - gmod := ShallowCopy(g); - for x in [0..s-1] do - xl := []; - for i in [1..l] do xl[i] := 0; od; - i := 1; - while x > 0 do - r := RemInt(x,L); - x := QuoInt(x,L); - xl[i]:=r; - i:= i+1; - od; - for i in [1..l] do - if xl[i] <> prev[i] then - gmod[i] := g[i] * Gkm1byGk_elem_reps[xl[i]+1]; - fi; - od; - if check(gmod) then - mingenset_k_reps := gmod; - stop := true; - break; - fi; - prev := xl; - od; - od; - fi; - od; - if not G = GroupByGenerators(mingenset_k_reps) then - Error("The algorithm is failing. (Computed generating set doesn't generate G)"); - fi; - return mingenset_k_reps; + return MinimalGeneratingSetUsingChiefSeries(G); else Error("MinimalGeneratingSet assumes that input group is", "finite or solvable or already has a generating set of 2 elements"); From d0259db9d4a7a7d2fde4c091a5d8198457e19c58 Mon Sep 17 00:00:00 2001 From: Pranav Date: Sat, 18 May 2024 00:47:19 +0530 Subject: [PATCH 09/22] Changed location of code --- lib/grp.gi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index d5d88ef9f9..e724dc0d94 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -11,10 +11,14 @@ ## This file contains generic methods for groups. ## +############################################################################# +## +#M MinimalGeneratingSetUsingChiefSeries( ) +## +# This algorithm is described in the paper +# "The Minimum Generating Set Problem" by Dhara Thakar and Andrea Lucchini. +# link : https://arxiv.org/abs/2306.07633 BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) - #This algorithm is described in the paper - #"The Minimum Generating Set Problem" by Dhara Thakar and Andrea Lucchini. - #link : https://arxiv.org/abs/2306.07633 local cs, # The chief series of G check, # A function to check if GbyGk is generated by cosets with given representative From 257e07756abf1293c48b58fe9e1173c7531f89fa Mon Sep 17 00:00:00 2001 From: Pranav Date: Sat, 18 May 2024 00:50:50 +0530 Subject: [PATCH 10/22] Small Change --- lib/grp.gi | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index e724dc0d94..1a578dae24 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -238,16 +238,6 @@ end); InstallOtherMethod(MinimalGeneratingSet,"fallback method to inform user",true, [IsObject],0, function(G) - local - check,GbyGk, - Gkm1byGk, - Gkm1byGk_elem_reps, - Gkm1byGk_gen, - Gkm1byGk_gen_reps, - mingenset_km1_reps, - mingenset_k_reps, - temp,i,j,l,L,x,xl,y,prev,gmod,N,g,g0,g1,s,r,stop, - cs,phi_GbyG1,GbyG1,phi_GbyGk,phi_Gkm1byGk,k; if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); elif IsGroup(G) and IsFinite(G) then From db92d529e9f769c689360b745fe12d59127c63b6 Mon Sep 17 00:00:00 2001 From: Pranav Date: Sat, 18 May 2024 13:14:34 +0530 Subject: [PATCH 11/22] Removed `mingenset_km1_reps` --- lib/grp.gi | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 1a578dae24..556d170354 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -27,8 +27,8 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) Gkm1byGk_elem_reps, # The coset representatives of Gkm1byGk Gkm1byGk_gen, # A (small) generating set of Gkm1byGk Gkm1byGk_gen_reps, # The coset representatives (CR) of elements Gkm1byGk_gen - mingenset_km1_reps, # The CR of minimum generating set (MGS) of GbyGkm1 - mingenset_k_reps, # The CR of MGS of GbyGk + mingenset_k_reps, # The CR of minimum generating set (MGS) of GbyGkm1 + #mingenset_k_reps, # The CR of MGS of GbyGk phi_GbyG1, # Homomorphism for quotient group GbyG1 GbyG1, # Quotient of G and 2nd group in its chief series phi_GbyGk, # Homomorphism for quotient group GbyG1 @@ -41,9 +41,9 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) # GbyG1 is a simple group, so it has a 2 size generating set which can be found easily. # I'll rely on MinimalGeneratingSet to do this. for k in [3..Length(cs)] do # Lifting - mingenset_km1_reps := mingenset_k_reps; + #mingenset_k_reps := mingenset_k_reps; # We wish to compute mingenset_k_reps, the CR of MGS of GbyGk, - #given mingenset_km1_reps, the CR of MGS of GbyGkm1 . + #given mingenset_k_reps, the CR of MGS of GbyGkm1 . phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); Gkm1byGk := ImagesSource(phi_Gkm1byGk); @@ -51,7 +51,7 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); - g := ShallowCopy(mingenset_km1_reps); + g := ShallowCopy(mingenset_k_reps); stop := false; if IsAbelian(Gkm1byGk) then if check(g) then mingenset_k_reps := g; fi; @@ -70,16 +70,13 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) od; if not stop then Add(g,Gkm1byGk_gen_reps[1]); - if check(g) then - mingenset_k_reps := g; - else - Error("The algorithm is failing"); - fi; + Assert(1,check(g),"The algorithm is failing"); + mingenset_k_reps := g; fi; else Gkm1byGk_elem_reps := List(Gkm1byGk,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); - g0 := ShallowCopy(mingenset_km1_reps); - g1 := ShallowCopy(mingenset_km1_reps); + g0 := ShallowCopy(mingenset_k_reps); + g1 := ShallowCopy(mingenset_k_reps); Add(g1,Gkm1byGk_elem_reps[1]); for g in [g0,g1] do if stop then break;fi; @@ -114,9 +111,8 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) od; fi; od; - if not G = GroupByGenerators(mingenset_k_reps) then - Error("The algorithm is failing. (Computed generating set doesn't generate G)"); - fi; + Assert(1,G = GroupByGenerators(mingenset_k_reps), + "The algorithm is failing. (Computed generating set doesn't generate G)"); return mingenset_k_reps; end); From 47ab81801ffa14aa18a7292bce77b564af7a69cd Mon Sep 17 00:00:00 2001 From: Pranav Date: Sun, 19 May 2024 13:33:49 +0530 Subject: [PATCH 12/22] small changes --- lib/grp.gi | 74 ++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 556d170354..911cd8c4da 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -28,7 +28,6 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) Gkm1byGk_gen, # A (small) generating set of Gkm1byGk Gkm1byGk_gen_reps, # The coset representatives (CR) of elements Gkm1byGk_gen mingenset_k_reps, # The CR of minimum generating set (MGS) of GbyGkm1 - #mingenset_k_reps, # The CR of MGS of GbyGk phi_GbyG1, # Homomorphism for quotient group GbyG1 GbyG1, # Quotient of G and 2nd group in its chief series phi_GbyGk, # Homomorphism for quotient group GbyG1 @@ -40,21 +39,21 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) mingenset_k_reps := List(MinimalGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); # GbyG1 is a simple group, so it has a 2 size generating set which can be found easily. # I'll rely on MinimalGeneratingSet to do this. + check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); for k in [3..Length(cs)] do # Lifting #mingenset_k_reps := mingenset_k_reps; # We wish to compute mingenset_k_reps, the CR of MGS of GbyGk, #given mingenset_k_reps, the CR of MGS of GbyGkm1 . phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); + GbyGk := ImagesSource(phi_GbyGk); + if check(mingenset_k_reps) then break; fi; phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); Gkm1byGk := ImagesSource(phi_Gkm1byGk); - GbyGk := ImagesSource(phi_GbyGk); - check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); g := ShallowCopy(mingenset_k_reps); stop := false; if IsAbelian(Gkm1byGk) then - if check(g) then mingenset_k_reps := g; fi; for i in [1..Length(g)] do if stop then break; fi; for j in [1..Length(Gkm1byGk_gen_reps)] do @@ -74,45 +73,44 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) mingenset_k_reps := g; fi; else - Gkm1byGk_elem_reps := List(Gkm1byGk,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); - g0 := ShallowCopy(mingenset_k_reps); - g1 := ShallowCopy(mingenset_k_reps); - Add(g1,Gkm1byGk_elem_reps[1]); - for g in [g0,g1] do - if stop then break;fi; - l := Length(g); - L := Length(Gkm1byGk_elem_reps); - s := L^l; - prev := []; - for i in [l,l-1..1] do prev[i] := 1; od; - gmod := ShallowCopy(g); - for x in [0..s-1] do - xl := []; - for i in [1..l] do xl[i] := 0; od; - i := 1; - while x > 0 do - r := RemInt(x,L); - x := QuoInt(x,L); - xl[i]:=r; - i:= i+1; - od; - for i in [1..l] do - if xl[i] <> prev[i] then - gmod[i] := g[i] * Gkm1byGk_elem_reps[xl[i]+1]; - fi; - od; - if check(gmod) then - mingenset_k_reps := gmod; - stop := true; - break; + Gkm1byGk_elem_reps := List(Enumerator(Gkm1byGk),x -> PreImagesRepresentative(phi_Gkm1byGk,x)); + g0 := ShallowCopy(mingenset_k_reps); + g1 := ShallowCopy(mingenset_k_reps); + Add(g1,Gkm1byGk_elem_reps[1]); + for g in [g0,g1] do + if stop then break;fi; + l := Length(g); + L := Length(Gkm1byGk_elem_reps); + s := L^l; + prev := []; + for i in [l,l-1..1] do prev[i] := 1; od; + gmod := ShallowCopy(g); + for x in [0..s-1] do + xl := []; + for i in [1..l] do xl[i] := 0; od; + i := 1; + while x > 0 do + r := RemInt(x,L); + x := QuoInt(x,L); + xl[i]:=r; + i:= i+1; + od; + for i in [1..l] do + if xl[i] <> prev[i] then + gmod[i] := g[i] * Gkm1byGk_elem_reps[xl[i]+1]; fi; - prev := xl; od; + if check(gmod) then + mingenset_k_reps := gmod; + stop := true; + break; + fi; + prev := xl; od; + od; fi; od; - Assert(1,G = GroupByGenerators(mingenset_k_reps), - "The algorithm is failing. (Computed generating set doesn't generate G)"); + Assert(1,G = GroupByGenerators(mingenset_k_reps),"The algorithm is failing"); return mingenset_k_reps; end); From 5fb927b59b83a416dc640188fc0f4cbf4d71828c Mon Sep 17 00:00:00 2001 From: Pranav Date: Sun, 19 May 2024 13:39:45 +0530 Subject: [PATCH 13/22] Very small change --- lib/grp.gi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 911cd8c4da..2e5815ea75 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -41,9 +41,7 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) # I'll rely on MinimalGeneratingSet to do this. check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); for k in [3..Length(cs)] do # Lifting - #mingenset_k_reps := mingenset_k_reps; - # We wish to compute mingenset_k_reps, the CR of MGS of GbyGk, - #given mingenset_k_reps, the CR of MGS of GbyGkm1 . + # We wish to compute the CR of MGS of GbyGk, given the CR of MGS of GbyGkm1 . phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); GbyGk := ImagesSource(phi_GbyGk); if check(mingenset_k_reps) then break; fi; From a826f2721427d6ce9f5b5ca3db8cf0af30845672 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 22 May 2024 13:06:21 +0530 Subject: [PATCH 14/22] Reintroduced the error log --- lib/grp.gi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 2e5815ea75..a4d3d7338f 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -214,13 +214,13 @@ function(G) CanEasilyComputePcgs(G) then # discovered solvable -- redo return MinimalGeneratingSet(G); - elif not IsSolvableGroup(G) then - if IsGroup(G) and (not IsCyclic(G)) and HasGeneratorsOfGroup(G) - and Length(GeneratorsOfGroup(G)) = 2 then - return GeneratorsOfGroup(G); - fi; + else + Error( + "`MinimalGeneratingSet' currently assumes that the group is solvable, or\n", + "already possesses a generating set of size 2.\n", + "In general, try `SmallGeneratingSet' instead, which returns a generating\n", + "set that is small but not of guaranteed smallest cardinality"); fi; - TryNextMethod(); end); ############################################################################# From 6193173008e523b524d6a28cbc870909c3fc6f52 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 22 May 2024 13:10:51 +0530 Subject: [PATCH 15/22] Reintroduced the error log --- lib/grp.gi | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index a4d3d7338f..de08576ac6 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -214,13 +214,13 @@ function(G) CanEasilyComputePcgs(G) then # discovered solvable -- redo return MinimalGeneratingSet(G); - else - Error( - "`MinimalGeneratingSet' currently assumes that the group is solvable, or\n", - "already possesses a generating set of size 2.\n", - "In general, try `SmallGeneratingSet' instead, which returns a generating\n", - "set that is small but not of guaranteed smallest cardinality"); + elif not IsSolvableGroup(G) then + if IsGroup(G) and (not IsCyclic(G)) and HasGeneratorsOfGroup(G) + and Length(GeneratorsOfGroup(G)) = 2 then + return GeneratorsOfGroup(G); + fi; fi; + TryNextMethod(); end); ############################################################################# @@ -232,11 +232,12 @@ InstallOtherMethod(MinimalGeneratingSet,"fallback method to inform user",true, function(G) if IsGroup(G) and IsSolvableGroup(G) then TryNextMethod(); - elif IsGroup(G) and IsFinite(G) then - return MinimalGeneratingSetUsingChiefSeries(G); else - Error("MinimalGeneratingSet assumes that input group is", - "finite or solvable or already has a generating set of 2 elements"); + Error( + "`MinimalGeneratingSet' currently assumes that the group is solvable, or\n", + "already possesses a generating set of size 2.\n", + "In general, try `SmallGeneratingSet' instead, which returns a generating\n", + "set that is small but not of guaranteed smallest cardinality"); fi; end); From ee8c0733762fcce6144b34b8f553f9fa0ed7d1bf Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 28 May 2024 16:25:14 +0530 Subject: [PATCH 16/22] Fixed a mistake and added some tests --- lib/grp.gi | 3 +- .../MinimalGeneratingSetUsingChiefSeries.tst | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst diff --git a/lib/grp.gi b/lib/grp.gi index de08576ac6..1768ab5c22 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -33,6 +33,7 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) phi_GbyGk, # Homomorphism for quotient group GbyG1 phi_Gkm1byGk, # Homomorphism for quotient group Gkm1byGk temp,i,j,l,L,x,xl,y,prev,gmod,N,g,g0,g1,s,r,stop,k; + if IsTrivial(G) then return []; fi; cs := ChiefSeries(G); phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); GbyG1 := ImagesSource(phi_GbyG1); @@ -44,7 +45,7 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) # We wish to compute the CR of MGS of GbyGk, given the CR of MGS of GbyGkm1 . phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); GbyGk := ImagesSource(phi_GbyGk); - if check(mingenset_k_reps) then break; fi; + if check(mingenset_k_reps) then continue; fi; phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); Gkm1byGk := ImagesSource(phi_Gkm1byGk); Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); diff --git a/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst b/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst new file mode 100644 index 0000000000..5ec9c74a99 --- /dev/null +++ b/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst @@ -0,0 +1,35 @@ +gap> START_TEST("MinimalGeneratingSetUsingChiefSeries.tst"); +gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries := function(startsize,endsize) +> local G,size,gens1,gens2,G1,G2,i; +> for size in [startsize..endsize] do +> i := 0; +> for G in AllSmallGroups(size) do +> i := i + 1; +> gens1:= MinimalGeneratingSet(G); +> gens2:= MinimalGeneratingSetUsingChiefSeries(G); +> if Length(gens1) = 0 then +> if IsTrivial(G) then +> if Length(gens2) > 0 then +> return Concatenation("FAILED on AllSmallGroups(",String(size),")[",String(i),"]"); +> else +> continue; +> fi; +> else +> return Concatenation("MinimalGeneratingSet is failing on AllSmallGroups(",String(size),")[",String(i),"]"); +> fi; +> fi; +> G1 := GroupByGenerators(gens1); +> if not G = G1 then +> return Concatenation("MinimalGeneratingSet is failing on AllSmallGroups(",String(size),")[",String(i),"]"); +> fi; +> G2 := GroupByGenerators(gens2); +> if (not G = G2) or Length(gens1) < Length(gens2) then +> return Concatenation("FAILED on AllSmallGroups(",String(size),")[",String(i),"]"); +> fi; +> od; +> od; +> return "PASSED"; +> end; +function( startsize, endsize ) ... end +gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries(1,10); +"PASSED" From 0175fb0236f7257c08eec53df366e512dec42f8a Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 28 May 2024 16:41:46 +0530 Subject: [PATCH 17/22] small change --- tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst b/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst index 5ec9c74a99..ae78da6d33 100644 --- a/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst +++ b/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst @@ -31,5 +31,5 @@ gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries := function(startsize,endsi > return "PASSED"; > end; function( startsize, endsize ) ... end -gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries(1,10); +gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries(1,100); "PASSED" From 19b88a31474b2310b9984b0341a02eb3dc3e8960 Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 28 May 2024 16:48:07 +0530 Subject: [PATCH 18/22] Removed the check --- lib/grp.gi | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/grp.gi b/lib/grp.gi index 1768ab5c22..ca2945277c 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -109,7 +109,6 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) od; fi; od; - Assert(1,G = GroupByGenerators(mingenset_k_reps),"The algorithm is failing"); return mingenset_k_reps; end); From b4369725fea73a082cdd28bdd80e46b28509a904 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 29 May 2024 00:23:45 +0530 Subject: [PATCH 19/22] Updated tests --- .../opers/MinimalGeneratingSetUsingChiefSeries.tst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst b/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst index ae78da6d33..4c6063e48b 100644 --- a/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst +++ b/tst/testinstall/opers/MinimalGeneratingSetUsingChiefSeries.tst @@ -31,5 +31,15 @@ gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries := function(startsize,endsi > return "PASSED"; > end; function( startsize, endsize ) ... end -gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries(1,100); +gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries(1,60); "PASSED" +gap> CrossVerifyMinimalGeneratingSetUsingChiefSeries(115,125); +"PASSED" +gap> G := AlternatingGroup(5); +Alt( [ 1 .. 5 ] ) +gap> G := DirectProduct(G,G);; +gap> mu := MinimalGeneratingSetUsingChiefSeries(G);; +gap> G = GroupByGenerators(mu); +true +gap> Length(mu); +2 From afc2a9d526bf21a85da3750cdcc19ae0e1b9ac13 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 29 May 2024 01:44:50 +0530 Subject: [PATCH 20/22] fixed linting error --- lib/grp.gi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index ca2945277c..0710f3564b 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -32,7 +32,7 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) GbyG1, # Quotient of G and 2nd group in its chief series phi_GbyGk, # Homomorphism for quotient group GbyG1 phi_Gkm1byGk, # Homomorphism for quotient group Gkm1byGk - temp,i,j,l,L,x,xl,y,prev,gmod,N,g,g0,g1,s,r,stop,k; + temp,i,j,l,L,x,xl,prev,gmod,g,g0,g1,s,r,stop,k; if IsTrivial(G) then return []; fi; cs := ChiefSeries(G); phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); @@ -74,7 +74,7 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) else Gkm1byGk_elem_reps := List(Enumerator(Gkm1byGk),x -> PreImagesRepresentative(phi_Gkm1byGk,x)); g0 := ShallowCopy(mingenset_k_reps); - g1 := ShallowCopy(mingenset_k_reps); + g1 := ShallowCopy(mingenset_k_reps); Add(g1,Gkm1byGk_elem_reps[1]); for g in [g0,g1] do if stop then break;fi; From 1d2677d6fec8102ab0d6c6f72e1d5633e073fc8b Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 5 Jun 2024 00:04:21 +0530 Subject: [PATCH 21/22] Mentioned the function in the documentation --- lib/grp.gd | 5 +++++ lib/grp.gi | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/grp.gd b/lib/grp.gd index 401edcd7d6..4551f54fb7 100644 --- a/lib/grp.gd +++ b/lib/grp.gd @@ -2216,6 +2216,11 @@ DeclareAttribute( "LargestElementGroup", IsGroup ); ## with getting a reasonably small set of generators, you better use ## . ##

+## Another way to find the minimal generating set is +## MinimalGeneratingSetUsingChiefSeries +## which executes in time polynominally bounded by the size of group, +## but is slower than MinimalGeneratingSet for practical purposes. +##

## Information about the minimal generating sets of the finite simple ## groups of order less than 10^6 can be found in . ## See also the package AtlasRep. diff --git a/lib/grp.gi b/lib/grp.gi index 0710f3564b..56b1560228 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -35,19 +35,19 @@ BindGlobal("MinimalGeneratingSetUsingChiefSeries",function(G) temp,i,j,l,L,x,xl,prev,gmod,g,g0,g1,s,r,stop,k; if IsTrivial(G) then return []; fi; cs := ChiefSeries(G); - phi_GbyG1 := NaturalHomomorphismByNormalSubgroup(G,cs[2]); - GbyG1 := ImagesSource(phi_GbyG1); + phi_GbyG1 := NaturalHomomorphismByNormalSubgroupNC(G,cs[2]); + GbyG1 := Image(phi_GbyG1); mingenset_k_reps := List(MinimalGeneratingSet(GbyG1), x -> PreImagesRepresentative(phi_GbyG1, x)); # GbyG1 is a simple group, so it has a 2 size generating set which can be found easily. # I'll rely on MinimalGeneratingSet to do this. - check := gx -> GbyGk = GroupByGenerators(ImagesSet(phi_GbyGk,gx)); + check := gx -> GbyGk = GroupWithGenerators(ImagesSet(phi_GbyGk,gx)); for k in [3..Length(cs)] do # Lifting # We wish to compute the CR of MGS of GbyGk, given the CR of MGS of GbyGkm1 . - phi_GbyGk := NaturalHomomorphismByNormalSubgroup(G,cs[k]); - GbyGk := ImagesSource(phi_GbyGk); + phi_GbyGk := NaturalHomomorphismByNormalSubgroupNC(G,cs[k]); + GbyGk := Image(phi_GbyGk); if check(mingenset_k_reps) then continue; fi; - phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroup(cs[k-1],cs[k]); - Gkm1byGk := ImagesSource(phi_Gkm1byGk); + phi_Gkm1byGk := NaturalHomomorphismByNormalSubgroupNC(cs[k-1],cs[k]); + Gkm1byGk := Image(phi_Gkm1byGk); Gkm1byGk_gen := SmallGeneratingSet(Gkm1byGk); Gkm1byGk_gen_reps := List(Gkm1byGk_gen,x -> PreImagesRepresentative(phi_Gkm1byGk,x)); g := ShallowCopy(mingenset_k_reps); From d520f2b3ee18c9c50d0b0ebc1747c65c4a8edadd Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 5 Jun 2024 00:07:46 +0530 Subject: [PATCH 22/22] Very small change --- lib/grp.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grp.gd b/lib/grp.gd index 4551f54fb7..67c9e8ed31 100644 --- a/lib/grp.gd +++ b/lib/grp.gd @@ -2216,7 +2216,7 @@ DeclareAttribute( "LargestElementGroup", IsGroup ); ## with getting a reasonably small set of generators, you better use ## . ##

-## Another way to find the minimal generating set is +## Another way to find the minimal generating set is ## MinimalGeneratingSetUsingChiefSeries ## which executes in time polynominally bounded by the size of group, ## but is slower than MinimalGeneratingSet for practical purposes.