Hello,
There are a few things I don’t understand in the implementation of the function LeveledSHECKKSRNS::AdjustLevelsAndDepthInPlace.
For example, if c1lvl < c2lvl and c1depth = c2depth = 2, the code first computes EvalMultCoreInPlace which brings the scaling factor of ciphertext1 to degree 3. Then, A ModReduceInternalInPlace increases the level of ciphertext1 by 1 and it decreases its degree and towers by 1. My main question is the following: why can’t we use directly LevelReduceInternalInPlace? This increases the level of ciphertext1 by 1 and decreases the towers by 1, leaving us in exactly the same place as in the previous case. I have written a simple example which computes x**12 and I get the same result if I do this modification.
My other two related questions are the following:
- When calling
EvalMultCoreInPlace, sometimes the value 1 is hardcoded and in others a function of scaling factors is passed. My understanding is that we need this when the scaling technique is FLEXIBLEAUTO, but we could hardcode the value to 1 for FIXEDAUTO. Is this correct? - In the scenario that I have described at the beginning, why do we need to call
SetScalingFactorafter callingModReduceInternalInPlace? Could you provide an example when the scaling factor ofciphertext1is different than the scaling factor ofciphertext2after the calls toEvalMultCoreInPlaceandModReduceInternalInPlace?
TLDR: Can we replace the calls to EvalMultCoreInPlace and ModReduceInternalInPlace by LevelReduceInternalInPlace in the function LeveledSHECKKSRNS::AdjustLevelsAndDepthInPlace?