Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
What happens if you work in a subgroup of $GL_n$? E.g. you want to look for commuting matrices that preserve some bilinear form when $M$ does of corse. More precisely in $Sp(2n, \mathbb Z)$?