There’s no problem with the modulus raising(modup) implementation (Alg.1), but I can’t understand what is going on in the modulus reduction(moddown) algorithm.
For example, When I put [18 28 73](mod 131 137 173) rns vector and modup with (mod 57 73 113 233), the output was [50 5 105 169 18 28 73](mod 57 73 113 233 131 137 173) which was correct.
However, when I moddown the previous modup vector back again, the output was [129 135 171](mod 131 137 173) which was -2 values of the original moduli; with other parameters, there are similar unacceptable outputs. (I expected [18 28 73], the rear values of the modup vector)
Is it just because of an error term that occurs in approximate computing?
or should there be some RNS multiplication between modulus raising and modulus reduction?
Sorry for the poor explanation of my lack of understanding
Note also also that the fast basis extension (called ApproxSwitchCRTBasis in OpenFHE) has to be applied to the coefficient representation of the polynomials (as can be seen from the code).