ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 12 Jul 2018 05:40:22 -0500canonical polynomial vs shift polynomialhttps://ask.sagemath.org/question/42946/canonical-polynomial-vs-shift-polynomial/ What is the difference between Canonical polynomial vs Shift polynomial? Is there any particular example or case study which can be used to understand the concept regarding cryptanalysis purpose.MMumtazThu, 12 Jul 2018 05:40:22 -0500https://ask.sagemath.org/question/42946/Linear Combination for Resultanthttps://ask.sagemath.org/question/36164/linear-combination-for-resultant/Let
R.<a, b, X> = ZZ[]
f = 1 - a*X^2
g = 1 - b*X^3
I need to compute polynomials `u` and `v` such that `u f + v g = r` where `r = f.resultant(g, X)`.
Pari has a function `polresultantext` for that purpose, so one solution for my problem is
(u, v, r) = (R(p) for p in f._pari_().polresultantext(g._pari_(), 'X'))
Nevertheless, I have a few questions:
* Is there a method in Sage which directly does this?
* Is the detour via Pari the recommended solution? Or is there an alternative, e.g., in singular?
* If there is currently no method in Sage for doing this directly, what name would you recommend? `resultant_ext` ?Clemens HeubergerTue, 03 Jan 2017 23:34:11 -0600https://ask.sagemath.org/question/36164/Problems with computing discriminants and resultants.https://ask.sagemath.org/question/7944/problems-with-computing-discriminants-and-resultants/I have been trying to prepare a class on algebraic geometry, and make some exercises (involving resultants and discriminants of polynomials) in sage.
I have noticed the following:
1) Discriminant is not defined for multivariate polynomial rings (handled by libsingular), they could be easily implemented by something like
f.resultant(f.derivative(y),y)
Other option would be to convert our polynomials to a univariate polynomial ring (over a ring with the other variables), and then use the function defined in univariate rings. But this has the following problem:
2) Both discriminant and resultants are defined for univariate polynomial rings, but they raise an error when the variable is not 'x', and there are more variables in the base ring. I think it can be solved in three possible ways:
- Go back to the multivariate case and use the approach above.
- Change the name of the variables, in such a way that the variable of the univariate polynomial ring is called 'x', compute the resultant/discriminant and then change the names back.
- Make pari forget about the other variables involved, making them live not in a polynomial ring, but in its base field. The computation works fine there, and then we can convert the result (who lives in the fraction field, back to the original ring.
See an example:
R.<x,y>=QQ[]
f=R(x^2+y^3-1)
gf=f.polynomial(R(y))
gf.base_ring()(gf.change_ring(gf.base_ring().fraction_field()).discriminant())
I plan to submit a patch with some of this solutions, but i would like to know what do you think would be the best approach.mmarcoTue, 15 Feb 2011 01:17:34 -0600https://ask.sagemath.org/question/7944/