From d3d93ebaf723d1c14faaac1062240c8ec7c1bc25 Mon Sep 17 00:00:00 2001 From: Ulli Kehrle Date: Thu, 8 Nov 2018 11:58:26 +0100 Subject: make this a gap package. --- gap/subgroupladders.gd | 26 ++++++++++ gap/subgroupladders.gi | 132 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 gap/subgroupladders.gd create mode 100644 gap/subgroupladders.gi (limited to 'gap') diff --git a/gap/subgroupladders.gd b/gap/subgroupladders.gd new file mode 100644 index 0000000..0ba67e9 --- /dev/null +++ b/gap/subgroupladders.gd @@ -0,0 +1,26 @@ +# +# subgroupladders: This package provides an algorithm that computes a subgroup ladder from a permutation group up to the parent symmetric group. +# +# Declarations +# + +#! @Description +#! Given a list of lists part of positive integers, this will compute +#! the Young #! subgroup corresponding to this partition. +#! @Returns a group +#! @Arguments part +DeclareGlobalFunction( "YoungGroupFromPartition" ); +#! @Description +#! Given a permutation group G, this will compute a subgroup ladder +#! from G up to the parent symmetric group. +#! A subgroup ladder is series of subgroups G = H_0,…,H_k = S_n of the +#! symmetric group such that for every 1 \leq i \leq k, H_i is a +#! subgroup of H_{{i-1}} or H_{{i-1}} is a subgroup of H_i. +#! If G is a Young subgroup of S_n, we can guarantee that all +#! the indices are at most the degree n of the permutation group. +#! Otherwise, we will at first embed G into the Young subgroup +#! corresponding to the orbits of G. +#! At this step, the index may be larger than the degree. +#! @Returns a list of groups +#! @Arguments G +DeclareGlobalFunction( "SubgroupLadder"); diff --git a/gap/subgroupladders.gi b/gap/subgroupladders.gi new file mode 100644 index 0000000..aba383a --- /dev/null +++ b/gap/subgroupladders.gi @@ -0,0 +1,132 @@ +# +# subgroupladders: This package provides an algorithm that computes a subgroup ladder from a permutation group up to the parent symmetric group. +# +# Implementations +# + + +InstallGlobalFunction( YoungGroupFromPartition, +function(part) + local + i, + P, + G, + grps, + olds, + news, + perms, + info, + generators; + + grps := []; + olds := []; + news := []; + perms := []; + generators := []; + + for i in part do + G := SymmetricGroup(i); + Append(generators, GeneratorsOfGroup(G)); + Add(grps, G); + Add(olds, i); + Add(news, i); + Add(perms, ()); + od; + + P := Group(generators); + info := rec( groups := grps, + olds := olds, + news := news, + perms := perms, + embeddings := [], + projections := [] ); + SetDirectProductInfo(P, info); + + return P; +end); + + +InstallGlobalFunction( SubgroupLadder, +function(G) + local + orb, + i, + k, + n, + pair, + ladder, + directfactors, + generators, + mapping, + output, + partition, + FindPos; + + FindPos := function(list, x) + local n, i; + n := Length(list); + for i in [1..n] do + if x in list[i] then + return i; + fi; + od; + end; + + if (not IsPermGroup(G)) then + ErrorNoReturn("the argument must be a permutation group!\n"); + fi; + + n := LargestMovedPoint(G); + + orb := List(Orbits(G, [1..n])); + SortBy(orb, x->-Length(x)); + + output := []; + + if (YoungGroupFromPartition(orb) <> G) then + output := [G]; + fi; + + partition := List(orb, Length); + mapping := List([1..n], x -> FindPos(orb, x)); + ladder := [[List(partition), List(mapping)]]; + + while (Length(partition) <> 1 or partition[1] < n) do + if (Length(partition) = 1 and partition[1] < n) then + mapping[Position(mapping, 0)] := 1; + partition[1] := partition[1] + 1; + Add(ladder, [List(partition), List(mapping)]); + else + if (partition[2] = 1) then + Remove(partition, 2); + for i in [1..n] do + if (mapping[i]) > 1 then + mapping[i] := mapping[i] - 1; + fi; + od; + partition[1] := partition[1] + 1; + Add(ladder, [List(partition), List(mapping)]); + else + mapping[Position(mapping, 2)] := Length(partition)+1; + partition[2] := partition[2] - 1; + Add(partition, 1); + Add(ladder, [List(partition), List(mapping)]); + + mapping[Position(mapping, Length(partition))] := 1; + Remove(partition); + partition[1] := partition[1] + 1; + Add(ladder, [List(partition), List(mapping)]); + fi; + fi; + od; + + for pair in ladder do + k := Length(pair[1]); + mapping := pair[2]; + Add(output, YoungGroupFromPartition(List([1..k], i -> Filtered([1..n], x -> i = mapping[x])))); + od; + + return output; +end); + +# vim: set noet ts=4: -- cgit v1.2.3-24-g4f1b