# 67.17 Examples

Example 1

```    gap> # First set up the natural permutation module for the
gap> # alternating group \$A_5\$ over the field \$GF(2)\$.
gap> P := Group ((1,2,3), (3,4,5));;
gap> M := PermGModule (P, GF(2));
rec(
field := GF(2),
dimension := 5,
generators := [ [ [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ],
[ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ],
[ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ],
[ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ],
[ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ] ],
[ [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ],
[ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ],
[ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ],
[ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ],
[ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ] ] ],
isGModule := true )
gap> # Now test for irreducibility, and calculate a proper submodule.
gap> IsIrreducible (M);
false
gap> SM := SubGModule (M, SubbasisFlag (M));;
gap> DimensionFlag (SM);
4
gap> DSM := DualGModule (SM);;
gap> # Test to see if SM is self-dual. We must prove irreducibility first.
gap> IsIrreducible (SM);
true
gap> IsAbsolutelyIrreducible (SM);
true
gap> IsomorphismGModule (SM, DSM);
[ [ 0*Z(2), Z(2)^0, Z(2)^0, 0*Z(2) ],
[ Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2) ],
[ Z(2)^0, Z(2)^0, 0*Z(2), Z(2)^0 ],
[ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ] ]
gap> # This is an explicit isomorphism.
gap> # Now form a tensor product and decompose it into composition factors.
gap> TM := TensorProductGModule (SM, SM);;
gap> cf := CompositionFactors (TM);;
gap> Length (cf);
3
gap> DimensionFlag(cf[1][1]); cf[1][2];
1
4
gap> DimensionFlag(cf[2][1]); cf[2][2];
4
2
gap> DimensionFlag(cf[3][1]); cf[3][2];
4
1
gap> # This tells us that TM has three composition factors, of dimensions
gap> # 1, 4 and 4, with multiplicities 4, 2 and 1, respectively.
gap> # Is one of the 4-dimensional factors isomorphic to TM?
gap> IsomorphismGModule (SM, cf[2][1]);
false
gap> IsomorphismGModule (SM, cf[3][1]);
[ [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ],
[ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ],
[ Z(2)^0, 0*Z(2), Z(2)^0, 0*Z(2) ],
[ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ] ]
gap> IsAbsolutelyIrreducible (cf[2][1]);
false
gap> DegreeFieldExtFlag(cf[2][1]);
2
gap> # If we extend the field of  cf[2][1] to \$GF(4)\$, it should
gap> # become reducible.
gap> MM := GModule (GeneratorsFlag (cf[2][1]), GF(4));;
gap> CF2 := CompositionFactors (MM);;
gap> Length (CF2);
2
gap> DimensionFlag (CF2[1][1]); CF2[1][2];
2
1
gap> DimensionFlag (CF2[2][1]); CF2[2][2];
2
1
gap> # It reduces into two non-isomorphic 2-dimensional factors. ```

In the next example, we investigate the structure of a matrix group using `SmashGModule` and access some of the stored information about the computed decomposition.

Example 2

