I need to multiply long integer numbers with an arbitrary BASE of the digits using FFT in integer rings. Operands are always of length n = 2^k
for some k
, and the convolution vector has 2n
components, therefore I need a 2n'th
primitive root of unity.
I'm not particularly concerned with efficiency issues, so I don't want to use Strassen & Schönhage's algorithm - just computing basic convolution, then some carries, and that's nothing else.
Even though it seems simple to many mathematicians, my understanding of algebra is really bad, so I have lots of questions:
What are essential differences or nuances between performing the FFT in integer rings modulo
2^n + 1
(perhaps composite) and in integer FIELDS modulo some primep
?
I ask this because2
is a(2n)th
primitive root of unity in such a ring, because2^n == -1 (mod 2^n+1)
. In contrast, integer field would require me to search for such a primitive root.
But maybe there are other nuances which will prevent me from using rings of such a form for the FFT.If I picked integer rings, what are sufficient conditions for the existence of
2^n
-th root of unity in this field?
All other2^k
-th roots of unity of smaller order could be obtained by squaring this root, right?..What essential restrictions are imposed on the multiplication by the modulo of the ring? Maybe on their length, maybe on the numeric base, maybe even on the numeric types used for multiplication.
I suspect that there may be some loss of information if the coefficients of the convolution are reduced by the modulo operation. Is it true and why?.. What are general conditions that will allow me to avoid this?- Is there any possibility that just primitive-typed dynamic lists (i.e.
long
) will suffice for FFT vectors, their product and the convolution vector? Or should I transform the coefficients toBigInteger
just in case (and what is the "case" when I really should)?
If a general answer to these question takes too long, I would be particularly satisfied by an answer under the following conditions. I've found a table of primitive roots of unity of order up to 2^30
in the field Z_70383776563201:
http://people.cis.ksu.edu/~rhowell/calculator/roots.html
So if I use 2^30
th root of unity to multiply numbers of length 2^29
, what are the precision/algorithmic/efficiency nuances I should consider?..
Thank you so much in advance! I am going to award a bounty to the best answer - please consider helping out with some examples.