Context: Number of nilpotent $n\times n $ matrices over $F_q$ is $q^{n(n-1)}$ classical result due to Ph.Hall, M.Gerstenhaber (see very nice exposition by T.Leinster at n-cat-cafe/arxiv) which have been generalized in 70-ies to other Lie algebras and rank restricted cases by R.Steinberg, T.Springer, G.Lusztig and more recently to (anti)symmetric matrices.
Setup: Consider $L(t) = \sum_{i=0,...,k} L_it^i $ polynomial with $n\times n$ matrix coefficients, impose condition condition $L(t)$ is nilpotent.
Question 1: Is the number of such $L(t)$ polynomial in $q$ ? What can be generating function over $n$ (sizes of matrices) generalizing q-exponential counting formula ? Is the generating function over $k$ (degree of polynom) - rational function (generalizing Peter's Taylor finding on tuples of matrices ) ?
Motivation: We can look on such matrices as Lax matrices of integrable systems. That means $det(L(t)-z) = \sum_{i,j} H_{i,j}z^i t^j$ functions $H_{i,j}$ Poisson commute with respect to natural Poisson structure $(gl[t]/t^k)^{*}$. Thus by classical theory joint level set $H_{i,j}=C_{i,j}$ is (almost) Jacobian of the "spectral curve" ( $\sum_{i,j} C_{i,j}z^i t^j = 0 $).
So the case of nilpotent matrices correspond to highly degenerate spectral curve $z^n=0$, which "Jacobian" might be expected to be some rational variety a kind of product $F_{p}^{P}$ (that expectation motivated by Lang-Serre theory of generalized Jacobians ). Examples suggest that actually it is NOT $F_{p}^{P}$ but more complicated, but nevertheless it seems to be rational and polynomial count.
Remark: More or less majority of the integrable systems arise in that way - from some $L(z)$ which can be rational, or elliptic or even higher genus curves. Hitchin's systems on singular curves is quite related example and the Gaudin model is more or less exactly that, the other names "polynomial matrices" system, etc...
The question can be generalized in various ways: one may consider nilpotent polynomial matrices of fixed nilpotency degree like $L^d(t)=0$. And simulations suggest that there are other generalizations:
Generalization - "composition principle": Consider class of matrices which are polynomial count by themselves - e.g. uppertriangular, nilpotent, (anti)-symmetric, or Manin matrices, or block matrices with (anti)-commuting blocks, or whatever.
Consider polynomial $L(t)=\sum_i L_it^i $ such that its matrix coefficients are matrices which are polynomial count by themselves.
Question 2: Is it true in such generalized setup that nipotency condition of any degree $L^d(t)=0$ would imply the polynomial count property ? (And same question on generating functions).
Question 3: Is such "composition principle" working at least for polynomials of degree 0: that means $M^{d}=0$ for $M$ from the class of polynomial count matrices ?
Computation experiments:
The experiments counting polynomial nilpotent matrices ) including those with coefficients in subclass - uppertriangular, nilpotent, (anti)symmetric) https://www.kaggle.com/code/alexandervc/count-nilpotent-polynom-matrices/notebook
Here are more complicated case - coefficients are Manin matrices or block matrices with commuting blocks. For polynom of degree 1: ($a+bt$) - nilpotency is the same as Grassman algebra condition: $a^2=b^2=0, ab+ba=0$.
https://www.kaggle.com/code/alexandervc/manin-block-anti-commuting-tuples:
Here are polynom of degree zero but the matrix is complicated - Manin or whatever: https://www.kaggle.com/code/alexandervc/count-manin-block-nilpotent:
PS
Thanks to Peter Taylor for the script to find polynoms.