-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Compute Gauss-Turán quadratures #252
base: master
Are you sure you want to change the base?
The head ref may contain hidden characters: "GaussTur\u00E1nQuadratures"
Conversation
@ChrisRackauckas Edit: Edit: Using |
Very nice! Just a thought, but have you considered opening a new package for your code to compute the Gauss Turán rules? Packages like GeneralizedGauss.jl, QuadGK.jl, and FastGaussQuadrature.jl are all standalone as they solve a very specific problem, and Integrals.jl isn't as much of a place to do something novel as it is a place to provide a consistent interface to other packages as well as AD rules. This also simplifies some aspects of dependency management and writing tests, and you could still implement the Gauss Turán algorithm as a package extension also depending on TaylorDiff.jl, as you have done here. I'd be happy to advise. |
@lxvm That sounds like a good idea! Indeed to evaluate an existing Gauss-Turán quadrature rule you only need TaylorDiff so that nicely fits in an Would |
I think it makes sense for GaussTuran.jl to tabulate quadrature rules, and a good example for how to do this is As for how TaylorDiff.jl plays into this, there are two options:
I think the latter would make sense so that GaussTuran.jl is a standalone package, similar to QuadGK.jl, and the extension in Integrals.jl would call that interface. The advantage is then that other people can use your package as-is without Integrals.jl, even though you develop the package with Integrals.jl in mind. |
@lxvm Any thoughts on which rules are interesting/relevant to tabulate? I have the not very well thought out impression that it is most interesting for sets of functions where the derivatives are not in the span of the set. |
You could start with the I haven't seen these quadratures in the wild and I think they aren't common because calculating the rule is expensive, calculating higher-order derivatives is non-trivial, and for a given order of accuracy you can trade higher order derivatives for more integration points. With packages like FastGaussQuadrature.jl, getting high-order Gauss-Legendre rules looks very easy and unless there are clear reasons why fewer evaluation points with derivative information is needed, I suppose most people choose a higher-order Gauss-Legendre rule. |
I'm starting to get my ducks in a row here: https://southendmusic.github.io/GaussTuranQuadrature.jl/dev/. Let me know what you think 😃 As mentioned by Chris, using Gauss-Turán rules is probably beneficial if you can compute the derivatives of your integrand very cheaply, possibly leading to fewer integrand calls to obtain the same accuracy as with a 'classical' rule with more nodes. See for instance my example: https://southendmusic.github.io/GaussTuranQuadrature.jl/dev/evaluate_rule/. |
Fixes #245.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
It was about time I created a PR for this. It needs some work to be incorporated into the package properly, and another look at how higher order derivatives are computed. See
GaussTuranExampleTemp\example.jl
for an example you can hopefully run locally.