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

Add Appell functions? #35

Open
TSGut opened this issue Nov 5, 2020 · 2 comments
Open

Add Appell functions? #35

TSGut opened this issue Nov 5, 2020 · 2 comments

Comments

@TSGut
Copy link

TSGut commented Nov 5, 2020

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?

@MikaelSlevinsky
Copy link
Collaborator

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.

@TSGut
Copy link
Author

TSGut commented Nov 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants