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

coercion system doesn't expect pickled parents #4696

Closed
burcin opened this issue Dec 4, 2008 · 1 comment
Closed

coercion system doesn't expect pickled parents #4696

burcin opened this issue Dec 4, 2008 · 1 comment

Comments

@burcin
Copy link

burcin commented Dec 4, 2008

The coercion system expects parents to be unique. This doesn't seem to hold when pickled parents are involved.

sage: x,y = QQ['x,y'].gens()
sage: i = ideal(x^2 - y^2 + 1)
sage: j = loads(dumps(i))
sage: i == j
True
sage: j == i
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)

/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-packages/sage/structure/element.so in sage.structure.element.Element.__richcmp__ (sage/structure/element.c:5329)()
    575 
    576 
--> 577 
    578 
    579 

/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-packages/sage/structure/element.so in sage.structure.element.Element._richcmp (sage/structure/element.c:4807)()
    516 
    517 
--> 518 
    519 
    520 

/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion (sage/structure/coerce.c:6345)()
    770 
    771 
--> 772 
    773 
    774 

/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps._coercion_error (sage/structure/coerce.c:11109)()
   1275 
   1276 
-> 1277 
   1278 
   1279 

RuntimeError: There is a bug in the coercion code in SAGE.
Both x (=Ideal (x^2 - y^2 + 1) of Multivariate Polynomial Ring in x, y over Rational Field) and y (=Ideal (x^2 - y^2 + 1) of Multivariate Polynomial Ring in x, y over Rational Field) are supposed to have identical parents but they don't.
In fact, x has parent 'Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field'
whereas y has parent 'Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field'
Original elements Ideal (x^2 - y^2 + 1) of Multivariate Polynomial Ring in x, y over Rational Field (parent Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field) and Ideal (x^2 - y^2 + 1) of Multivariate Polynomial Ring in x, y over Rational Field (parent Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field) and maps
<type 'NoneType'> None
<type 'sage.categories.morphism.CallMorphism'> Call morphism:
  From: Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field
  To:   Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field

Component: coercion

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

@burcin burcin added this to the sage-5.11 milestone Dec 4, 2008
@mwhansen
Copy link
Contributor

comment:1

This works now:

sage: sage: x,y = QQ['x,y'].gens()
sage: sage: i = ideal(x^2 - y^2 + 1)
sage: sage: j = loads(dumps(i))
sage: sage: i == j
True
sage: j == i
True

@mwhansen mwhansen removed this from the sage-5.11 milestone Jul 23, 2013
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

3 participants