# Number of invertible circulant matrices over a finite field

As far as I can tell, the basic results on circulant matrices (traditionally carried out over $\mathbb{C}$) are still true over a finite field $F$ as long as you have "enough" roots of unity. The standard facts that don't require a norm or unitary matrix all carry over, along with their proofs. As the results for $n \times n$ complex matrices make use of the $n$ complex $n$th roots of unity, we can do the same, say, with the $p-1$ roots of unity in $\mathbb{Z}_p$ and $(p-1) \times (p-1)$ matrices. [If at any time I am incorrect, please say so.]

So, given the circulant $n \times n$ matrix $C$ with first row $c_0, c_1, \ldots, c_{n-1} \in F$ (a finite field), we can still write its determinant in terms of its representer polynomial

$p_C(x) = c_0 + c_1 x + \cdots + c_{n-1}x^{n-1}$

and the roots of unity. And, of course, we can still write out its eigenvalues in terms of all this, and we know that $C$ is invertible if and only if $0$ is not an eigenvalue.

Finally, after all this, my question. It is easy to count the number of circulant $n \times n$ matrices over the field $F$ of order $q$. Of these $q^n$ circulant matrices, how many of them are invertible? For my current project, I am most interested in the above-mentioned case of $F=\mathbb{Z}_p$ and $(p-1)$-square matrices, but I will take whatever answers I can get.

The circulant matrices form a ring $R\cong \Bbb F_q[X]/\left<X^n-1\right>$ so we are looking for the number of invertible elements in $R$. When $q$ and $n$ are coprime, $R$ is a direct product of fields: $R\cong F_1\times\cdots\times F_r$. Here $F_j\cong \Bbb F_q[X]/\left<f_j(X)\right>$ where $f_1,\ldots,f_r$ are the irreducible factors of $X^n-1$ over $\Bbb F_r$. Then $R$ has $$\prod_{j=1}^r(q^{d_j}-1)$$ invertible elements, where $d_j$ is the degree of $f_j$.

In the case $n=q-1$, $X^n-1$ splits into linear factors, and so there are $(q-1)^{q-1}$ invertible circulant matrices in this case.

• Very nice/interesting: thank you. I knew of the first isomorphism, but I've honestly never experienced the second one before (that $R$ breaks up as a product of fields). I need to digest this a bit, but what an elegant approach. Commented Jul 19, 2017 at 13:00