Let $A$ be a linear map over the finite-field vector space $(\mathbb F_2)^n$, i.e., an $\mathbb F_2$-valued $n\times n$ matrix, not necessarily symmetric. I'm interested in the sum $$Z(A) = \sum_{X\in \mathbb F_2^n} (-1)^{X^T A X}\;,$$ where $$x\rightarrow (-1)^x$$ should be thought of as a function from $\mathbb F_2$ to $\mathbb Z$ (or $\mathbb R$ or $\mathbb C$).
Is there a way to efficiently compute $Z(A)$ for large matrices $A$? Can one say anything interesting about for which $A$ we have $Z(A)=0$? For example, one can easily see that $Z(A)=0$ if $A=1\oplus B$ where $1$ is a $1\times 1$ matrix.
The motivation behind this question comes from physics. $Z(A)$ is the partition function of a discrete path integral, $X$ is are the different configurations of degrees of freedom which are summed over, and $X^T A X$ is a quadratic action.
Reposting this mathematics stackexchange question here since I didn't get any answers there.