Calculating Cyclotomic Polynomials (with new revisions) (PDF)
Calculating Cyclotomic Polynomials (PDF)
-Submitted with revisions April 26, 2010 to Mathematics of Computation. Originally submitted Oct 10, 2008.
The $n_{th}$ cyclotomic polynomial $\Phi_n(z)$ is monic polynomial whose roots are the $n_{th}$ primitive roots of unity. It is the minimal polynomial, over the integers, of the $n_{th}$ primitive roots of unity. The height of $\Phi_n(z)$, $A(n)$, is the largest coefficient of $\Phi_n(z)$ in terms of absolute value.
The $n_{th}$ inverse cyclotomic polynomial, $\Psi_n(z)$, is the monic polynomial whose roots are the $n_{th}$ non-primitive roots of unity.
We develop and implement algorithms to calculate cyclotomic polynomials, towards the end of studying their coefficients.
We have three algorithms for calculating cyclotomic polynomials $\Phi_n(z)$, which we use to calculate $\Phi_n(z)$ for "small" $n$. (Currently roughly $n<2*10^{10}$)
Our first algorithm does repeated polynomial division using the FFT to calculate images of $\Phi_n(z)$ modulo primes $p$, and then reconstructs $\Phi_n(z)$ by way of Chinese remaindering. Using this approach we were able to find the first examples of $n$ such that $A(n)>n^2, and n^4. We call this algorithm the FFT-CRT method.
Our second algorithm, the SPS algorithm, calculates $\Phi_n(z)$ as a quotient of sparse truncated power series. Our implementation of the SPS algorithm is roughly an order of magnitude faster than that of the FFT-CRT algorithm.
Our third, newest algorithm, the recursive SPS algorithm, computes $\Phi_n(z)$ in a manner similar to that of the SPS algorithm; however, with our new approach we truncate any intermediate power series in our compuation to as minimal degree as necessary. This improves on the SPS algorithm by roughly another order of magnitude. For instance, to compute $\Phi_{n}(z)$ for $n=3234846615$, the product of the first nine odd primes, it originally required some 12 hours and 40 GB of memory on a powerful server using the FFT-CRT method. Using the SPS algorithm we were able to compute the same polynomial in under a half hour using roughly 4 GB of memory. Using our newest algorithm (and more intelligent inline assembly overflow checking), we are able to compute $\Phi_n(z)$ in under a minute.
We have a fourth algorith, the big prime algorithm, which was used to compute $\Phi_n(z)$ for $n=mp$ with large prime divisor $p$. This algorithm was mostly used to study cyclotomic polynomials of order four and five with very large degree and very low height. If you are interested in a particular cyclotomic polynomial computation or would like to look at my source code you can email me at (ada26 AT sfu DOT ca).
We show some plots of coefficients of cyclotomic polynomials. These plots are of a subset of the coefficients of $\Phi_n(z)$; we take the coefficient of term of degree $k$, for $k$ a multiple of some prime $p$. We chose $p$ so that our plots are roughly 10000 data points. We see that for some cyclotomic polynomials, the coefficients appear to be somewhat random, others have very definite structure.
Plots of cyclotomic polynomial coefficients (LINK)