Matrices are an important tool in algebra. A matrix nicely represents a homomorphism between two vector spaces with respect to a choice of bases for the vector spaces. Also matrices represent systems of linear equations.
In GAP matrices are represented by list of vectors (see Vectors). The vectors must all have the same length, and their elements must lie in a common field. The field may be the field of rationals (see Rationals), a cyclotomic field (see Cyclotomics), a finite field (see Finite Fields), or a library and/or user defined field (or ring) such as a polynomial ring (see Polynomials).
The first section in this chapter describes the operations applicable to matrices (see Operations for Matrices). The next sections describes the function that tests whether an object is a matrix (see IsMat). The next sections describe the functions that create certain matrices (see IdentityMat, NullMat, TransposedMat, and KroneckerProduct). The next sections describe functions that compute certain characteristic values of matrices (see DimensionsMat, TraceMat, DeterminantMat, RankMat, and OrderMat). The next sections describe the functions that are related to the interpretation of a matrix as a system of linear equations (see TriangulizeMat, BaseMat, NullspaceMat, and SolutionMat). The last two sections describe the functions that diagonalize an integer matrix (see DiagonalizeMat and ElementaryDivisorsMat).
Because matrices are just a special case of lists, all operations and functions for lists are applicable to matrices also (see chapter Lists). This especially includes accessing elements of a matrix (see List Elements), changing elements of a matrix (see List Assignment), and comparing matrices (see Comparisons of Lists).