Changes between Version 1 and Version 5 of Ticket #17505


Ignore:
Timestamp:
05/02/17 06:41:34 (5 years ago)
Author:
charpent
Comment:

Cut'n paste of the description of #22914 (duplicate ticket), at the request of the present ticket's author.

Note : Couldn't we cut'n'paste the recent code for symbolic sums (#21645) ?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17505

    • Property Cc charpent added
    • Property Milestone changed from sage-6.5 to sage-wishlist
  • Ticket #17505 – Description

    v1 v5  
     1The symbolic product is currently broken in Sage :
     2* It cannot be created in Sage :
     3{{{
     4sage: var("j,p", domain="integer")
     5sage: X,Y=function("X,Y")
     6sage: prod(X(j),j,1,p)
     7---------------------------------------------------------------------------
     8TypeError                                 Traceback (most recent call last)
     9<ipython-input-5-85e69544cbe9> in <module>()
     10----> 1 prod(X(j),j,Integer(1),p)
     11
     12/usr/local/sage-8/src/sage/misc/misc_c.pyx in sage.misc.misc_c.prod (/usr/local/sage-8/src/build/cythonized/sage/misc/misc_c.c:1596)()
     13     69
     14     70
     15---> 71 def prod(x, z=None, Py_ssize_t recursion_cutoff=5):
     16     72     """
     17     73     Return the product of the elements in the list x.
     18
     19TypeError: prod() takes at most 3 positional arguments (4 given)
     20sage: product(X(j),j,1,p)
     21---------------------------------------------------------------------------
     22NameError                                 Traceback (most recent call last)
     23<ipython-input-6-4d04d74c7489> in <module>()
     24----> 1 product(X(j),j,Integer(1),p)
     25
     26NameError: name 'product' is not defined
     27}}}
     28* Creatnig it it by casting a Maxima expression via the library interface gives nonsense :
     29{{{
     30sage: X(j).maxima_methods().prod(j,1,p)
     31X(j)^p
     32sage: X(j).maxima_methods().product(j,1,p)
     33X(j)^p
     34}}}
     35(Note : similar nonsense also happens with sums :
     36{{{
     37sage: X(j).maxima_methods().sum(j,1,p)
     38p*X(j)
     39}}}
     40)
     41* But something (what ?) can be created via the Maxima {{{pexpect}}} interface :
     42{{{
     43sage: maxima("prod(X(j),j,1,p)").sage().log().log_expand()
     44sum(log(X(j)), j, 1, p)
     45}}}
     46
     47The part of the problem bound to the Maxima library interface is the object of #22920. The present ticket aims at creating a Sage function/method correctly creating a symbolic product object.
     48
    149The ticket would have to decide which of (Maxima,SymPy) would be used as default for this.
    250{{{