Two m × n matrices M1, M2 are equivalent if there exists an invertible m × m matrix P and an invertible n × n matrix Q such that M1 = PM2Q. If the entries are from a field, then a matrix M is equivalent to where r is the rank of M. See also Smith normal form.