Rank - Maple Help

LinearAlgebra[Modular]

 Rank
 compute the rank of a mod m Matrix
 RankProfile
 compute the rank profile of a square mod m Matrix

 Calling Sequence Rank(m, A, meth) RankProfile(m, A, meth)

Parameters

 m - modulus A - mod m Matrix meth - (optional) keyword for choice of method

Description

 • The Rank function returns the rank of the input mod m Matrix, while the RankProfile function returns a list of 'rank' elements describing the rank profile of the input mod m Matrix.
 The rank profile list is simply a list of the location of the first non-zero entry in each nontrivial row in the row reduced form of the Matrix.
 • The following methods are available:

 REF (default) Compute using standard row-reduction (Row Echelon Form) inplaceREF Compute using standard row-reduction in-place in the input Matrix RET Compute using a Row Echelon Transformation approach inplaceRET Compute using a Row Echelon Transformation in-place in the input Matrix

 • Note that the two inplace methods available will destroy the data in the input Matrix, while the other two methods will generate a copy of the Matrix in which to perform the computation.
 • The RET methods are likely to be faster for large matrices, but may fail if the modulus is composite.
 • These commands are part of the LinearAlgebra[Modular] package, so they can be used in the form Rank(..) and RankProfile(..) only after executing the command with(LinearAlgebra[Modular]).  However, they can always be used in the form LinearAlgebra[Modular][Rank](..) and LinearAlgebra[Modular][RankProfile](..).

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\left[\mathrm{Modular}\right]\right):$
 > $p≔97$
 ${p}{≔}{97}$ (1)
 > $M≔\mathrm{Mod}\left(p,\left[\left[2,11,1,80\right],\left[31,16,27,36\right],\left[8,32,32,31\right],\left[25,4,90,63\right]\right],\mathrm{integer}\left[\right]\right)$
 ${M}{≔}\left[\begin{array}{cccc}{2}& {11}& {1}& {80}\\ {31}& {16}& {27}& {36}\\ {8}& {32}& {32}& {31}\\ {25}& {4}& {90}& {63}\end{array}\right]$ (2)
 > $\mathrm{Rank}\left(p,M\right),\mathrm{RankProfile}\left(p,M\right)$
 ${4}{,}\left[{1}{,}{2}{,}{3}{,}{4}\right]$ (3)

With an inplace method the input Matrix is altered

 > $\mathrm{Rank}\left(p,M,\mathrm{inplaceREF}\right),M$
 ${4}{,}\left[\begin{array}{cccc}{1}& {54}& {49}& {40}\\ {0}& {1}& {58}& {26}\\ {0}& {0}& {1}& {35}\\ {0}& {0}& {0}& {1}\end{array}\right]$ (4)

And a case that is not full rank

 > $M≔\mathrm{Mod}\left(p,\left[\left[2,2,1,80\right],\left[31,31,27,36\right],\left[8,8,32,31\right],\left[25,25,90,63\right]\right],\mathrm{integer}\left[\right]\right)$
 ${M}{≔}\left[\begin{array}{cccc}{2}& {2}& {1}& {80}\\ {31}& {31}& {27}& {36}\\ {8}& {8}& {32}& {31}\\ {25}& {25}& {90}& {63}\end{array}\right]$ (5)
 > $\mathrm{RankProfile}\left(p,M\right)$
 $\left[{1}{,}{3}{,}{4}\right]$ (6)
 > $\mathrm{Rank}\left(p,M\right)$
 ${3}$ (7)

A composite example where the RET method is unsuccessful

 > $M≔\mathrm{Matrix}\left(\left[\left[3,2\right],\left[2,3\right]\right],\mathrm{datatype}=\mathrm{integer}\right)$
 ${M}{≔}\left[\begin{array}{cc}{3}& {2}\\ {2}& {3}\end{array}\right]$ (8)
 > $\mathrm{Rank}\left(6,M,\mathrm{REF}\right)$
 ${2}$ (9)
 > $\mathrm{Rank}\left(6,M,\mathrm{RET}\right)$

Note that this is only because this is a case where the row echelon form exists, but the row echelon transform cannot be written in the required form.