# 36 Matrix Rings

A **matrix ring** is a ring of square matrices (see chapter Matrices).
In **GAP3** you can define matrix rings of matrices over each of the fields
that **GAP3** supports, i.e., the rationals, cyclotomic extensions of the
rationals, and finite fields (see chapters Rationals, Cyclotomics,
and Finite Fields).

You define a matrix ring in **GAP3** by calling `Ring`

(see Ring) passing
the generating matrices as arguments.

gap> m1 := [ [ Z(3)^0, Z(3)^0, Z(3) ],
> [ Z(3), 0*Z(3), Z(3) ],
> [ 0*Z(3), Z(3), 0*Z(3) ] ];;
gap> m2 := [ [ Z(3), Z(3), Z(3)^0 ],
> [ Z(3), 0*Z(3), Z(3) ],
> [ Z(3)^0, 0*Z(3), Z(3) ] ];;
gap> m := Ring( m1, m2 );
Ring( [ [ Z(3)^0, Z(3)^0, Z(3) ], [ Z(3), 0*Z(3), Z(3) ],
[ 0*Z(3), Z(3), 0*Z(3) ] ],
[ [ Z(3), Z(3), Z(3)^0 ], [ Z(3), 0*Z(3), Z(3) ],
[ Z(3)^0, 0*Z(3), Z(3) ] ] )
gap> Size( m );
2187

However, currently **GAP3** can only compute with finite matrix rings with
a multiplicative neutral element (a **one**). Also computations with large
matrix rings are not done very efficiently. We hope to improve this
situation in the future, but currently you should be careful not to try
too large matrix rings.

Because matrix rings are just a special case of domains all the set
theoretic functions such as `Size`

and `Intersection`

are applicable to
matrix rings (see chapter Domains and Set Functions for Matrix
Rings).

Also matrix rings are of course rings, so all ring functions such as
`Units`

and `IsIntegralRing`

are applicable to matrix rings (see chapter
Rings and Ring Functions for Matrix Rings).

### Subsections

- Set Functions for Matrix Rings
- Ring Functions for Matrix Rings

## 36.1 Set Functions for Matrix Rings

All set theoretic functions described in chapter Domains use their
default function for matrix rings currently. This means, for example,
that the size of a matrix ring is computed by computing the set of all
elements of the matrix ring with an orbit-like algorithm. Thus you
should not try to work with too large matrix rings.

As already mentioned in the introduction of this chapter matrix rings are
after all rings. All ring functions such as `Units`

and `IsIntegralRing`

are thus applicable to matrix rings. This section describes how these
functions are implemented for matrix rings. Functions not mentioned here
inherit the default group methods described in the respective sections.

`IsUnit( ``R`, `m` )

A matrix is a unit in a matrix ring if its rank is maximal (see
RankMat).

Previous Up Next

Index

gap3-jm

19 Feb 2018