OrderMat( mat )
OrderMat returns the order of the invertible square matrix mat. The
order ord is the smallest positive integer such that mat^ord is
the identity.
gap> OrderMat( [ [ 0*Z(2), 0*Z(2), Z(2)^0 ],
> [ Z(2)^0, Z(2)^0, 0*Z(2) ],
> [ Z(2)^0, 0*Z(2), 0*Z(2) ] ] );
4
OrderMat first computes ord1 such that the first standard basis
vector is mapped by mat^ord1 onto itself. It does this by
applying mat repeatedly to the first standard basis vector. Then it
computes mat1 as mat1^ord1. Then it computes ord2 such that
the second standard basis vector is mapped by mat1^ord2 onto
itself. This process is repeated until all basis vectors are mapped onto
themselves. OrderMat warns you that the order may be infinite, when it
finds that the order must be larger than 1000.
GAP 3.4.4