Is it easy to check if two matrices define the same quadratic form over $\mathbb{Z}$?

211 Views Asked by At

Given two $\ell \times \ell$ symmetric matrices, is there an easy way to check if they define the same quadratic form over $\mathbb{Z}$ (up to a change of basis)?

In particular, among other examples, I am interested in the following two matrices $$\begin{pmatrix} 4 & 2 & 2 & 4 & 4 \\ 2 & 4 & 2 & 4 & 4 \\ 2 & 2 & 4 & 4 & 4 \\ 4 & 4 & 4 & 16 & 12 \\ 4 & 4 & 4 & 12 & 16 \end{pmatrix} \qquad , \qquad \begin{pmatrix} 8 & 6 & 6 & 6 & 6 \\ 6 & 8 & 6 & 6 & 6 \\ 6 & 6 & 8 & 6 & 6 \\ 6 & 6 & 6 & 8 & 6 \\ 6 & 6 & 6 & 6 & 8 \end{pmatrix} $$

I actually conjecture that they don't, so even a partial criteria (for instance an invariant common to all equivalent matrices) would suffice.

2

There are 2 best solutions below

1
On BEST ANSWER

For integer coefficient quadratic forms, equivalence is $$ P^T A P = B, $$ the requirement being that $P$ have all integer elements and determinant $\pm 1.$ So, one invariant is determinant. Your pair have different determinants, those being $2048$ and $512.$

The second thing is, for positive definite forms (these both are) to find the minimum, that is the smallest integer that cn be written as $x^T Ax$ where the column vector $x$ has integer elements, not all zero. That will take me several minutes.

1
On

Two such matrices $M,N$ define the same quadratic form if and only if they are equal.

For the proof of "only if", consider the standard basis of row vectors $e_1,\ldots,e_\ell$, consider the two basis vectors $e_i,e_j$. The evaluation of the $M$ quadratic form on the those two basis vectors yields the number $e_i M e_j^T = M_{ij}$; and the evaluation of the $N$ quadratic form yields $e_i N e_j^T = N_{ij}$; so if the two quadratic forms are "the same" --- i.e. if they are equal --- then $M_{ij}=N_{ij}$ for all choice of $i,j$.