Is a matrix similar to its transpose over $\mathbb{Z}_p$?

No for $n\geq 3$.

If $A\in M_n(\mathbf Z_p)$ were similar to $A^T\in M_n(\mathbf Z_p)$, then going modulo $p^2$, its image in $M_n(\mathbf Z/p^2\mathbf Z)$ would be similar to the image of its transpose.

However, Pooja Singla, Steven Spallone and I have shown in Similarity of matrices over local rings of length two that this fails for $n\geq 3$ (Theorem 7.9). For $n=3$ and $4$ we provide a classification and exact counts for matrices where this fails (see Table 9.4/ Table 8 in the arXiv version).

The answer is yes for $n=2$. This follows from Theorem 2.2 of Similarity classes of 3x3 matrices over a local principal ideal ring . I thank @KConrad for nudging me to think this through.


No, the matrix $$ \begin{pmatrix}0 & 1 & 0\\ 0 & 0 & p\\ 0 & 0 & 0 \end{pmatrix}\in\mathrm{M}_{3}(\mathbb{Z}_{p}) $$

is not similar to its transpose. This has been known for some time. McDonald, Linear Algebra over Commutative Rings (1984) atttributes this to M. Hochster in Exercise V.D.17, p. 424. More generally, it is noted there that this counter-example works for any commutative ring $R$ that is not von Neumann regular when instead of $p$ one uses an element $x\in R$ such that $x\not\in (x^2)$.

The "reason" why there is no counter-example for $2\times 2$ matrices over $\mathbb{Z}_p$ is that any such matrix can be written as $aI+p^iX$, where $a$ is a scalar and $X$ is a regular matrix, that is, $X$ is similar to a companion matrix. The point is that it is known that companion matrices over commutative rings are similar to their transpose (I think this is due to Gustafson).