From 3ce296fa0056ec88b4d89d37b3983d4a5a7b47d7 Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Fri, 26 Mar 2021 11:09:12 +0000 Subject: [PATCH] Add OnTuplesDigraphs and OnSetsDigraphs --- gap/digraph.gd | 1 + gap/oper.gd | 2 ++ gap/oper.gi | 12 ++++++++++++ tst/standard/oper.tst | 25 +++++++++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/gap/digraph.gd b/gap/digraph.gd index 5b1fbdf25..7e9162a48 100644 --- a/gap/digraph.gd +++ b/gap/digraph.gd @@ -14,6 +14,7 @@ DeclareCategory("IsDigraphWithAdjacencyFunction", IsDigraph); DeclareCategory("IsCayleyDigraph", IsDigraph); DeclareCategory("IsImmutableDigraph", IsDigraph); DeclareSynonym("IsMutableDigraph", IsDigraph and IsMutable); +DeclareCategoryCollections("IsDigraph"); DeclareAttribute("DigraphMutabilityFilter", IsDigraph); diff --git a/gap/oper.gd b/gap/oper.gd index f1544fbb1..c8988d99b 100644 --- a/gap/oper.gd +++ b/gap/oper.gd @@ -48,6 +48,8 @@ DeclareGlobalFunction("DIGRAPHS_CombinationOperProcessArgs"); # 4. Actions . . . DeclareOperation("OnDigraphs", [IsDigraph, IsPerm]); DeclareOperation("OnDigraphs", [IsDigraph, IsTransformation]); +DeclareOperation("OnTuplesDigraphs", [IsDigraphCollection, IsPerm]); +DeclareOperation("OnSetsDigraphs", [IsDigraphCollection, IsPerm]); DeclareOperation("OnMultiDigraphs", [IsDigraph, IsPermCollection]); DeclareOperation("OnMultiDigraphs", [IsDigraph, IsPerm, IsPerm]); diff --git a/gap/oper.gi b/gap/oper.gi index ce9ca1b56..f843d1fdc 100644 --- a/gap/oper.gi +++ b/gap/oper.gi @@ -718,6 +718,18 @@ function(D, t) return MakeImmutable(OnDigraphs(DigraphMutableCopy(D), t)); end); +# TODO DigraphByOutNeighboursColl +InstallMethod(OnTuplesDigraphs, +"for list of digraphs and a perm", +[IsDigraphCollection and IsList, IsPerm], +{L, p} -> List(L, D -> OnDigraphs(D, p))); + +# TODO DigraphByOutNeighboursColl +InstallMethod(OnSetsDigraphs, +"for a set of digraphs and a perm", +[IsDigraphCollection and IsSet, IsPerm], +{S, p} -> Set(S, D -> OnDigraphs(D, p))); + # Not revising the following because multi-digraphs are being withdrawn in the # near future. diff --git a/tst/standard/oper.tst b/tst/standard/oper.tst index d2afb1a2d..03507f120 100644 --- a/tst/standard/oper.tst +++ b/tst/standard/oper.tst @@ -149,6 +149,31 @@ gap> gr := OnDigraphs(gr, t); gap> OutNeighbours(gr); [ [ 2 ], [ 1, 1 ], [ ] ] +# OnTuplesDigraphs: for a digraph and a permutation +gap> D := [ChainDigraph(3), CycleDigraph(4)];; +gap> List(D, OutNeighbours); +[ [ [ 2 ], [ 3 ], [ ] ], [ [ 2 ], [ 3 ], [ 4 ], [ 1 ] ] ] +gap> List(OnTuplesDigraphs(D, (1, 3)), OutNeighbours); +[ [ [ ], [ 1 ], [ 2 ] ], [ [ 4 ], [ 1 ], [ 2 ], [ 3 ] ] ] +gap> D := [ChainDigraph(3), DigraphReverse(ChainDigraph(3))];; +gap> List(D, OutNeighbours); +[ [ [ 2 ], [ 3 ], [ ] ], [ [ ], [ 1 ], [ 2 ] ] ] +gap> List(OnTuplesDigraphs(D, (1, 3)), OutNeighbours); +[ [ [ ], [ 1 ], [ 2 ] ], [ [ 2 ], [ 3 ], [ ] ] ] +gap> OnTuplesDigraphs(D, (1, 3)) = Permuted(D, (1, 2)); +true + +# OnSetsDigraphs: for a digraph and a permutation +gap> D := [ChainDigraph(3), DigraphReverse(ChainDigraph(3))];; +gap> IsSet(D); +true +gap> OnSetsDigraphs(D, (1, 3)) = D; +true +gap> OnSetsDigraphs(D, (1, 3)) = OnTuplesDigraphs(D, (1, 3)); +false +gap> MinimalGeneratingSet(Stabilizer(SymmetricGroup(3), D, OnSetsDigraphs)); +[ (1,3) ] + # OnMultiDigraphs: for a pair of permutations gap> gr1 := CompleteDigraph(3);