Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrap Maxima's factorial/gamma conversions/expansions #17737

Open
rwst opened this issue Feb 5, 2015 · 5 comments
Open

wrap Maxima's factorial/gamma conversions/expansions #17737

rwst opened this issue Feb 5, 2015 · 5 comments

Comments

@rwst
Copy link

rwst commented Feb 5, 2015

To be most clear to the user (and staying in sync with current ticket discussions) I rather propose four functions:

  • gamma_to_factorial - use simplify_full(?)
  • factorial_to_gamma - use makegamma with maxima.eval("gamma_expand:true")
  • expand_gamma - e.g., gamma(n+1) --> n*gamma(n), use makegamma with maxima.eval("gamma_expand:false"), also gamma_expand
  • simplify_gamma - e.g., n*gamma(n) --> gamma(n+1), use makegamma with maxima.eval("gamma_expand:true"). Could be an alias to 2) or left out.

This ticket will *not include one of these in another simplify* function.

CC: @kcrisman @sagetrac-ktkohl @sagetrac-tmonteil @EmmanuelCharpentier

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/17737

@rwst rwst added this to the sage-6.5 milestone Feb 5, 2015
@rwst

This comment has been minimized.

@rwst

This comment has been minimized.

@rwst rwst removed this from the sage-6.5 milestone Feb 17, 2015
@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Apr 24, 2018

comment:6

Such a feature would be awesome, in particular in a combinatorial context, it could be nice if Sage were able to transform gamma(n+1/2) into factorial(2n)/(4^n*factorial(n))*sqrt(pi), see e.g.

sage: var('k,n')
(k, n)
sage: assume(n,'integer')
sage: symbolic_product((2*k)^2-1,k,1,n)
2^(2*n + 1)*gamma(n + 3/2)*gamma(n + 1/2)/pi

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Dec 6, 2020

comment:7

As of 5.44.0, Maxima uses a genfact function that Sage may translate, but does not know how to use/evaluate explicitly :

sage: arccos(x).maxima_methods().powerseries(x,0).subs(x==0)
1/2*pi + sum(0^(2*i7 + 1)*genfact(2*i7 - 1, i7, 2)/((2*i7 + 1)*genfact(2*i7, i7, 2)), i7, 0, +Infinity)
sage: arccos(x).maxima_methods().powerseries(x,0).subs(x==0).simplify()
1/2*pi

sage: arcsin(x).maxima_methods().powerseries(x,0)
sum(x^(2*i2 + 1)*genfact(2*i2 - 1, i2, 2)/((2*i2 + 1)*genfact(2*i2, i2, 2)), i2, 0, +Infinity)
sage: genfact(3,2,2)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-19-b78e3f7f3947> in <module>
----> 1 genfact(Integer(3),Integer(2),Integer(2))

NameError: name 'genfact' is not defined

However, something in Sage seem to have some access to some definition of genfact :

sage: arccos(x).maxima_methods().powerseries(x,0).subs(x==0)
1/2*pi + sum(0^(2*i7 + 1)*genfact(2*i7 - 1, i7, 2)/((2*i7 + 1)*genfact(2*i7, i7, 2)), i7, 0, +Infinity)
sage: arccos(x).maxima_methods().powerseries(x,0).subs(x==0).simplify()
1/2*pi

But I'm unable to find where:

charpent@zen-book-flip:/usr/local/sage-9$ grep -lr genfact *
local/lib/ecl-20.4.24/maxima.fas
local/lib/fricas/target/x86_64-pc-linux-gnu/algebra/GHENSEL.fas
local/lib/maxima/5.44.0/binary-ecl/maxima
local/share/maxima/5.44.0/share/builtins-list.txt
local/share/maxima/5.44.0/share/orthopoly/orthopoly.lisp
local/share/maxima/5.44.0/tests/rtest15.mac
local/share/maxima/5.44.0/tests/rtest_gamma.mac
local/share/maxima/5.44.0/doc/html/index.hhk
local/share/maxima/5.44.0/doc/html/maxima_363.html
local/share/maxima/5.44.0/doc/html/maxima_364.html
local/share/maxima/5.44.0/doc/html/maxima_singlepage.html
local/share/maxima/5.44.0/doc/html/maxima_50.html
local/share/maxima/5.44.0/src/nparse.lisp
local/share/maxima/5.44.0/src/simp.lisp
local/share/maxima/5.44.0/src/series.lisp
local/share/maxima/5.44.0/src/asum.lisp
local/share/maxima/5.44.0/src/suprv1.lisp
local/share/maxima/5.44.0/src/option.lisp
local/share/info/maxima.info-1
local/share/info/maxima-index.lisp
local/share/info/maxima.info
local/share/info/maxima.info-3
local/share/emacs/site-lisp/maxima-font-lock.el

This is a defect, but quite consonant to the current "wishlist". Modifying the ticket as needed.

@EmmanuelCharpentier EmmanuelCharpentier mannequin added this to the sage-9.3 milestone Dec 6, 2020
@EmmanuelCharpentier EmmanuelCharpentier mannequin added t: bug and removed wishlist item labels Dec 6, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 13, 2021

comment:8

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Feb 13, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants