Q: how to describe these results by a descendants tree in gap

151 Views Asked by At

I wrote an implement to find the "fullyInvariantGroups" in GAP and the results appeared as below:

FullyInvariantGroups := function( p, r, l )  
    local G, grps, i, j, P, M, N, A, B, C, D, c, b, m, n, aa, bb, a, w, v;

    # set up
    G := ElementaryAbelianGroup(p^r);
    grps := [[[false, G]]];

    # loop
    for i in [1..l-1] do
        Print("starting level ",i," with ", Length(grps[i])," groups \n");
        grps[i+1] := [];
        for j in [1..Length(grps[i])] do
            G := grps[i][j][2];
            P := PCoverPGroup(G);
            M := P!.mult; m := Length(Pcgs(M));
            N := P!.nucl; n := Length(Pcgs(N));
            if n > 0 then 
                Print(" Level ",i," group ",j,"\n");
                A := GetAutAction(P);
                B := GModuleByMats( A, GF(p));
                w := SMTX.CollectedFactors(B);
                v := List(w, x -> x[2]);
                if ForAny(v, x -> x <> 1) then Error("hier"); fi;
                w := List(w, x -> x[1].dimension);
                C := SMTX.BasesSubmodules(B);
                D := Filtered(C, x -> IsAllowable(M,N,x));
                for c in D do
                    if i < l-1 then 
                        b := SubgroupByBasis(M, c);
                        Add(grps[i+1], [j, P/b]); 
                    else
                        Add(grps[i+1], [j, 1]);
                    fi;
                od;
            fi;
            grps[i][j][2] := 1;
        od;
    od;
    return grps;
    return TwigCanoForm(grps);
end;

gap> FullyInvariantGroups(7,2,5);
starting level 1 with 1 groups
Level 1 group 1
starting level 2 with 3 groups
Level 2 group 1
Level 2 group 2
Level 2 group 3
starting level 3 with 9 groups
Level 3 group 1
Level 3 group 2
Level 3 group 3
Level 3 group 4
Level 3 group 5
Level 3 group 6
Level 3 group 8
Level 3 group 9
starting level 4 with 28 groups
Level 4 group 1
Level 4 group 2
Level 4 group 3
Level 4 group 4
Level 4 group 5
Level 4 group 6 Level 4 group 7
Level 4 group 8
Level 4 group 9
Level 4 group 10
Level 4 group 11
Level 4 group 12
Level 4 group 13
Level 4 group 16
Level 4 group 17
Level 4 group 18
Level 4 group 19
Level 4 group 20
Level 4 group 22
Level 4 group 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 19, 1 ], [ 20, 1 ], [ 20, 1 ], [ 20, 1 ], [ 22, 1 ], [ 22, 1 ], [ 22, 1 ], [ 23, 1 ], [ 25, 1 ], [ 25, 1 ], [ 25, 1 ], [ 26, 1 ], [ 27, 1 ], [ 28, 1 ], [ 28, 1 ], [ 28, 1 ] ] ]

Is there any way in GAP to made up tree from this outcome to be easy for reading and analyzing?? im sorry but i'm a newbie in GAP.

2

There are 2 best solutions below

2
On

If you're using GAP on a Mac, it wouldn't be so difficult to write code to display a tree in a graphic window with Gap.app. (Or you can use xgap on Linux, but the interface is clunky enough to be distracting.) Sample code which displays the partition lattice is on my website, and might give you a reasonable start. Indeed, with a little more work you could set up so that you can right-click on a node to get a more detail description!

UPDATE: Easily viewing trees would be useful for me, also, so I went ahead and wrote a routine that will display a rooted tree. It's posted on my webpage as "rooted-tree.g".

UPDATE2: added screenshot Screenshot

0
On

You may use dot language to create a tree, and then graphviz to produce an image (or any JavaScript library that reads dot language, as d3js, viz.js ...). You may find some examples under the dot chapter of numericalsgps. Also you can create a binary relation (parent,child) and then use DotBinaryRelation in that package.