I’d like to understand OpenFHE’s choices around the packed CKKS encoding algorithm [1].
My naive understanding of CKKS encoding is that you:
Ensure/extend the input vector to satisfy a conjugate symmetry property
Apply an inverse canonical embedding (via FFT or similar)
The values at this step are guaranteed to be real-valued up to floating point roundoff errors.
Scale by \Delta and round to the nearest integer, putting the values as coefficients to get a polynomial
I noticed a few things about [1]:
No symmetry condition seems to be enforced.
OpenFHE uses the FFTSpecialInv function, which cites Algorithm 1 of [2]. That algorithm appears designed for evaluating coeffToSlot/slotToCoeff homomorphically, not for encoding.
These two appear related, so I’m curious to know how this special FFT is relevant for encoding (if there is anything here besides efficiency of doing operations in-place), and how it compensates for a lack of conjugate symmetry on the input.
Just my two cents on question 1.: as far as i know extending the input is “mathematically correct” if one uses the standard iDFT using all the roots of unity. On the other hand, one can use the odd powers only to avoid doing the conjugacy on the input (remark that one can obtain half the roots by conjugating the other half as, e.g., \omega_8^5 = \overline{\omega_8^3}, so using them all it’s redundant).
just be careful as perhaps the used roots might be in the shape \zeta^{5^i} to enable rotations (with \zeta being is a complex primitive 2n root of unity)