# Building matrices from blocks

Keywords: Block matrix

## Respondent:

Alexander Hulpke ( hulpke@math.colostate.edu)

## Question:

I would like to use GAP to work on certain subgroups
of SL_{n}(Z/pZ) e.g. the subgroup of unimodular matrices
of the form
( A 0 )
( C D )
and A, D symplectic, or C symmetric, etc. Is there a way
to construct such subgroups?

There is no generic command, you would have to build matrix generators (from
generators for A,D and the corresponding C) yourself. The following (simple)
example shows a way how. I form a simple direct product (all A/D
combinations possible, C is always zero). In you application you might
want to consider only particular combinations.
```
gap> GrpA:=SP(4,3);
Sp(4,3)
gap> GrpB:=SP(2,3);
SL(2,3)
gap> Null42:=NullMat(4,2,GF(3));
[ [ 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3) ],
[ 0*Z(3), 0*Z(3) ] ]
gap> Null24:=NullMat(2,4,GF(3));
[ [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ] ]
BuildMatrix:=function(A,B,C,D)
return Concatenation(
List([1..Length(A)],i->Concatenation(A[i],B[i])),
List([1..Length(C)],i->Concatenation(C[i],D[i])));
end;
gap> gens:=[];
[  ]
gap> for A in GeneratorsOfGroup(GrpA) do
> od;
gap> for D in GeneratorsOfGroup(GrpB) do