Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bug in polynomial() for PolynomialRing(GF(5),2) #6036

Closed
kwankyu opened this issue May 14, 2009 · 9 comments
Closed

a bug in polynomial() for PolynomialRing(GF(5),2) #6036

kwankyu opened this issue May 14, 2009 · 9 comments

Comments

@kwankyu
Copy link
Collaborator

kwankyu commented May 14, 2009

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.

Component: basic arithmetic

Author: Kwankyu Lee

Reviewer: Mike Hansen

Merged: 4.0.rc0

Issue created by migration from https://trac.sagemath.org/ticket/6036

@kwankyu kwankyu added this to the sage-4.0 milestone May 14, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title a bug in polynomial() a bug in polynomial() for PolynomialRing(GF(5),2) May 14, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-4.0, sage-4.0.1 May 14, 2009
@kwankyu
Copy link
Collaborator Author

kwankyu commented May 14, 2009

Attachment: 12159.patch.gz

@kwankyu
Copy link
Collaborator Author

kwankyu commented May 14, 2009

Attachment: 12160.patch.gz

@kwankyu

This comment has been minimized.

@kwankyu

This comment has been minimized.

@mwhansen
Copy link
Contributor

comment:4

Attachment: trac_6036.patch.gz

I attached a folded patch -- it should be applied instead of the other two.

Looks good to me.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented May 19, 2009

comment:5

Merged trac_6036.patch in Sage 4.0.rc0.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed May 19, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-4.0.1, sage-4.0 May 19, 2009
@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 7, 2009

Reviewer: Mike Hansen

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 7, 2009

Author: Kwankyu Lee

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 7, 2009

Merged: 4.0.rc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants