JuliaMath / HypergeometricFunctions.jl

A Julia package for calculating hypergeometric functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Appell functions?

TSGut opened this issue · comments

Any interest or obvious route from the current implementations to adding Appell function support to this package? I would mainly be interested in F1 for my application case.

It seems currently the only reasonable implementations of these functions are in the form of this Fortran package, which also has an R wrapper, and the as far as I can tell independent implementation in the Python package mpmath - see also the documentation on mpmath.

Would be nice to be able to do this in Julia as well. Writing a wrapper would be straightforward but perhaps not in the spirit of the package?

I think they can be added for now, and if need be extracted to another package, say AppellFunctions.jl. If it's a wrapper, then perhaps the Julia community-friendly version is to create precompiled binaries of the wrapped library as a *_jll.jl package.

Alright, I'll look into it. I think it would be nice to have a Julia native version eventually.

In the meantime, for the sake of anyone who may come across this issue and needs Appell hypergeometric functions in Julia right this second, it's a relatively simple matter to use PyCall for the mpmath implementation I mentioned above. Assuming you install PyCall and Conda packages with their defaults in Julia you can install mpmath via

using Conda
Conda.add("mpmath")

and then you can define e.g. an Appell F1 function for yourself which returns Julia format values via

using PyCall
mpmath = pyimport("mpmath")
AppellF1(a,b1,b2,c,x,y)=pycall(mpmath.appellf1,Complex{Float64},a,b1,b2,c,x,y)

and with a few argument adjustments analogously for other functionality such as Appell F2, F3 and F4 listed here. If you want to run some sanity checks on whether it works as intended, you can e.g. compare it to the hypergeometric functions in this package in the special cases where Appell functions reduce to ordinary ones

using HypergeometricFunctions, Test
@test AppellF1(1,2,3,5,0.5,0.25) ≈ 4*_₂F₁(1,2,5,1/3)/3