sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 462 forks source link

Ideals in multivariate polynomial rings with no variables raise exception on comparison #3028

Closed 3559e0f1-d729-4981-87c6-663dbb2a16ea closed 16 years ago

3559e0f1-d729-4981-87c6-663dbb2a16ea commented 16 years ago

This code

ring = PolynomialRing(QQ, names=[])

id = ring.ideal(0)

print id == id

gives the following error message


<type 'exceptions.StopIteration'> Traceback (most recent call last)

/Users/bjarke/sync/ in ()

/Users/bjarke/sync/element.pyx in sage.structure.element.Element.richcmp (sage/structure/element.c:4558)()

/Users/bjarke/sync/element.pyx in sage.structure.element.Element._richcmp (sage/structure/element.c:4453)()

/Users/bjarke/sage-3.0/local/lib/python2.5/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py in cmp(self, other) 347 True 348 """ --> 349 l = self.groebner_basis() 350 r = other.groebner_basis() 351 return cmp(r,l)

/Users/bjarke/sage-3.0/local/lib/python2.5/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py in groebner_basis(self, algorithm, *args, *kwds) 1836 except TypeError: # conversion to Singular not supported 1837 # we might want to print a warning here -> 1838 gb = toy_buchberger.buchberger_improved(self, args, **kwds) 1839 elif algorithm.startswith('singular:'): 1840 gb = self._groebner_basis_using_singular(algorithm[9:])

/Users/bjarke/sage-3.0/local/lib/python2.5/site-packages/sage/rings/polynomial/toy_buchberger.py in buchberger_improved(F) 232 print "%d reductions to zero."%(reductions_to_zero) 233 --> 234 return Sequence(inter_reduction(G)) 235 236 def update(G,B,h):

/Users/bjarke/sage-3.0/local/lib/python2.5/site-packages/sage/rings/polynomial/toy_buchberger.py in inter_reduction(Q) 324 Q -- a set of polynomials 325 """ --> 326 base_ring = iter(Q).next().base_ring() 327 Q = set(Q) 328 while True:

<type 'exceptions.StopIteration'>:

Component: commutative algebra

Keywords: multivariate polynomial ring, no variables

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

3559e0f1-d729-4981-87c6-663dbb2a16ea commented 16 years ago

Attachment: idcomp.changeset.gz

ba94b9bb-195b-4422-a5e2-176920eaa163 commented 16 years ago
comment:3

Code looks good, doctests pass in sage/rings/polynomial. Positive review.

85eec1a4-3d04-4b4d-b711-d4db03337c41 commented 16 years ago
comment:4

Merged in Sage 3.0.2.alpha0