#16671: implement harmonic number function H(n,m)
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  symbolics          |   Resolution:
       Keywords:  special, log       |    Merged in:
        Authors:  Ralf Stephan       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/rws/implement_harmonic_number_function_h_n_m_|  
e263ac41caa14a9ba4b537f0f5091cf012d64c3b
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Ouch, this actually shows a missed conversion:
 {{{
 sage: maxima_calculus(f(x).diff(x))
 'diff(f(_SAGE_VAR_x),_SAGE_VAR_x,1)
 sage: maxima_calculus(f(x+1).diff(x)) #this is bad!
 ?%at('diff(f(t0),t0,1),[t0=x+1])
 }}}
 and to compare:
 {{{
 sage: from sage.interfaces.maxima_lib import sr_to_max
 sage: maxima_calculus(sr_to_max(f(x+1).diff(x)))
 ?%at('diff(f(_SAGE_VAR_t0),_SAGE_VAR_t0,1),[_SAGE_VAR_t0=_SAGE_VAR_x+1])
 sage: maxima_calculus(sr_to_max(f(x).diff(x)))
 'diff(f(_SAGE_VAR_x),_SAGE_VAR_x,1)
 }}}
 How the temporary variable t0 gets represented doesn't matter, but `x`
 should absolutely be converted to `_SAGE_VAR_x`, in all cases.

 The problem is in
 
[http://git.sagemath.org/sage.git/tree/src/sage/symbolic/expression_conversions.py#n505
 line 505]. Changing it like this:
 {{{
 #!diff
 -            subs = ["%s = %s"%(t,a) for t,a in zip(temp_args,args)]
 +            subs = ["%s = %s"%(t._maxima_init_(),a._maxima_init_()) for
 t,a in zip(temp_args,args)]
 }}}
 and some more changes of the same nature should do the trick.

 This code also shows that the temporary variables are instantiated in sage
 anyway, so changing the conversion wouldn't be so bad.

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