## Quadratic form diagonalization over Z5

Find a basis of the vector space $$\mathbb Z_5^3$$ so that the quadratic form whose analytic expression with respect to the standard basis is $$g((x, y, z)^{\mathrm T}) = 2x^2 + 3xy + xz + 4y^2 + yz$$ becomes diagonal (i.e. it will have a diagonal matrix).
• #### Solution

The matrix of a given quadratic form (with respect to the standard basis) is $$\begin{pmatrix} 2 &4 &3\\ 4 &4 &3\\ 3 &3 &0 \end{pmatrix}$$.

Now diagonalize it by using row and column transformations and on the right side perform only row transforms.

$$\left(\begin{array}{ccc|ccc} 2& 4& 3& 1& 0& 0\\ 4& 4& 3& 0& 1& 0\\ 3& 3& 0& 0& 0& 1 \end{array}\right)\sim \left(\begin{array}{ccc|ccc} 2& 0& 3& 1& 0& 0\\ 0& 1& 2& 3& 1& 0\\ 3& 2& 0& 0& 0& 1 \end{array}\right)\sim \left(\begin{array}{ccc|ccc} 2& 0& 0& 1& 0& 0\\ 0& 1& 2& 3& 1& 0\\ 0& 2& 3& 1& 0& 1 \end{array}\right)\sim \left(\begin{array}{ccc|ccc} 2& 0& 0& 1& 0& 0\\ 0& 1& 0& 3& 1& 0\\ 0& 0& 4& 0& 3& 1 \end{array}\right)$$

The rows of the right-hand side of the resulting matrix form the requested basis.

The basis is formed e.g. by vectors $$(1, 0, 0)^{\mathrm T}, (3, 1, 0)^{\mathrm T}$$ and $$(0, 3, 1)^{\mathrm T}$$.