sage: pol2.degree(q)
0
sage: pol2.degree(p)
3
You get the expected behavior if you bring q into pol2.parent()
explicitly:
sage: q=pol2.parent()(q)
sage: pol2.degree(q),pol2.polynomial(q)
(3, 4*q^3 + 3*q + 2)
So, this seems like an error to me. In the implementation of degree()
the line reading
return singular_polynomial_deg(p, (<MPolynomial_libsingular>x)._poly, r)
should probably be changed (x is the generator passed to the method).
But maybe somebody who knows more about the singular/sage connection can
say more about this.
cheers,
julian
* rafaeldleon <rafae...@gmail.com> [2011-07-25 12:31:29 -0700]:
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
http://trac.sagemath.org/sage_trac/ticket/11652
* rafaeldleon <rafae...@gmail.com> [2011-07-28 18:00:25 -0700]:
> Dear Julian,
>
> Thank you very much for your help. It seems like an error to me too.
> I am using your solution in my code and is working nicely.
>
> Should we report this error in any other place?
>
> Thank you again,
>
> Rafael
>