Re: [sage-support] Roots af a polynomial
Thank you. On 18 July 2013 16:09, William Stein wrote: > On Thu, Jul 18, 2013 at 12:53 PM, Santanu Sarkar > wrote: > > Over integer. > > I did > > R. = QQ[x] > f = x*(x^3+1)*(x-17) > > then looked at f.roots?? which says it uses f.factor. So I looked at > f.factor?? and it uses Pari. (It probably helped that I wrote a lot > of this code.) > > So the answer appears to be the Sage completely factors the polynomial > using Pari, then pulls off the degree 1 factors to give the roots. > > I make no claim that this is in any way the best approach -- it really > can't be in general. For example, if you can factor the constant term > of the polynomial, then simply checking through divisors might be > dramatically faster (depending on how many divisors there are). > > William > > > > > > > On 18 July 2013 15:50, William Stein wrote: > >> > >> On Thu, Jul 18, 2013 at 11:54 AM, Santanu Sarkar > >> wrote: > >> > What algorithm is used in Sage to calculate the roots of a polynomial > >> > f(x)? > >> > Corresponding Sage function is f.roots() > >> > >> What is the base ring? There are a dozen answers, depending on the > >> ring in which the coefficients of f live... > >> > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "sage-support" group. > >> > To unsubscribe from this group and stop receiving emails from it, send > >> > an > >> > email to sage-support+unsubscr...@googlegroups.com. > >> > To post to this group, send email to sage-support@googlegroups.com. > >> > Visit this group at http://groups.google.com/group/sage-support. > >> > For more options, visit https://groups.google.com/groups/opt_out. > >> > > >> > > >> > >> > >> > >> -- > >> William Stein > >> Professor of Mathematics > >> University of Washington > >> http://wstein.org > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "sage-support" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to sage-support+unsubscr...@googlegroups.com. > >> To post to this group, send email to sage-support@googlegroups.com. > >> Visit this group at http://groups.google.com/group/sage-support. > >> For more options, visit https://groups.google.com/groups/opt_out. > >> > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sage-support" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to sage-support+unsubscr...@googlegroups.com. > > To post to this group, send email to sage-support@googlegroups.com. > > Visit this group at http://groups.google.com/group/sage-support. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sage-support] Roots af a polynomial
On Thu, Jul 18, 2013 at 12:53 PM, Santanu Sarkar wrote: > Over integer. I did R. = QQ[x] f = x*(x^3+1)*(x-17) then looked at f.roots?? which says it uses f.factor. So I looked at f.factor?? and it uses Pari. (It probably helped that I wrote a lot of this code.) So the answer appears to be the Sage completely factors the polynomial using Pari, then pulls off the degree 1 factors to give the roots. I make no claim that this is in any way the best approach -- it really can't be in general. For example, if you can factor the constant term of the polynomial, then simply checking through divisors might be dramatically faster (depending on how many divisors there are). William > > > On 18 July 2013 15:50, William Stein wrote: >> >> On Thu, Jul 18, 2013 at 11:54 AM, Santanu Sarkar >> wrote: >> > What algorithm is used in Sage to calculate the roots of a polynomial >> > f(x)? >> > Corresponding Sage function is f.roots() >> >> What is the base ring? There are a dozen answers, depending on the >> ring in which the coefficients of f live... >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "sage-support" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to sage-support+unsubscr...@googlegroups.com. >> > To post to this group, send email to sage-support@googlegroups.com. >> > Visit this group at http://groups.google.com/group/sage-support. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > >> >> >> >> -- >> William Stein >> Professor of Mathematics >> University of Washington >> http://wstein.org >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sage-support" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sage-support+unsubscr...@googlegroups.com. >> To post to this group, send email to sage-support@googlegroups.com. >> Visit this group at http://groups.google.com/group/sage-support. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/groups/opt_out. > > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sage-support] Roots af a polynomial
Over integer. On 18 July 2013 15:50, William Stein wrote: > On Thu, Jul 18, 2013 at 11:54 AM, Santanu Sarkar > wrote: > > What algorithm is used in Sage to calculate the roots of a polynomial > f(x)? > > Corresponding Sage function is f.roots() > > What is the base ring? There are a dozen answers, depending on the > ring in which the coefficients of f live... > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sage-support" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to sage-support+unsubscr...@googlegroups.com. > > To post to this group, send email to sage-support@googlegroups.com. > > Visit this group at http://groups.google.com/group/sage-support. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sage-support] Roots af a polynomial
On Thu, Jul 18, 2013 at 11:54 AM, Santanu Sarkar wrote: > What algorithm is used in Sage to calculate the roots of a polynomial f(x)? > Corresponding Sage function is f.roots() What is the base ring? There are a dozen answers, depending on the ring in which the coefficients of f live... > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/groups/opt_out. > > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Roots af a polynomial
What algorithm is used in Sage to calculate the roots of a polynomial f(x)? Corresponding Sage function is f.roots() -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.