I’m happy to announce MeijerG.jl, a new Julia package providing numerical evaluation of the Meijer G‑function. The package aims to offer an easy-to-use interface for working with this very general special function.
Nice! I’ve noticed you rely on SpecialFunctions.jl, but you might be fine with a native Julia implementation for Bessel and Gamma instead?
EDIT:
I see that the other dependencies are already depending on SpecialFunctions.jl I really wish that was not the case. SpecialFunctions.jl adds external libraries that aren’t really needed in many cases.
Everything I wrote is Julia native so all that stands in the way of this being Julia native is, as you say, HypergeometricFunctions.jl relying on SpecialFunctions.jl.
This may seem like more of a roadblock than it truly is: I can get away without almost all of the stuff in SpecialFunctions.jl (though it would be a bit of work, it would be straightforward) but replacing HypergeometricFunctions.jl is essentially a no-go. So to make this Julia native we would need to start there.
If you have the skills to replace SpecialFunctions.jl by Bessels.jl (plus other packages) in these dependencies, that would be a nice long-term contribution IMO
@MikaelSlevinsky Would you entertain a PR to HypergeometricFunctions.jl which attempts to make it Julia native or is this something you’d prefer to be a fork? I had a quick look and I think it would not be that much work.
The same question can be asked for the other dependency: ClassicalOrthogonalPolynomials.jl.
At some point the community that is working on special math functions needs to step up to reconsider this widespread use of SpecialFunctions.jl. Alternatively, SpecialFunctions.jl itself could reexport native packages like Bessels.jl instead of relying on external libraries that are not even MIT-licensed.
The Slater expansion which lies at the heart of the package automatically produces the orthogonal polynomial families from their hypergeometric form (in the same way those reductions are theoretically derived), it’s just a slight speed boost to route through classical methods for those functions.
There are only two ‘core’ requirements which cannot be dropped from this package: loggamma and pFq but really it’s just loggamma since pFq is essentially already Julia native within HypergeometricFunctions.jl as far as I can tell other than perhaps using loggamma as well.
As it was made for Complex{BigFloat}, which is a really annoying case, it isn’t exactly fast because it has to do a bunch of things to ensure it works for variable precision but this just to say it can be done.
The path to MeijerG.jl being Julia native is thus simply:
1.) Make a Julia native loggamma available somewhere (maybe it already exists?)
2.) Use that for the pFq implementation instead of SpecialFunctions.jl 's loggamma (either in a fork or directly in HypergeometricFunctions.jl).
The discussion in the Bessels.jl issue I mentioned above seemed to end up agreeing that excessive package fragmentation is bad for the ecosystem (though I think putting Julia native loggamma into something called Bessels will mean people won’t find it). I don’t really have an opinion on that but I had a go at porting loggamma for Bessels.jl from the Julia native parts of SpecialFunctions.jl and that works just fine.
I would also be fine if the community preferred there to be a standalone Gamma.jl based on something like that. I don’t know where the best place to discuss that is tbh. Opinions?
I think it is preferable to have many focused packages as it cuts down on installation and pre compilation time. It also helps on discoverability as you mention.
That can be combined with convenient meta packages that loads a number of related packages.
I think we should still do a meta package like Specials.jl that reexports these but that’s something we can do later. I think this is the sort of thing that will make it easy to drop-in replace SpecialFunctions.jl if that is desired.
Once Gamma.jl is registered, I will also port a Julia native pFq into MeijerG (already had a chat with the maintainer of HypergeometricFunctions.jl and got the greenlight for that) which will make MeijerG.jl Julia native.