#11847: unexpexted behavior of degree() with matrix ordering
-----------------------------------+----------------------------------------
   Reporter:  john_perry           |          Owner:  malb                      
                 
       Type:  enhancement          |         Status:  needs_review              
                 
   Priority:  major                |      Milestone:  sage-4.7.2                
                 
  Component:  commutative algebra  |       Keywords:  degree, polynomial, 
singular               
Work_issues:                       |       Upstream:  Not yet reported 
upstream; Will do shortly.
   Reviewer:                       |         Author:  john_perry                
                 
     Merged:                       |   Dependencies:  sage 4.7.2                
                 
-----------------------------------+----------------------------------------

Comment(by klee):

 Replying to [comment:6 mderickx]:
 > We could also add a keyword "use_grading" to the degree methods.

 Simon would think the "use_grading" keyword redundant because degree
 methods must always use grading. Perhaps keyword "use_default_grading" is
 more sensible. Anyway, using a long keyword is an overkill.

 >
 > Note that whathever we do, we should not do the combination of:
 >
 > {{{
 > sage: f.exponent(x)
 > [3,1,1]
 > sage: g.exponent(x) % convenient behavior for a monomial
 > 1
 > }}}
 >
 > Such a function will be very hard to use since this behaviour will make
 you write ugly code like:
 >
 >
 > {{{
 > deg = f.exponent()
 > if f.is_monomial():
 >     do_something(f)
 > else:
 >     do_something_else(f)
 > }}}
 >
 >

 I think degee methods are for polynomials while exponent methods are for
 monomials. So it should be more convenient to use exponent methods with
 monomials. It would even be reasonable to raise an error if f is not a
 monomial in f.exponents(), though I admit the current behavior
 {{{
 sage: f=x^3+x*y
 sage: f.exponents()
 [(3,0),(1,1)]
 }}}
 is surely a convenient extension, if used carefully.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11847#comment:7>
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