#11316: Weighted degree term orders added
----------------------------------------------------------------+-----------
   Reporter:  klee                                              |          
Owner:  AlexGhitza 
       Type:  enhancement                                       |         
Status:  needs_work 
   Priority:  major                                             |      
Milestone:  sage-4.7.1 
  Component:  basic arithmetic                                  |       
Keywords:             
Work_issues:  Singular conversion with negative degree weights  |       
Upstream:  N/A        
   Reviewer:                                                    |         
Author:  Kwankyu Lee
     Merged:                                                    |   
Dependencies:             
----------------------------------------------------------------+-----------
Changes (by SimonKing):

  * status:  needs_review => needs_work
  * work_issues:  => Singular conversion with negative degree weights


Comment:

 I am checking the documentation, and tried to add some more examples that
 expose the use of degree weights, and I found one problem.

 In the documentation, there is no statement on what values are allowed as
 degree weights. So, I assume that any real number is allowed (but this
 should be stated in the docs as well). In particular, negative degree
 weights should be allowed (this is something that I use in my current
 project).

 So, I tested
 {{{
 sage: N.<a,b,c> = PolynomialRing(QQ, 3,
 order=TermOrder('wdeglex',[-1,2,-3]))
 sage: c<a^2<1
 True
 }}}
 which is correct.

 But the conversion to Singular fails:
 {{{
 sage: T = N.term_order()
 sage: T.singular_str() # this is correct as well
 'Wp(-1,2,-3)'
 sage: singular(N)
 ---------------------------------------------------------------------------
 RuntimeError                              Traceback (most recent call
 last)

 /mnt/local/king/SAGE/sage-4.7.rc2/devel/sage-main/<ipython console> in
 <module>()

 /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-
 packages/sage/interfaces/singular.pyc in __call__(self, x, type)
     653             return self(x.sage())
     654         elif not isinstance(x, ExpectElement) and hasattr(x,
 '_singular_'):
 --> 655             return x._singular_(self)
     656
     657         # some convenient conversions

 /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-
 packages/sage/rings/polynomial/multi_polynomial_libsingular.so in
 
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular._singular_
 (sage/rings/polynomial/multi_polynomial_libsingular.cpp:9291)()

 /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-
 packages/sage/rings/polynomial/multi_polynomial_libsingular.so in
 
sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular._singular_init_
 (sage/rings/polynomial/multi_polynomial_libsingular.cpp:9851)()

 /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-
 packages/sage/interfaces/singular.pyc in ring(self, char, vars, order,
 check)
     903             s = '; '.join(['if(defined(%s)>0){kill %s;};'%(x,x)
     904                            for x in vars[1:-1].split(',')])
 --> 905             self.eval(s)
     906
     907         if check and isinstance(char, (int, long,
 sage.rings.integer.Integer)):

 /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-
 packages/sage/interfaces/singular.pyc in eval(self, x, allow_semicolon,
 strip, **kwds)
     548
     549         if s.find("error") != -1 or s.find("Segment fault") != -1:
 --> 550             raise RuntimeError, 'Singular error:\n%s'%s
     551
     552         if get_verbose() > 0:

 RuntimeError: Singular error:
    ? `a` is not defined
    ? error occurred in or before STDIN line 25: `ill 0*a;};; if(defined(
 0*b)>0){kill  0*b;};; if(defined( 0*c)>0){kill  0*c;};`
    ? `b` is not defined
    ? error occurred in or before STDIN line 25: `ill 0*a;};; if(defined(
 0*b)>0){kill  0*b;};; if(defined( 0*c)>0){kill  0*c;};`
    ? `c` is not defined
    ? error occurred in or before STDIN line 25: `ill 0*a;};; if(defined(
 0*b)>0){kill  0*b;};; if(defined( 0*c)>0){kill  0*c;};`
 }}}

 I assume that the example ''should'' work. And in Singular, it ''does''
 work:
 {{{

                      SINGULAR                             /  Development
  A Computer Algebra System for Polynomial Computations   /   version 3-1-1
                                                        0<
      by: G.-M. Greuel, G. Pfister, H. Schoenemann        \   Feb 2010
 FB Mathematik der Universitaet, D-67653 Kaiserslautern    \
 > ring r = 0,(a,b,c),Wp(-1,2,-3);
 > r;
 //   characteristic : 0
 //   number of vars : 3
 //        block   1 : ordering Wp
 //                  : names    a b c
 //                  : weights  -1 2 -3
 //        block   2 : ordering C
 }}}

 So, I'm putting it as "needs work".

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11316#comment:25>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to