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

N-D Quadrature #10

Open
JGameCreation opened this issue Jul 19, 2024 · 2 comments
Open

N-D Quadrature #10

JGameCreation opened this issue Jul 19, 2024 · 2 comments

Comments

@JGameCreation
Copy link

Hi, big fan of this repository! Are there any updates on n-dimensional quadrature? It would be very useful for me!

@f0uriest
Copy link
Owner

I've been giving this some thought lately. Initially I was planning to do something like nquad in scipy which is basically just a wrapper around recursive calls to quad. However, this sort of thing in jax ended up causing lots of issues with jit and AD due to the large number of local function definitions, and it also is likely super inefficient on GPU since it's almost entirely sequential. There is probably still some way to make it work but I haven't had time to play with it more, so would welcome contributions for that.

The other main way is "proper" nd quadrature using actual nd rules, rather than iterated 1d rules. I'm still reading up on the theory of this (it's mostly the same as 1d stuff but there's an additional issue of deciding which axis to split cells along, and many of the rules/algorithms are specific to a particular number of dimensions).

@JGameCreation
Copy link
Author

Thank you for sharing your thoughts! I guess the main problem with the recursive approach is that you would vmap over conditional control flow which means that you always have to wait for the slowest computation to finish. Therefore, I think some kind of batched nd quadrature rule would be ideal. Maybe it would be sufficient to start with 2 and 3 dimensions?

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