I'm getting the following behavior on my local sage-4.4.2 and on sagenb.org:
sage: R.<x> = QQ[]
sage: R.su<tab>
R.sum R.summation
R.summation_from_element_class_add
sage: R.sum?
Object `R.sum` not found.
sage: R.sum()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/usr/local/src/sage/sage-4.4.2/devel/sage-trac/sage/rings/polynomial/<ipython
console> in <module>()
/usr/local/src/sage/sage-4.4.2/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:5264)()
/usr/local/src/sage/sage-4.4.2/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.raise_attribute_error
(sage/structure/parent.c:2622)()
AttributeError: 'PolynomialRing_field' object has no attribute 'sum'
The same thing happens with `summation` and
`summation_from_element_class_add`, and various other methods (for
instance `R.addition_table`). It also happens for both single variable
and multi-variable polynomial rings. Is this behavior known, or should
I open a ticket?
Thanks,
Jason Bandlow
One remark to support your guess:
sage: R._test_category()
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
/usr/local/sage/sage-4.4.2/local/lib/python2.6/site-packages/Sphinx-0.6.3-py2.6.egg/sphinx/<ipython console> in <module>()
/usr/local/sage/sage/local/lib/python2.6/site-packages/sage/structure/parent.so in sage.structure.parent.Parent._test_category (sage/structure/parent.c:4730)()
/usr/local/sage/sage/local/lib/python/unittest.pyc in failUnless(self, expr, msg)
323 def failUnless(self, expr, msg=None):
324 """Fail the test unless the expression is true."""
--> 325 if not expr: raise self.failureException, msg
326
327 def failUnlessRaises(self, excClass, callableObj, *args, **kwargs):
AssertionError: category of self improperly initialized
Cheers,
Florent
This is now http://trac.sagemath.org/sage_trac/ticket/9138 .
Thanks. I renamed this ticket to "Categories for polynomial rings",
following all the other "Categories for ..." tickets.
Polynomial rings should eventually be in GradedAlgebrasWithBasis and
IntegralDomains / EuclideanDomains (depending on the number of
variables); maybe even GradedHopfAlgebrasWithBasis. As a first step,
putting them in IntegralDomains would be good.
That's a good occasion to learn about categories, and with the other
tickets of the same nature (e.g. #8576), there are examples to look at
to see what needs to be done (most likely very little). See:
http://trac.sagemath.org/sage_trac/wiki/CategoriesRoadMap
Cheers,
Nicolas
--
Nicolas M. Thi�ry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/