#17298: Adding Graded/Weighted Hilbert Series Functionality to Sage
-------------------------------------+-------------------------------------
       Reporter:  john_perry         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  commutative        |   Resolution:
  algebra                            |    Merged in:
       Keywords:  Hilbert Series,    |    Reviewers:  Travis Scrimshaw
  weighted, singular                 |  Work issues:
        Authors:  John Perry         |       Commit:
Report Upstream:  N/A                |  40d897b5c3419c8de07978be965e6c3e9c078b98
         Branch:                     |     Stopgaps:
  public/ticket/17298-graded_hilbert_series|
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Fixed the c/p error. However the traceback tells you where the error
 occurred:
 {{{
 sage: P.<x,y,z> = PolynomialRing(QQ)
 sage: I = Ideal([x^3*y^2 + 3*x^2*y^2*z + y^3*z^2 + z^5])
 sage: I.hilbert_numerator(grading=5)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-3-49f8689d83b8> in <module>()
 ----> 1 I.hilbert_numerator(grading=Integer(5))

 /home/travis/sage/local/lib/python2.7/site-
 packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in
 __call__(self, *args, **kwds)
     603         if not R.base_ring().is_field():
     604             raise ValueError("Coefficient ring must be a field for
 function '%s'."%(self.f.__name__))
 --> 605         return self.f(self._instance, *args, **kwds)
     606
     607 require_field = RequireField

 /home/travis/sage/local/lib/python2.7/site-
 packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in
 hilbert_numerator(self, singular, grading)
    2824         if grading is not None:
    2825             if not isinstance(grading, (list, tuple)) or any(a not
 in ZZ for a in grading):
 -> 2826                 raise TypeError("Grading must be a list or a tuple
 of integers.")
    2827
    2828             hs = hilb(gb, 1, tuple(grading), attributes={gb:
 {'isSB': 1}})

 TypeError: Grading must be a list or a tuple of integers.
 }}}
 I believe the error message should be concise and not repeat information
 (plus I think most error messages in Sage/python don't tell you this info
 and rely on the traceback). However if you feel strongly about having
 `Hilbert series` into the error message, I'll change it.

--
Ticket URL: <http://trac.sagemath.org/ticket/17298#comment:23>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to