Hi Brandon, Thanks for the link. No, G-functions are a subset of holonomic functions. In some sense, the G-functions are not complete, since they are not closed under multiplication. But holonomic functions are. Thanks for the link to the thesis, Subham, you should have a look at it, it might contains some useful algorithms.
You can follow our progress on the holonomic package by following our issues: https://github.com/sympy/sympy/labels/Holonomic%20Functions One problem that I didn't realize before is this: https://github.com/sympy/sympy/issues/11329, that from the holonomic differential equation, it's easy to identify, if the equation is an equation for a G-function, but the problem is that G-functions are various solutions of the corresponding ODE, so one has to identify the right linear combination, based on the initial condition. A similar problem is when converting to hypergeometric functions. But there we use the fact that we can obtain a closed recursive formula for the coefficients of a Taylor series of the given holonomic function (from that one can identify the hypergeometric function). Ondrej On Thu, Jun 30, 2016 at 2:17 PM, brandon willard <[email protected]> wrote: > Brilliant! I have come across the holonomic/[Meijer] G-function connection > before, but never really explored it. Do G/H-functions represent the entire > space of holonomic functions? How about the other way around? > I also recall this thesis covering both in connection to the solution of > integrals. > > > On Wed, Jun 29, 2016 at 4:45 PM, Ondřej Čertík <[email protected]> > wrote: >> >> Hi, >> >> I just want to update this thread, that we have fixed this problem, in >> my opinion, thanks to our GSoC student Subham Tibra, and his mentor >> Kalevi Suominen. I am Subham's mentor too, but Kalevi has done a much >> better job mentoring. ;) >> >> In short: hypergeometric as well as the MeijerG functions are >> solutions to an ODE together with some (symbolic) initial conditions >> at a point like x=0, or x=1 (or any other point). Holonomic functions >> are a generalization of this ODE to allow polynomials as coefficients >> of the ODE. Then suddenly they are closed to almost all operations >> (including multiplication, integration, differentiation) and there are >> algorithms that can robustly and quickly compute those operations. >> They are now implemented in SymPy. >> >> I am using SymPy version 8d7b522e58aae883b4592e4fae3babf82d1e4db2. >> Let's first show that what the meijerint._rewrite1() cannot do, can be >> done easily with holonomic functions: >> >> In [1]: from sympy.holonomic import from_sympy >> >> In [2]: meijerint._rewrite1((cos(x)/x), x) >> Out[2]: (1, 1/x, [(sqrt(pi), 0, meijerg(((), ()), ((0,), (1/2,)), >> x**2/4))], True) >> >> In [3]: meijerint._rewrite1((sin(x)/x), x) >> Out[3]: (1, 1/x, [(sqrt(pi), 0, meijerg(((), ()), ((1/2,), (0,)), >> x**2/4))], True) >> >> In [4]: meijerint._rewrite1((cos(x)/x)**2, x) >> >> In [5]: meijerint._rewrite1((sin(x)/x)**2, x) >> Out[5]: >> (1, >> x**(-2), >> [(sqrt(pi)/2, 0, meijerg(((0,), (1/2, 1/2, 1)), ((0, 1/2), ()), >> x**(-2)))], >> True) >> >> In [6]: from_sympy((cos(x)/x)) >> Out[6]: HolonomicFunction((x) + (2)Dx + (x)Dx**2, x), f(1) = cos(1), >> f'(1) = -sin(1) - cos(1) >> >> In [7]: from_sympy((sin(x)/x)) >> Out[7]: HolonomicFunction((x) + (2)Dx + (x)Dx**2, x), f(0) = 1, f'(0) = 0 >> >> In [8]: from_sympy((cos(x)/x)**2) >> Out[8]: HolonomicFunction((8*x) + (4*x**2 + 6)Dx + (6*x)Dx**2 + >> (x**2)Dx**3, x), f(1) = cos(1)**2, f'(1) = -2*sin(1)*cos(1) - >> 2*cos(1)**2, f''(1) = 4*cos(1)**2 + 2*sin(1)**2 + 8*sin(1)*cos(1) >> >> In [9]: from_sympy((sin(x)/x)**2) >> Out[9]: HolonomicFunction((8*x) + (4*x**2 + 6)Dx + (6*x)Dx**2 + >> (x**2)Dx**3, x), f(0) = 1, f'(0) = 0, f''(0) = -2/3 >> >> >> >> Here is an example how to use the holonomic functions module to >> compute integrals: >> >> https://github.com/sympy/sympy/issues/8944#issuecomment-229478358 >> >> it's around 10x faster than the SymPy's integrate() routine. >> >> The tough part is what to do about definite integrals where the >> antiderivative (a holonomic function) can be converted to elementary >> functions, like here: >> >> https://github.com/sympy/sympy/issues/11319 >> >> That's where the MeijerG approach gives better results. Also another >> advantage of the MeijerG approach is that it gives convergence >> conditions --- though perhaps there is a way to implement it in the >> holonomic module (https://github.com/sympy/sympy/issues/11322). >> >> Ondrej >> >> P.S. Thanks Brandon for your email. I think the above is the solution. >> >> On Sat, Feb 13, 2016 at 12:32 PM, brandon willard >> <[email protected]> wrote: >> > I've been thinking about this same topic a lot recently (partially due >> > to a >> > question about a G-function form of tanh), and it seems like the more >> > generalized G-function you mentioned, Ondrej, is probably necessary at >> > some >> > point. There doesn't seem to be a whole lot of literature on these >> > bivariate G-functions, but, if you extend the scope to H-functions and >> > bivariate hypergeometric functions (e.g. Horn, Appell), there are at >> > least >> > enough useful identities to consider implementing. >> > Here's one interesting identity involving that generalized G-function >> > and >> > the Appell: http://functions.wolfram.com/07.34.16.0003.01. >> > >> > Also, there are some explicit series expansions for H-functions might >> > help: >> > http://arxiv.org/abs/math/9803163. >> > >> > On Monday, February 1, 2016 at 2:28:18 PM UTC-6, Ondřej Čertík wrote: >> >> >> >> On Mon, Feb 1, 2016 at 1:26 PM, Ondřej Čertík <[email protected]> >> >> wrote: >> >> [...] >> >> > right, that cos^2(x) is not a (single) hypergeometric series. Which >> >> > is >> >> > fine, there is problem. >> >> >> >> -> there is no problem. >> >> >> >> Ondrej >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "sympy" 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 https://groups.google.com/group/sympy. >> > To view this discussion on the web visit >> > >> > https://groups.google.com/d/msgid/sympy/3e750003-cf00-4e6e-8e1c-c032fc7dc037%40googlegroups.com. >> > >> > For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "sympy" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/sympy/S0MSlsAhL74/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/sympy. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sympy/CADDwiVBvFqR6FF3cdn%3Dh9r57xaJk70JM1yQ_M2E91DZ5Rh%2BK0g%40mail.gmail.com. >> For more options, visit https://groups.google.com/d/optout. > > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/CAEOXDQ2HM9a%3DUUGnk6%2BAZZOnpBpMhyz2Ki-BCEn7oa7qQJKa6A%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVD3amsjK4UHsKu%3DrJuw04HonnPKY-LKELe8Y7vpqT-Omw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
