#15074: Allowing 'textbook style' derivative output from pynac
-------------------------------+-------------------------
       Reporter:  mbejger      |        Owner:
           Type:  enhancement  |       Status:  new
       Priority:  major        |    Milestone:  sage-5.12
      Component:  symbolics    |   Resolution:
       Keywords:               |    Merged in:
        Authors:               |    Reviewers:
Report Upstream:  N/A          |  Work issues:
         Branch:               |       Commit:
   Dependencies:               |     Stopgaps:
-------------------------------+-------------------------

Comment (by nbruin):

 Replying to [comment:4 mbejger]:
 > Dear All, I have added a newer patch with an additional switch that
 allows for omitting the arguments of a function:
 >
 > {{{
 > var('x y z'); f = function('f', x, y, z)
 > f.diff(x,z,y,z)
 > D[0, 1, 2, 2](f)(x, y, z)
 > from sage.symbolic.pynac import omit_function_args
 > omit_function_args(True)
 > D[0, 1, 2, 2](f)
 > }}}
 Not a good idea. How do you tell apart the two following extremely
 different objects:
 {{{
 sage: sage.symbolic.operators.FDerivativeOperator(f,[0,1,2,2])
 D[0, 1, 2, 2](f)
 sage: f(x,y,z).diff(x,z,y,z)
 D[0, 1, 2, 2](f)(x, y, z)
 }}}
 The standard printing reflects exactly their relation: The second is
 obtained by evaluating the first at `(x,y,z)`.

 I think having a printing option that does something along the lines of
 {{{
 if (isinstance(expr.operator(),
 sage.symbolic.operators.FDerivativeOperator) and
         are_all_distinct_pure_variables(expr.operands())):
     return "diff(%s%s,%s)"%(
         expr.operator().function(),
         tuple(expr.operands()),
         tuple( v.operands()[i] for i in v.operator().parameter_set())
 else:
     return <normal string rep>
 }}}
 would be reasonable. That's the same approach maple seems to take.

--
Ticket URL: <http://trac.sagemath.org/ticket/15074#comment:5>
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/groups/opt_out.

Reply via email to