[GAP Forum] block matrix

Thomas Breuer thomas.breuer at math.rwth-aachen.de
Thu Jun 9 08:14:26 BST 2005


Dear GAP Forum,

Vahid Dabbaghian-Abdoly wrote

> I am want to construct a diagonal block matrix such that the 
> diagonal entries have different dimensions.
> Is there any function or method for such a matrix in GAP?

Currently the GAP library does not support block matrices with varying
block dimensions.

The documentation of the function `BlockMatrix' does not state this
explicitly, this will be improved in the next version.

So matrices of the format in question have to be represented by lists of
lists.
The only situation where one benefits from the fact that these matrices
are block matrices is their construction,
which can be performed using the sublist assignment operators,
for example as follows.

    gap> block1:= 3 * IdentityMat( 2 );;
    gap> block2:= 7 * IdentityMat( 3 );;
    gap> mat:= NullMat( 5, 5 );;
    gap> mat{ [ 1 .. 2 ] }{ [ 1 .. 2 ] }:= block1;;  
    gap> mat{ [ 3 .. 5 ] }{ [ 3 .. 5 ] }:= block2;;
    gap> Display( mat );
    [ [  3,  0,  0,  0,  0 ],
      [  0,  3,  0,  0,  0 ],
      [  0,  0,  7,  0,  0 ],
      [  0,  0,  0,  7,  0 ],
      [  0,  0,  0,  0,  7 ] ]

It should be noted that currently one can enter block matrices with
equal block dimensions via `BlockMatrix',
and there is a special method for multiplying two compatible block matrices,
but there are many situations where GAP does not use the block structure.
For example, when one computes a preimage under an action homomorphism
that describes the action of a group of block matrices on vectors
then GAP returns an ``unpacked'' matrix.
Eventually, it would be nice to have stronger support for block matrices
in GAP.

Thanks for the hint.

All the best,
Thomas Breuer





More information about the Forum mailing list