Maxima Function
rank (M)
Computes the rank of the matrix M. That is, the order of the largest non-singular subdeterminant of M.
rank may return the wrong answer if it cannot determine that a matrix element that is equivalent to zero is indeed so.