simple?--from_meijer in jupyter

25 views
Skip to first unread message

Raymond Rogers

unread,
Apr 12, 2018, 6:06:17 PM4/12/18
to sage-support
The sympy documentation
 has the function from_meiljer and I do 
from sympy import *
from sympy.holonomic.holonomic import from_hyper, from_meijer, DifferentialOperators
(I think redundant)
I get: "ImportError: cannot import name from_meijer"
Is this a versioning error or what?

As a side issue: I am trying to go from generalized hypergeometric <-> meijerg
Is there a better way than through holomorphic?


Henri Girard

unread,
Apr 13, 2018, 3:15:59 AM4/13/18
to sage-s...@googlegroups.com

from sympy.holonomic.holonomic import *

Have you tried this ?

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Henri Girard

unread,
Apr 13, 2018, 3:25:27 AM4/13/18
to sage-s...@googlegroups.com

Sorry if I spam :

I did this is it of any help as it works in sage-8.1

from sympy import *
from sympy.holonomic.holonomic import *
from sympy.holonomic import DifferentialOperators
from sympy.abc import x
from sympy import ZZ
R, D = DifferentialOperators(ZZ.old_poly_ring(x), 'D')
HolonomicFunction(D**2 + 1, x, 0, [0, 1])
HolonomicFunction((1) + (1)*D**2, x, 0, [0, 1])



Le 13/04/2018 à 00:06, Raymond Rogers a écrit :

Raymond Rogers

unread,
Apr 13, 2018, 7:30:03 AM4/13/18
to sage-s...@googlegroups.com

Yes I had that; I thought the whole thing was too redundant.

Here is a complete entry and response:


from sympy import *
from sympy.holonomic.holonomic import from_hyper, from_meijer, DifferentialOperators

from sympy.holonomic.holonomic import *
from sympy.integrals import laplace_transform
from sympy.abc import z, t,s,a
from sympy.holonomic.holonomic import *
  
x, y= symbols('x y   ')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
init_printing(use_unicode=True)
--
--Response

ImportError                               Traceback (most recent call last)
<ipython-input-139-0bf94d2c5de2> in <module>()
      1 from sympy import *
----> 2 from sympy.holonomic.holonomic import from_hyper, from_meijer, DifferentialOperators
      3 from sympy.holonomic.holonomic import *
      4 from sympy.integrals import laplace_transform
      5 from sympy.abc import z, t,s,a



ImportError: cannot import name from_meijer

--------------
And the suggestion in your following message works; or at least doesn't error out.
But the attempt to:
 
from sympy.holonomic import DifferentialOperators,  from_meijer, from_hyper

continues to fail irrespective of the ordering of from_meijer and from_hyper. 
I will check and see if that statement can be removed; perhaps it's not needed?

Ray

You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/1I8ZThs_WGA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.

Eric Gourgoulhon

unread,
Apr 13, 2018, 8:01:45 AM4/13/18
to sage-support
Hi,

There is a typo in your code: it should be "from_meijerg" instead of "from_meijer":

sage: from sympy.holonomic.holonomic import from_meijerg
sage
: from_meijerg?
Signature: from_meijerg(func, x0=0, evalf=False, initcond=True, domain=QQ)
Docstring:
 
Converts a Meijer G-function to Holonomic. "func" is the G-Function
 
and "x0" is the point at which initial conditions are required.

 
>>> from sympy.holonomic.holonomic import from_meijerg, DifferentialOperators
 
>>> from sympy import symbols, meijerg, S
 
>>> x = symbols('x')
 
>>> from_meijerg(meijerg(([], []), ([S(1)/2], [0]), x**2/4))
 
HolonomicFunction((1) + (1)*Dx**2, x, 0, [0, 1/sqrt(pi)])
Init docstring: x.__init__(...) initializes x; see help(type(x)) for signature
File: ~/sage/8.1/local/lib/python2.7/site-packages/sympy/holonomic/holonomic.py
Type: function

Best wishes,

Eric.

Raymond Rogers

unread,
Apr 13, 2018, 8:28:41 AM4/13/18
to sage-s...@googlegroups.com

Sigh:   Yes...

Thanks!

Ray

Reply all
Reply to author
Forward
0 new messages