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.
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 domainDn of size ∣Dn∣=2n.Dn=q+⟨gn−1⟩∪−q+⟨gn−1⟩This section describes two specific 2-to-1 maps that are central to the Circle FFT construction:
Projection map πx: The projection map πx projects the points (x,y) and (x,−y) to the same x-coordinate i.e.
πx:Dn→Sn,πx((x,y))=x
where Sn is the set containing all the x-coordinates from Dn. This can be interpreted as saying that two points are considered equivalent if they differ only by sign. Since πx maps two points from Dn to a single element in Sn, the size of Sn will be half the size of Dn.
Squaring map π: The squaring map π is a 2-to-1 map defined by:
π:Sn→Sn−1,π(x)=2x2−1
This is obtained using the doubling map and the equality y2=1−x2 to compute the x-coordinate:
π(x,y)=(x,y)+(x,y)=(x2−y2,2xy)=(2x2−1,2xy)
In Circle FFT, we use both the projection map πx and the squaring map π to construct the sequence of domains. The sequence of domains for Circle FFT is shown as follows:
DnπxSnπSn−1π⋯πS1Now that we know the sequence of domains, let us dive into the Circle FFT algorithm.
The Circle FFT interpolates a bivariate polynomial p(x,y) from the polynomial spaceLN(F), given the evaluations over a circle domain Dn of size N=2n. The algorithm is a three step process described as follows.
In the first step, we decompose the bivariate polynomial p(x,y) over Dn using the projection map πx into two univariate polynomials p0(x) and p1(x) as follows:
p(x,y)=p0(πx(x,y))+y⋅p1(πx(x,y))=p0(x)+y⋅p1(x)Now to continue with the FFT algorithm, we want to compute the evaluations of p0(x) and p1(x) over the smaller domain Sn=πx(Dn), given the evaluations of p(x,y) over Dn. This is done using the following equations:p0(x)=2p(x,y)+p(x,−y),p1(x)=2⋅yp(x,y)−p(x,−y)Substituting all evaluations of p(x,y) over Dn in the above equations, gives the evaluations of p0(x) and p1(x) over the domain Sn.
To compute the evaluations of p1(x) over the domain Sn, we subtract the evaluations i.e. compute p(x,y)−p(x,−y) and then divide by 2⋅y. These values y are the y-coordinates of the points in the circle domain Dn. They are also referred to as circle twiddles and they only depend on the circle domain Dn. 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 p=25−1=31. Thus all calculations are over F31, i.e, modulo 31. We are given the evaluations v=[13,16,9,30,29,27,13,21] of p(x,y) over the circle domain
D3=[(7,18),(13,7),(24,13),(18,24),(7,13),(13,24),(24,18),(18,7)]
and we want to compute the coefficients of p(x,y) i.e. interpolate p(x,y) given its evaluations v over D3.Step 1: . First, decompose the polynomial p(x,y) using the map πx(x,y)=x:p(x,y)=p0(πx(x,y))+y⋅p1(πx(x,y))=p0(x)+y⋅p1(x)Given the evaluations v of p(x,y) over the circle domain D3 we aim to compute the evaluations of p0 and p1 over the smaller domain S3:
S3=πx(D3)=[7,13,24,18]
For (x,y)=(7,18) and (x,−y)=(7,13) in D3, substituting them into the following equations give:
p0(x)=2p(x,y)+p(x,−y)=2p(7,18)+p(7,13)=213+29=21p1(x)=2⋅yp(x,y)−p(x,−y)=2⋅18p(7,18)−p(7,13)=2⋅1813−29=3Repeating this process for other pairs (x,y) and (x,−y) in D3, we obtain:
v0=[21,6,11,10],v1=[3,28,7,6]
Given the evaluations of p0(x) and p1(x) over Sn, 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 π(x)=2x2−1, and the process continues over successively smaller domains.We begin by decomposing p0(x) using the squaring map π as follows:
p0(x)=p00(π(x))+x⋅p01(π(x))We compute the evaluations of p00(x) and p01(x) over Sn−1=π(Sn) using the following equations.p00(π(x))=2p0(x)+p0(−x),p01(π(x))=2⋅xp0(x)−p0(−x)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 p0(x) by working backward through the recursive calls, using the decomposition equation at each level. The same process applies to compute the coefficients of p1(x).
Similar to circle twiddles, to compute the evaluations of p01(x) over Sn−1 we divide by the values x which are the values from the domain Sn. These values x are referred to as line twiddles. For the next recursive layer, we divide by values from Sn−1 i.e. π(x) and for the next recursive layer we divide by π2(x) and so on. Thus the line twiddles is a vector of values x,π(x),π2(x),… and so on. These only depend on the initial domain Dn and thus can be precomputed before the start of the algorithm.
Step 2: Given the evaluations of p0 and p1 over S3=[7,13,24,18]:
v0=[21,6,11,10],v1=[3,28,7,6]
we recursively apply the FFT algorithm to compute the coefficients of p0 and p1.At each layer, we decompose the polynomial using the polynomial map π(x). For example, the decomposition of p0(x) is:p0(x)=p00(π(x))+x⋅p01(π(x))Omitting the intermediate steps of the recursive calls, we eventually obtain the coefficients of p0(x) and p1(x) as follows:
p0(x)=12+26⋅x+π(x)+28⋅x⋅π(x)p1(x)=11+26⋅x+14⋅π(x)+20⋅x⋅π(x)
Finally, we combine the coefficients of p0(x) and p1(x) to compute the coefficients of the original bivariate polynomial p(x,y), using the decomposition:
p(x,y)=p0(x)+y⋅p1(x)
Step 3: Given the coefficients of p0(x) and p1(x):
p0(x)=12+26⋅x+π(x)+28⋅x⋅π(x)p1(x)=11+26⋅x+14⋅π(x)+20⋅x⋅π(x)
we reconstruct the original polynomial p(x,y) using the decomposition:
p(x,y)=p0(x)+y⋅p1(x)Substituting the expressions for p0 and p1, we get:
p(x,y)=12+26⋅x+π(x)+28⋅x⋅π(x)+y⋅(11+26⋅x+14⋅π(x)+20⋅x⋅π(x))p(x,y)=12+26⋅x+π(x)+28⋅x⋅π(x)+11⋅y+26⋅x⋅y+14⋅y⋅π(x)+20⋅x⋅y⋅π(x)
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.