ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 05 Feb 2011 11:41:57 +0100Is applying a ring homomorphism faster than symbolic substitution?https://ask.sagemath.org/question/7921/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)
where `P`, `Q1`, and `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 `P` to `Q1 + Q2`, and then apply the homomorphism to `P`.
So my question: will this be worth my while, or are the ring homomorphism methods too slow?
nilesSat, 05 Feb 2011 11:41:57 +0100https://ask.sagemath.org/question/7921/