Is applying a ring homomorphism faster than symbolic substitution?
I'm working on a project where I need to do composition of polynomials; something like
P(Q1 + Q2)
Q2 are univariate polynomials with several hundred terms, and large integer coefficients (on the order of 10^10 or so). I've been doing this with the
.subs() method which, I think, moves things to the symbolic ring and does the substitutions there. (I think this because when I get errors, they have to do with coercing to or from the symbolic ring.) But it occurred to me I could also define a ring homomorphism sending the variable of
Q1 + Q2, and then apply the homomorphism to
So my question: will this be worth my while, or are the ring homomorphism methods too slow?