Suppose we have a $3\times 3$ non-singular anti-diagonal matrix with integral entries:
$A = \begin{pmatrix} 0 & 0 & a\\ 0 & b & 0\\ c & 0 & 0\end{pmatrix} , \,\,\,\,\,\,\,\, (a, b, c \in \mathbb Z -\{0\})$
- Under what conditions there is a non-singular matrix $P$ with rational entries such that $P^t A P$ is a diagonal matrix with integral entries, i.e,
$P^{t} A P = \begin{pmatrix} r & 0 & 0\\ 0 & s & 0\\ 0 & 0 & t\end{pmatrix} , \,\,\,\,\,\,\,\, (r, s, t \in \mathbb Z -\{0\}) ?$
- Moreover, suppose such matrix $P$ exist. For a given matrix $A$, how can we effectively determine an example of $P$ (up to multiplication by a rational number)? I am more interested in question 2. Since we have diagonal and anti-diagonal matrices I thought the computation would be easy. But it seems more complicated than it looks.
The necessary and sufficient condition is $a=c$.
If a desired $P$ exists, then $P^tAP$ is a diagonal matrix and hence symmetric. Therefore $A$ must be symmetric too and $a=c$.
Conversely, if $a=c$, let $P=\pmatrix{1&0&-1\\ 0&1&0\\ 1&0&1}$. Then $P^tAP=\operatorname{diag}(2a,\,b,\,-2a)$ will satisfy your requirement.