Algorithm
In this section, we will go through the Circle FFT algorithm specifically, to interpolate a bivariate polynomial given the evaluations over a circle domain. We will also go over a concrete example which will help us understand the algorithm.
Circle FFT follows a divide-and-conquer strategy, as in the classical Cooley–Tukey FFT. We recursively reduce the task of interpolating a polynomial over some domain to interpolating a lower degree polynomial over a smaller domain. Thus at each recursive layer, we have "smaller" polynomials and their evaluations over "smaller" domains. Let us first go over this sequence of domains for the Circle FFT algorithm.
Sequence of Domains for Circle FFT
In Circle FFT, we use a 2-to-1 map to halve the domain size at each recursive layer. The domain used here is the circle domain of size .
This section describes two specific 2-to-1 maps that are central to the Circle FFT construction:
-
Projection map : The projection map projects the points and to the same -coordinate i.e. where is the set containing all the -coordinates from . This can be interpreted as saying that two points are considered equivalent if they differ only by sign. Since maps two points from to a single element in , the size of will be half the size of .
-
Squaring map : The squaring map is a 2-to-1 map defined by: This is obtained using the doubling map and the equality to compute the -coordinate:
In Circle FFT, we use both the projection map and the squaring map to construct the sequence of domains. The sequence of domains for Circle FFT is shown as follows:
Now that we know the sequence of domains, let us dive into the Circle FFT algorithm.
Circle FFT
The Circle FFT interpolates a bivariate polynomial from the polynomial space , given the evaluations over a circle domain of size . The algorithm is a three step process described as follows.
Step 1: Decompose into sub-polynomials
In the first step, we decompose the bivariate polynomial over using the projection map into two univariate polynomials and as follows:
Now to continue with the FFT algorithm, we want to compute the evaluations of and over the smaller domain , given the evaluations of over . This is done using the following equations:
Substituting all evaluations of over in the above equations, gives the evaluations of and over the domain .
To compute the evaluations of over the domain , we subtract the evaluations i.e. compute and then divide by . These values are the -coordinates of the points in the circle domain . They are also referred to as circle twiddles and they only depend on the circle domain . Therefore they can be precomputed before the start of the FFT algorithm. We will look into these in detail in the next section.
Example: To make all the calculations easier we will work on a concrete example over the Mersenne prime . Thus all calculations are over , i.e, modulo . We are given the evaluations of over the circle domain and we want to compute the coefficients of i.e. interpolate given its evaluations over .
Step 1: . First, decompose the polynomial using the map :
Given the evaluations of over the circle domain we aim to compute the evaluations of and over the smaller domain : For and in , substituting them into the following equations give:
Repeating this process for other pairs and in , we obtain:
Step 2: Recursively apply FFT to sub-polynomials
Given the evaluations of and over , we now compute their coefficients.
This step mirrors the recursive structure of the Cooley–Tukey FFT. Each polynomial is recursively split using the squaring map , and the process continues over successively smaller domains.
We begin by decomposing using the squaring map as follows:
We compute the evaluations of and over using the following equations.
This recursive process continues until we reach the base case: all evaluations of the polynomial over the domain are same. At that level, the coefficient is simply the evaluation of the constant polynomial.
Finally, we reconstruct the coefficients of by working backward through the recursive calls, using the decomposition equation at each level. The same process applies to compute the coefficients of .
Similar to circle twiddles, to compute the evaluations of over we divide by the values which are the values from the domain . These values are referred to as line twiddles. For the next recursive layer, we divide by values from i.e. and for the next recursive layer we divide by and so on. Thus the line twiddles is a vector of values and so on. These only depend on the initial domain and thus can be precomputed before the start of the algorithm.
Step 2: Given the evaluations of and over : we recursively apply the FFT algorithm to compute the coefficients of and .
At each layer, we decompose the polynomial using the polynomial map . For example, the decomposition of is:
Omitting the intermediate steps of the recursive calls, we eventually obtain the coefficients of and as follows:
Step 3: Combine the coefficients
Finally, we combine the coefficients of and to compute the coefficients of the original bivariate polynomial , using the decomposition:
Step 3: Given the coefficients of and : we reconstruct the original polynomial using the decomposition:
Substituting the expressions for and , we get:
This completes an overview of the interpolation algorithm using Circle FFT. In the next section, we will see how the twiddle values are computed and stored for Circle FFT.