Let $$Q(n_1,n_2,\ldots,n_r)$$ be a quadratic form of several variables with integral coefficients. Let $$q$$ be a prime and let $$0. We are interested in the associated Gauss sum $$S(a,q)=\sum_{n_1,n_2,\ldots,n_r=0,\ldots,q-1}e\left(\frac{aQ(n_1,n_2,\ldots,n_r)}{q}\right).$$

Now suppose $$a$$ is a quadratic residue mod $$q$$. Writing $$a\equiv b^2$$ for some $$b$$ coprime to $$q$$, we see that $$S(a,q)=\sum e\left(\frac{Q(bn_1,bn_2,\ldots,bn_r)}{q}\right)=S(1,q).$$

What happens when $$a$$ is a quadratic nonresidue? When the quadratic form $$Q$$ is a sum of squares, we do know that $$S(a,q)=\left(\frac{a}{q}\right)^rS(1,q)$$ where $$\left(\frac{a}{q}\right)$$ stands for the Legendre symbol. My question is, is it true for a general $$Q$$?

So $$S(a,q)=\left(\frac{a}{q}\right)^R S(1,q)$$ with $$R$$ the number of non-zero terms in the sum of squares, it is $$r$$ when the symmetric matrix of the quadratic form has full rank.
When $$R$$ is odd and $$a$$ is not a square, together with $$S(0,q)+ \frac{q-1}{2} S(1,q)+\frac{q-1}{2}S(a,q)= \sum_{k=0}^{q-1} S(k,q)=q f(0)$$ it gives $$f(0)=\# \{ n \in F_q^r, Q(n)=0\}=q^{r-1}$$.
• We are summing over $n$ in the finite field with $q$ elements (with $q>2$ since otherwise it is trivial) and $Q$ is a quadratic form over $F_q$, no rationals here. The theorem is saying that for some $P\in GL_r(F_q), Q'(n) = Q(Pn)$ is a sum of squares quadratic form. Nov 24, 2020 at 14:01
• What happens when $q$ is not necessarily prime, say a prime power? Can we still somehow make the diagonalization work? Since now we do not have a field anymore. (The general case of $q$ can be reduced to the prime power case since S is multiplicative.) Nov 24, 2020 at 16:05
• For $p$ odd and $k\ge 2$ we have $\sum_{n=0}^{p^k-1} e^{2i\pi n^2/p^k}=\frac1p \sum_{m=0}^{p-1}\sum_{n=0}^{p^k-1} e^{2i\pi n^2(1+mp^{k-1})/p^k} =1$ because each $1+mp$ is a square, the same holds for $S(a,p^k)=\frac1p \sum_{m=0}^{p-1} S(a(1+mp^{k-1}),p^k)=p^{r(k-1)} f(0)$. Nov 24, 2020 at 16:10
• Your calculation seems to contradict en.wikipedia.org/wiki/Quadratic_Gauss_sum where it says that $S(a,p^k)=p S(a,p^{k-2})$ for the classical Gauss sum? Nov 24, 2020 at 16:34