pymc-devs / pymc-devs/pytensor
ENH: Add an op corresponding to `scipy.integrate.quad`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
This issue is based on a conversation I had with @ricardoV94, about whether it would be possible to add an integration Op. Based on this conversation, a Quad op with gradients should be possible to implement in PyTensor and JAX by directly wrapping scipy.integrate.quad (disclaimer: I am still not clear on nomenclature with respect to vjp, jvp, push foward, pull back, gradient, etc, but everything needed seems to be in this thread).
Numba will be tricker as usual, because of the spotty Numba coverage of scipy. Scipy uses QUADPACK, written in Fortran, to actually do the computation. I'm pretty sure this can be overloaded, but it would take a bit of tinkering.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked JAX issue and the scipy.integrate.quad behavior first. Then identify PyTensor’s Op and gradient extension points, and investigate the Numba and QUADPACK constraints mentioned here. Done means a Quad integration Op with gradients is implemented, with backend support and limitations clearly resolved or scoped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100