pymc-devs / pymc-devs/pytensor

ENH: Add an op corresponding to `scipy.integrate.quad`

Open
#290 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature request SciPy compatibility
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.