This chapter describes the data structures and functions for matrix algebras in GAP3. See chapter Algebras for the description of all those aspects that concern general algebras.
First the objects of interest in this chapter are introduced (see More about Matrix Algebras, Bases for Matrix Algebras).
The next sections describe functions for matrix algebras, first those that can be applied not only for matrix algebras (see IsMatAlgebra, Zero and One for Matrix Algebras, Functions for Matrix Algebras, Algebra Functions for Matrix Algebras, RepresentativeOperation for Matrix Algebras), and then specific matrix algebra functions (see MatAlgebra, NullAlgebra, Fingerprint, NaturalModule).
A matrix algebra is an algebra (see More about Algebras) the elements of which are matrices.
There is a canonical isomorphism of a matrix algebra onto a row space (see chapter Row Spaces) that maps a matrix to the concatenation of its rows. This makes all computations with matrix algebras that use its vector space structure as efficient as the corresponding computation with a row space. For example the computation of a vector space basis, of coefficients with respect to such a basis, and of representatives under the action on a vector space by right multiplication.
If one is interested in matrix algebras as domains themselves then one should think of this algebra as of a row space that admits a multiplication. For example, the convention for row spaces that the coefficients field must contain the field of the vector elements also applies to matrix algebras. And the concept of vector space bases is the same as that for row spaces (see Bases for Matrix Algebras).
In the chapter about modules (see chapter Modules) it is stated that
modules are of interest mainly as operation domains of algebras. Here
we can state that matrix algebras are of interest mainly because they
describe modules. For some of the functions it is not obvious whether
they are functions for modules or for algebras or for the matrices that
generate an algebra. For example, one usually talks about the
fingerprint of an Amodule M, but this is in fact computed as the
list of nullspace dimensions of generators of a certain matrix algebra,
namely the induced action of A on M as is computed using
Operation( A, M )
(see Fingerprint, Operation for Algebras).
As stated in section More about Matrix Algebras, the implementation of bases for matrix algebras follows that of row space bases, see Row Space Bases for the details. Consequently there are two types of bases, arbitrary bases and semiechelonized bases, where the latter type can be defined as follows. Let φ be the vector space homomorphism that maps a matrix in the algebra A to the concatenation of its rows, and let B = (b_{1}, b_{2}, ..., b_{n}) be a vector space basis of A, then B is called semiechelonized if and only if the row space basis (φ(b_{1}), φ(b_{2}), ..., φ(b_{n})) is semiechelonized, in the sense of Row Space Bases. The canonical basis is defined analogeously.
Due to the multiplicative structure that allows to view a matrix algebra A as an Amodule with action via multiplication from the right, there is additionally the notion of a standard basis for A, which is essentially described in StandardBasis for Row Modules. The default way to compute a vector space basis of a matrix algebra from a set of generating matrices is to compute this standard basis and a semiechelonized basis in parallel.
If the matrix algebra A is unital then every semiechelonized basis and
also the standard basis have One( A )
as first basis vector.
IsMatAlgebra( obj )
returns true
if obj, which may be an object of arbitrary type, is a
matrix algebra and false
otherwise.
gap> IsMatAlgebra( FreeAlgebra( GF(2), 0 ) ); false gap> IsMatAlgebra( Algebra( Rationals, [[[1]]] ) ); true
Zero( A )
:NullMat
instead.
One( A )
:
Closure
, Elements
, IsFinite
, and Size
are the only set theoretic
functions that are overlaid in the operations records for matrix
algebras and unital matrix algebras.
See Set Theoretic Functions for Algebras for an overview of set
theoretic functions for general algebras.
No vector space functions are overlaid in the operations records for matrix algebras and unital matrix algebras. The functions for vector space bases are mainly the same as those for row space bases (see Bases for Matrix Algebras).
For other functions for matrix algebras, see Algebra Functions for Matrix Algebras.
Centralizer( A, a )
Centralizer( A, S )
:
Centre( A )
:
FpAlgebra( A )
:
gap> a:= UnitalAlgebra( Rationals, [[[0,1],[0,0]]] ); UnitalAlgebra( Rationals, [ [ [ 0, 1 ], [ 0, 0 ] ] ] ) gap> FpAlgebra( a ); UnitalAlgebra( Rationals, [ a.1 ] ) gap> last.relators; [ a.1^2 ]
RepresentativeOperation( A, v1, v2 )
returns the element in the matrix algebra A that maps v1 to v2
via right multiplication if such an element exists, and false
otherwise. v1 and v2 may be vectors or matrices of same dimension.
gap> a:= MatAlgebra( GF(2), 2 ); UnitalAlgebra( GF(2), [ [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), 0*Z(2) ] ], [ [ 0*Z(2), Z(2)^0 ], [ Z(2)^0, 0*Z(2) ] ] ] ) gap> v1:= [ 1, 0 ] * Z(2);; v2:= [ 1, 1 ] * Z(2);; gap> RepresentativeOperation( a, v1, v2 ); [ [ Z(2)^0, Z(2)^0 ], [ Z(2)^0, Z(2)^0 ] ] gap> t:= TrivialSubalgebra( a );; gap> RepresentativeOperation( t, v1, v2 ); false
MatAlgebra( F, n )
returns the full matrix algebra of n by n matrices over the field F.
gap> a:= MatAlgebra( GF(2), 2 ); UnitalAlgebra( GF(2), [ [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), 0*Z(2) ] ], [ [ 0*Z(2), Z(2)^0 ], [ Z(2)^0, 0*Z(2) ] ] ] ) gap> Size( a ); 16
NullAlgebra( F )
returns a trivial algebra (that is, it contains only the zero element)
over the field F.
This occurs in a natural way whenever Operation
(see Operation for
Algebras) constructs a faithful representation of the zero module.
Here we meet the strange situation that an operation algebra does not
consist of matrices, since in GAP3 a matrix always has a positive
number of rows and columns. The element of a NullAlgebra( F )
is
the object EmptyMat
that acts (trivially) on empty lists via right
multiplication.
gap> a:= NullAlgebra( GF(2) ); NullAlgebra( GF(2) ) gap> Size( a ); 1 gap> Elements( a ); [ EmptyMat ] gap> [] * EmptyMat; [ ] gap> IsAlgebra( a ); true
Fingerprint( A )
Fingerprint( A, list )
returns the fingerprint of the matrix algebra A, i.e., a list of nullities of six ``standard'' words in A (for 2generator algebras only) or of the words with numbers in list.
gap> m1:= PermutationMat( (1,2,3,4,5), 5, GF(2) );; gap> m2:= PermutationMat( (1,2) , 5, GF(2) );; gap> a:= Algebra( GF(2), [ m1, m2 ] );; gap> Fingerprint( a ); [ 1, 1, 1, 3, 0, 4 ]
Let a and b be the generators of a 2generator matix algebra.
The six standard words used by Fingerprint
are w_{1}, w_{2}, ..., w_{6}
where

NaturalModule( A )
returns the natural module M of the matrix algebra A. If A consists of n by n matrices, and F is the coefficients field of A then M is an ndimensional row space over the field F, viewed as Aright module (see Module).
gap> a:= MatAlgebra( GF(2), 2 );; gap> a.name:= "a";; gap> m:= NaturalModule( a ); Module( a, [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ] )
gap3jm