I just tried reading the paper "Somewhat Practical Fully Homomorphic Encryption" by Fan and Vercauteren but I got confused by their use of the coefficient-wise modulus.
They define the polynomial ring $R = \mathbb{Z}[x]/(f(x))$ as their domain for all compuations and $[a]_q$ as the element in $R$ obtained by applying $\pmod q$ to all elements of $a$.
I am trying to understand the whole paper from a practical standpoint but I am struggling with the different applications of modular arithmetic.
From my understanding, $f(x)$ limits the degree of the polynomials in $R$. I also understand that a polynomial can be written as $g(x) = n \cdot f(x) + r(x)$. I think that $f(x)$ is often a cyclotomic polynomial and real vectors are often encoded into polynomials by finding a polynomial that equals the elements of the vector at the corresponding roots of unity. In that case we could even get $f(e^{2i\pi\frac{k}{n}}) = r(e^{2i\pi\frac{k}{n}})$, so the overflow into the modulus does not affect the results.
In a similar way, I think it makes sense to write $f(x) = [f(x)]_q + r(x)$. However, I don't know what that means for practical applications. Do we just need to avoid overflow at all costs?
I apologize if this sounds like incoherent rambling. I come from a Computer Science background. I hope someone can still help me understand things better.