I am trying to understand Algorithm 2 in 2021/204.
I think the first ModSwitch implementation corresponds to this function call in OpenFHE. Is that correct ?
Checking FastExpandCRTBasisPlOverQ reveals that it uses Equation 5 of 2021/204 and divides the result by Q to make error caused by Q-overflow of u negligible. This is due to using qInvModpi instead of qHatModPi. Is this right ?
However, I don’t see multiplication by P. Is that because P vanishes over modulus P ?
I also needed to confirm that ScaleAndRound function implements Simple Scaling in CRT representation in 2018/117.
Regarding ScaleAndRound, there are multiple versions of it (with different API), two are for HPS (with doubles; 1st is for decryption [Simple Scaling] and 2nd one is for multiplication in BFV) and one of them is for BEHZ (without doubles).
Yes, it is related to modulus switching and Remark 3.1. A more general form of modulus switching is discussed in Appendix E of https://eprint.iacr.org/2021/204.pdf, which should directly answer your question.