sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.21k stars 419 forks source link

Make .variety() work for ideals of univariate polynomial rings #31331

Open bd4edba6-a6b9-4042-be56-832c680989e3 opened 3 years ago

bd4edba6-a6b9-4042-be56-832c680989e3 commented 3 years ago

Sage 9.2:

sage: PR = PolynomialRing(QQ, ['x'])
sage: I = ideal(PR('x^2 - 4'))
sage: print(I.variety())

Traceback (most recent call last):
  File "crash.sage.py", line 8, in <module>
    print(I.variety())
  File "sage/structure/element.pyx", line 493, in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4703)
  File "sage/structure/element.pyx", line 506, in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4815)
  File "sage/cpython/getattr.pyx", line 372, in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2619)
AttributeError: 'Ideal_1poly_field' object has no attribute 'variety'

And I had another, funkier error attempting the same thing from the notebook.

/opt/SageMath/9.2/local/lib/python3.8/site-packages/sage/structure/element.pyx in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4703)()
    491             AttributeError: 'LeftZeroSemigroup_with_category.element_class' object has no attribute 'blah_blah'
    492         """
--> 493         return self.getattr_from_category(name)
    494 
    495     cdef getattr_from_category(self, name):

/opt/SageMath/9.2/local/lib/python3.8/site-packages/sage/structure/element.pyx in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4815)()
    504         else:
    505             cls = P._abstract_element_class
--> 506         return getattr_from_other_class(self, cls, name)
    507 
    508     def __dir__(self):

CC: @slel

Component: commutative algebra

Keywords: ideal, variety, polynomial

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

slel commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,8 +1,9 @@
-Sage 9.2
+Sage 9.2:

-PR=PolynomialRing(QQ,['x'])
-I=ideal(PR('x^2-4'))
-print(I.variety())
+```
+sage: PR = PolynomialRing(QQ, ['x'])
+sage: I = ideal(PR('x^2 - 4'))
+sage: print(I.variety())

 Traceback (most recent call last):
   File "crash.sage.py", line 8, in <module>
@@ -28,3 +29,4 @@
 --> 506         return getattr_from_other_class(self, cls, name)
     507 
     508     def __dir__(self):
+```
slel commented 3 years ago

Changed keywords from none to ideal, variety, polynomial

mkoeppe commented 3 years ago
comment:2

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.