What is the value of the following for fixed $b, P$, and $Q$:
$$\frac{1}{2^m}\sum_{a\in \mathbb{F}_2^m} i^{\big(2(b+c)+(P+Q)a\big)^Ta},$$
where $b,c\in \mathbb{F}_2^m$, $P,Q$ are symmetric $m\times m$ binary matrices, and all the operations are binary, except the multiplication by $2$ which is modulo $4$? If it helps in some way, feel free to assume that $P,Q$ have zeros on the main diagonal.
So obviously the answer will depend on $c$. It also seems to me that the answer should depend on the rank of $P+Q$. However, I cannot really handle the $i$ and the multiplication by $2$.
If instead of $i$ one had $-1$, the situation is easier (at least for me). In this case one could Walsh-Hadamard transform for boolean functions and some related tricks.
In case some background is needed, the above sum shows up when computing the inner product of the so-called second order Reed-Muller functions.