So one problem with the original post was that the thing I was trying to cast to a polynomial isn't a polynomial. I should have multiplied by x^32, not x^16. The correct input works correctly (see below). Still, attempting to cast a rational function with too big a denominator to a polynomial ought to just fail, not crash.
sage: K.<p,d,e,N> = FractionField(PolynomialRing(QQ,4,'pdeN')) sage: R.<x> = K[] sage: a = x^3-x^-3 sage: b = x^5-x^-5 sage: c = x^8-x^-8 sage: X = p*a + d*b + e*c sage: X = R(x^8*X) sage: X e*x^16 + d*x^13 + p*x^11 - p*x^5 - d*x^3 - e sage: f = X^2 - N*b*c*x^32 sage: f = R(f) sage: psi = cyclotomic_polynomial(30) sage: f.quo_rem(psi)[1] (-p^2 - 6*p*d - 2*p*e - N)*x^7 + (-4*p*d - 2*d*e - N)*x^6 + (p^2 + 2*p*d + 2*p*e - 2*d*e + N)*x^5 + (4*p*d + 2*d*e + 2*N)*x^4 + (8*p*d + 4*d*e + N)*x^3 + (4*p*d + 2*p*e + 2*d*e + e^2 + N)*x^2 + (2*p^2 - 2*p*d + 3*d^2 + 2*p*e + 2*d*e + 2*e^2)*x - p^2 - 6*p*d + e^2 -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support?hl=en.
