What is the relationship between `MultiplicativeDepth` and `approximation error`?

Hi everyone,

I used to think that as long as the “CurrentMultiplicativeDepth” is less than or equal to the “MaxMultiplicativeDepth,” multiplication would proceed without issues.

However, in a recent project, I set the “MaxMultiplicativeDepth” using parameters.SetMultiplicativeDepth(8), and the current “MultiplicativeDepth” of the ciphertext is 8. When I call Decrypt(), I encounter the following error:

openfhe-development/src/pke/lib/encoding/ckkspackedencoding.cpp:l.541:Decode(): The decryption failed because the approximation error is too high. Check the parameters.

Can anyone advise on how to estimate the approximation error and ensure the program runs smoothly?

Thank you!

I suspect you have the same issue as in FLEXIBLEAUTO ScalingTechnique, GetNoiseScaleDeg and decryption in CKKS - #4 by hilder Most likely 9 multiplications were done while the depth was set to 8. In FLEXIBLE* modes, the rescaling is done before next multiplication (which is explained in the cited topic). This is why the level is reported as 8 (because rescaling was not automatically done), but there is no more room left for computations.

Wow, get it! And thank your for your quickly response.