The Lie group of invertible matrices $GL_n(\mathbb{C})$ acts by conjugation on its Lie algebra $gl_n(\mathbb{C})$ of all matrices. Orbits of this action are in bijection with canonical forms of matrices: rational canonical forms or Jordan forms. But how one can compute stabilizers of this action? In concrete terms I want to find all invertible matrices commuting with a given matrix in its canonical form.
Of course, this question has a general version for any Lie group and adjoint representation on its Lie algebra. Perhaps, it is possible to solve it in this generality, but the case of $GL_n(\mathbb{C})$ is already non-trivial for me.
Update: Perhaps, it is easier to understand in terms of modules over $R=\mathbb{C}[t]$. Given an $n \times n$ matrix $A$ we can consider $M = \mathbb{C}^n$ as a $\mathbb{C}[t]$ module on length $n$. Matrices commuting with $A$ are $\text{End}_R(M)$, invertible matrices are invertible elements of this ring $\text{End}_R(M)^*$.
Ring $R$ is a PID, and $M \cong \bigoplus_{i,j} R/(t-\lambda_i)^{n_{ij}}$. To compute the endomorphism ring we use $\text{Hom}_R(R/f,R/g) \cong R/\text{g.c.d.}(f,g)$. So $$ \text{Hom}(\bigoplus_{i,j} R/(t-\lambda_i)^{n_{ij}}, \bigoplus_{k,l} R/(t-\lambda_k)^{n_{kl}}) \cong \bigoplus_{i,j,l} R/(t-\lambda_i)^{\text{g.c.d.}(n_{ij}, n_{il})} $$ Then $$ \text{End}_R(M)^* \cong \bigoplus_{i,j,l} (R/(t-\lambda_i)^{\text{g.c.d.}(n_{ij}, n_{il})})^* $$ Invertible elements of $R/(t-\lambda)^m$ are truncated polynomials with non-zero constant term.
I'm not sure your question has an easy explicit answer but I can offer some comments. Let $A \in GL_n(\mathbb{C})$ be a matrix with distinct eigenvalues $\lambda_1, \dots, \lambda_k$ of algebraic multiplicity $n_1, \dots, n_k$.
The description above is somewhat technical but allows you in practice to calculate easily the stabilizer explicitly. You can also deduce the dimension of the stabilizer. I'll demonstrate this for $4 \times 4$ nilpotent matrices:
I can't see how much more can be said in general.