Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hypergeometric functions

Does anyone know of a package to compute hypergeometric functions in Julia?

I have been using GSL.jl which is wrapper for the GNU Scientific Library, but GSL only supports 0F0, 0F1, 1F1, 2F0 and 2F1. I need to compute 3F2.

like image 340
amrods Avatar asked May 06 '16 04:05

amrods


1 Answers

You can use the PyCall module to use mpmath from Python (formerly part of SymPy sympy.mpmath):

# import mpmath module 
@pyimport mpmath as mpmath

x = mpmath.hyp3f2(1,2,3,4,5, 0.5)

# then you will need to convert this to a float
Float64(x)

Out:

1.189874754256423

Docs for mpmath and the available hypergeometric functions are here: http://docs.sympy.org/0.7.1/modules/mpmath/functions/hypergeometric.html

(If you don't have mpmath installed, you can install it with pip from the shell:)

pip install mpmath
like image 161
niczky12 Avatar answered Oct 16 '22 06:10

niczky12