# Evaluating a polynomial at root of unity over finite fields

Hi everyone!

I need to do some simulations for a project that I am working on. This involves the following "puzzle" which I don't know how to resolve. Your help is much appreciated.

Suppose I have a polynomial $F \in \mathbb{Z}[x]$. Let $p$ be a prime number and $F_p$ be the reduction of $F$ modulo $p$. In other words, $F_p \in \mathbb{F}_p[x]$. Let $n$ be a number relatively prime to $p$ and $\zeta_n$ is an $n$-primitive root of unity over $\mathbb{F}_p$. I want to compute the following number $F_p(\zeta_n) F_p(\zeta_n^{-1})$.

I searched on this website and the closest answer that I got is the following

I tried to modify this approach without success. More precisely, I do the following.

Step 1: To get $F_p$, I use `F.change_ring(GF(p))`

.

Step 2: Define `K=GF(p)`

and `K.<w> = CyclotomicField(n)`

.

Step 3: Compute `F_p(w)*F_p(1/w)`

It seems to me that Step 2 causes some problems. Additionally, the term 1/w also causes an issue as $1$ is recognized here as an integer and not an element over $\mathbb{F}_p$.

Please let me know if you have any comments or suggestions. Thank you very much!

Best wishes, Tung