Is it possible to set different scales for each CKKS ciphertexts?

Hello,

In the encoding procedure of CKKS, the input vector is first scaled up by a large number (which is commonly called scale and determines the precision) and then encoded into a polynomial. I would like to set different scales for each input ciphertext and constants in the same program, and I am wondering if that’s possible in OpenFHE.

SEAL implements this feature: their CKKS encoding operation is encode(values, scale, destination) where scale is used to scale up the input. As an illustration, figure 1 in the EVA paper shows that scales are different for each input, ranging from 2^{30} to 2^{60}.

In my understanding, the equivalent for scale in the CKKS encoding implementation of OpenFHE is

scFact = cryptoParams->GetScalingFactorReal(level)

which is assigned to powP in the Plaintext::Encode function. However, this number seems to be fixed for each level. From a theory perspective, according to [KPP21], the Encode function scales up the input by \Delta which is also a constant. So if I am not mistaken, this means that it is impossible to set different scales for each input in OpenFHE. I would like to ask for a kind confirmation or clarification on this.

As a side note, I would like this feature because I am working with FHE compilers with scale management. Smaller scaling factors mean more multiplication depth and sparser Rescaling/Bootstrapping (and thus better runtime performance) with the same set of modulus, so one can fine-tune the scaling factors to balance performance and precision.

Thank you,
Zhengyuan Su

Currently, it is not possible to use scaling factors of different bit sizes in the same cryptocontext in OpenFHE because of usability issues, see a related thread Modulus Scale up and Scaling Factor scale up. It can be done, but you would have to change many functions and manually keep track of scaling factors. You could create different cryptocontexts, each with the desired scaling factor, then manually transfer the polynomials from one ciphertext to another and adjust the scaling factors.