```   gap> a := [
> [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
> [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
> [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
> [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
> [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
> [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
> [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
> [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0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, 0],
> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]] * Z(2)^0;;
gap> gens := [a, b, c];;
gap> # Next we define the module.
gap> M := GModule (gens);;
gap> # So far only the basic components have been set.
gap> RecFields (M);
[ "field", "dimension", "generators"", "isGModule" ]
gap>
gap> # First we check for irreducibility and absolute irreducibility.
gap> IsIrreducible (M);
true
gap> IsAbsolutelyIrreducible (M);
true
gap> # A few more components have been set during these two function calls.
gap> RecFields(M);
[ "field", "dimension", "generators"", "isGModule", "algEl", "algElMat",
"algElCharPol", "algElCharPolFac", "algElNullspaceVec",
"algElNullspaceDim",
"reducible", "degreeFieldExt", "absolutelyReducible" ]
gap> # The function Commutators forms the list of commutators of generators.
gap> S := Commutators(gens);;
gap> InfoSmash := Print;;
gap> # Setting InfoSmash to Print means that SmashGModule prints out
gap> # intermediate output to tell us what it is doing. If we
gap> # read this output it tells us what kind of decomposition SmashGModule
gap> # has found. Otherwise the output is only a true or false.
gap> # All the relevant information is contained in the components of M.
gap> SmashGModule (M, S);
Starting call to SmashGModule.
At top of main SmashGModule loop, S has 2 elements.
Translates of W are not modules.
At top of main SmashGModule loop, S has 3 elements.
Translates of W are not modules.
At top of main SmashGModule loop, S has 4 elements.
Translates of W are not modules.
At top of main SmashGModule loop, S has 5 elements.
Group embeds in GammaL(4, GF(2)^3).
SmashGModule returns true.
true
gap> # Additional components are set during the call to SmashGModule.
gap> RecFields(M);
[ "field", "dimension", "generators", "isGModule", "algEl", "algElMat",
"algElCharPol", "algElCharPolFac", "algElNullspaceVec",
"algElNullspaceDim",
"reducible", "degreeFieldExt", "absolutelyReducible",
"semiLinear", "linearPart",
"centMat", "frobeniusAutomorphisms" ]
gap> SemiLinearFlag (M);
true
gap> # This flag tells us G that acts semilinearly.
gap> DegreeFieldExtFlag (M);
3
gap> #This flag tells us the relevant extension field is GF(2\^3)
gap> Length (LinearPartFlag (M));
5
gap> # LinearPartFlag (M) is a set of normal subgroup generators for the
gap> # intersection of G with GL(4, GF(2\^3)). It is also the contents of S
gap> # at the end of the call to SmashGModule and is bigger than the set S
gap> # which was input since conjugates have been added.
gap> FrobeniusAutomorphismsFlag (M);
[ 0, 0, 1 ]
gap> # The first two generators of G act linearly, the last induces the field
gap> # automorphism which maps x to x\^2 (= x\^(2\^1)) on GF(2\^3) ```

In our final example, we demonstrate how to test whether a matrix group is primitive and also how to select pseudo-random elements.

Example 3

```    gap> # Read in 18-dimensional representation of L(2, 17) over GF(41).
gap> # Initialise a seed for random element generation.
gap> InitPseudoRandom (G, 10, 100);;
gap> # Now select a pseudo-random element.
gap> g := PseudoRandom (G);;
gap> OrderMat (g);
3
gap> h := ElementOfOrder (G, 8, 10);;
gap> OrderMat (h);
8
gap> #Is the group primitive?
gap> R := IsPrimitive(G);;
gap> #Examine the boolean returned.
gap> R[1];
false
gap> M := R[2];;
gap> #What is the block system found?
gap> BlockSystemFlag (M);
rec(
nmrBlocks := 18,
block :=
[ [ 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41),
0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41),
0*Z(41), Z(41)^0, 0*Z(41), 0*Z(41) ] ],
maps := [ 1, 2, 3 ],
permGroup := Group( ( 1, 2)( 3, 7)( 5,11)( 6,12)( 8,10)(13,14)(15,17)
(16,18), ( 1, 3, 8,11,15, 9,13, 7,12,16, 6, 2, 5, 4,10,14,17),
( 1, 4, 2, 6, 3, 9, 7,12)( 5, 8,10,11,13,17,15,14) ),
isBlockSystem := true )
gap>  v :=
[ 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41),
0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41),
0*Z(41), Z(41)^0, 0*Z(41), 0*Z(41) ];;
gap> #Illustrate use of MinBlocks
gap> B := MinBlocks (M, [v]);;
gap> B;
rec(
nmrBlocks := 18,
block :=
[ [ 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41),
0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41), 0*Z(41),
0*Z(41), Z(41)^0, 0*Z(41), 0*Z(41) ] ],
maps := [ 1, 2, 3 ],
permGroup := Group( ( 1, 2)( 3, 7)( 5,11)( 6,12)( 8,10)(13,14)(15,17)
(16,18), ( 1, 3, 8,11,15, 9,13, 7,12,16, 6, 2, 5, 4,10,14,17),
( 1, 4, 2, 6, 3, 9, 7,12)( 5, 8,10,11,13,17,15,14) ),
isBlockSystem := true ) ```

GAP 3.4.4
April 1997