TITLE: Number of $3\times 3$ anticommuting matrices over finite fields $\mathbb{F}_p$ is (or is not?) polynomial in $p$?
QUESTION [12 upvotes]: There are rare algebraic varieties such that the number of points over finite fields $\mathbb{F}_p$ is given by a polynomial in $p$. One notable series of examples is the commuting variety: $[A,B]=0$ of $n\times n$ matrices $A,B$ over finite field. The computation was obtained by Feit and Fine in 1960 and many generalizations have been obtained recently. But it seems results in natural generality are not yet achieved (see below).
Question 1: Consider pairs of $3\times 3$ anticommuting $AB+BA = 0 $  over finite fields $\mathbb{F}_p$, is true that their number is polynomial in $p$, for $p>2$ ? May be one needs to exclude some other primes, not only  $p=2$ or $p=2$ is the only exception ?
Question 2: If the number of points is indeed given by a polynomial ($p>2$),  then it is given by the polynomial found by Roland Bacher and Peter Taylor in MO 404760:
$$2p^{10}+7p^9-3p^8-6p^7-4p^6+3p^5+4p^4-2p^3$$
(My direct calculation yields 221157 and 31511625 matrices for $p=3,5$ respectively,
and colleagues found that it is the only polynomial of degree 10 which satisfies these conditions and has minimal possible coefficients. Heuristic to search for polynomials with the smallest possible coefficients works quite fine in my experience for such questions.)
Question 3: Bonus question. It might be count is polynomial for any $n$ and $n$x$n$ anticommuting $[A,B]=0$, and there is nice generating function over $n$ for such polynomials - similar to Feit,Fine result for commuting matrices ? (Well, it might be better to leave it for separate question).
======================
PS
For 2x2 case the polynomial seems to be given by $+p^5+3p^4-2p^3-2p^2+p$ for $p>2$, checked till $p=19$.
Anticommuting variety has been studied recently e.g.: Anti-commuting varieties.
======================
Context
We might expect similar results not only for pairs, but triples, n-tuples of commuting/anticommuting matrices: MO271752, but commuting/anticommuting is just an example, it should be true for much wider class of algebras - "categorical exponential formula" might be the right context for such questions MO272045, MO275524, however presently known forms seems does not cover even Feit,Fine case. See also very nice results and connections with Hasse-Weil zeta function in  Yifeng Huang 2021. The general question about varieties which are polynomial count seems also not so simple as disproof of Kontsevich conjecture indicates.
Such varieties thought to be defined over the mysterious "field with one element".

REPLY [7 votes]: Here is an explicit formula. Let $C_n(q)$ be the number of pairs of anticommuting matrices over $F_q$ of size $n$. Let
$$
\phi(q,T)=\sum_{n=0}^\infty \frac{T^n}{\prod_{i=1}^n(1-q^{-i})}.
$$
Then
$$
\sum_{n=0}^\infty \frac{C_n(q) T^n}{q^{n^2}\prod_{i=1}^n(1-q^{-i})} = \prod_{n=1}^\infty \frac{\phi(q,T^n)}{(1-q T^{2n})(1-T^{2n-1})}.
$$
The calculation is a bit tedious. Some of the ideas:
We have $|GL_n(F_q)|=q^{n^2}\prod_{i=1}^n(1-q^{-i})$, so when we divide $C_n(q)$ by this number we are counting pairs $A,B$ up to conjugation with weight $\frac{1}{|\text{automorphisms(A,B)}|}$.
The generating function splits as a product of the corresponding functions for $3$ cases:

$A$ invertible, $B$ invertible. Here the computation is reduced to the number of conjugacy classes $C$ in $GL_n$ satisfying $-C=C$. The answer is
$$
\prod_{n=1}^\infty \frac{1-T^{2n}}{1-q T^{2n}}.
$$

$A$ invertible, $B$ nilpotent. It is clear that $-B$ is conjugate to $B$, so the corresponding generating function counts nilpotent conjugacy classes
$$
\prod_{n=1}^\infty \frac{1}{1-T^{n}}.
$$

$A$ nilpotent, $B$ arbitrary. Here we compute the dimension of the kernel of the operator $B\to BA+AB$, obtain $\sum_{i} \lambda_i^2$ where $\lambda$ is the conjugate partition to the partition giving the sizes of Jordan blocks of $A$. The result is
$$
\prod_{n=1}^\infty \phi(q,T^n).
$$


Finally, we multiply all the generating functions together. and obtain the claimed result.
By the way, using the fact that the number of nilpotent matrices is $q^{n^2-n}$ one can check that the counting function for pairs nilpotent, nilpotent is given by
$$
F_3(q,q^{-1} T),
$$
where $F_3$ is the function for the case 3. So we obtain
$$
F_3(q,T)=F_3(q,q^{-1} T) \prod_{n=1}^\infty \frac{1}{1-T^{n}},
$$
from which it is possible to deduce our formula for $F_3$ using
$$
\phi(q,T)=\phi(q,q^{-1} T) \frac{1}{1-T}.
$$
But the formula for $F_3$ can be also obtained by a direct computation.