#6036: [with patch, needs review] a bug in polynomial() for
PolynomialRing(GF(5),2)
------------------------------+---------------------------------------------
Reporter: klee | Owner: Somebody
Type: defect | Status: new
Priority: minor | Milestone: sage-4.0.1
Component: basic arithmetic | Keywords:
------------------------------+---------------------------------------------
Description changed by klee:
Old description:
> The patch 12159.patch modifies the code in remove_from_tuple() in
> sage.rings.polynomial.multi_polynomial.pyx. The patch 12160.patch adds a
> testing example in the docstring.
New description:
This works:
{{{
sage: R.<x,y>=PolynomialRing(QQ,2)
sage: a=x^2+x*y+y
sage: a.polynomial(x)
x^2 + y*x + y
But this does not work:
sage: R.<x,y>=PolynomialRing(GF(5),2)
sage: a=x^2+x*y+y
sage: a.polynomial(x)
Traceback (most recent call last):
...
TypeError: 'tuple' object cannot be interpreted as an index
}}}
I traced this bug, and found that
{{{
sage: B=QQ[x]
sage: print B({0:1,1:2})
2*x + 1
sage: print B({(0,):1,(1,):2})
2*x + 1
sage: B=GF(5)[x]
sage: print B({0:1,1:2})
2*x + 1
sage: print B({(0,):1,(1,):2})
Traceback (most recent call last):
...
TypeError: 'tuple' object cannot be interpreted as an index
}}}
I think the second form is not acceptable. Then the function
remove_from_tuple() in sage.rings.polynomial.multi_polynomial.pyx
should be revised as it output (1,) from (1,2) for example.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6036#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---