Numerical quadrature with JAX
Project description
quadax is a library for numerical quadrature and integration using JAX.
Globally adaptive Gauss-Konrod quadrature for smooth integrands (similar to scipy.integrate.quad)
Adaptive tanh-sinh quadrature for singular or near singular integrands.
Quadrature from sampled values using trapezoidal, simpsons, and higher order rules.
Coming soon:
N-D quadrature (cubature) via iterated 1-D rules, sparse grids, and QMC methods
Integration with weight functions.
Installation
quadax is installable with pip:
pip install quadax
Usage
import jax.numpy as jnp
import numpy as np
from quadax import quadgk
f = lambda t: t * jnp.log(1 + t)
y, err = quadgk(fun, 0, 1, epsabs=1e-14, epsrel=1e-14)
np.testing.assert_allclose(y, 1/4, rtol=1e-14, atol=1e-14)
For full details of various options see the API documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
quadax-0.1.0.tar.gz
(26.3 kB
view hashes)
Built Distribution
quadax-0.1.0-py3-none-any.whl
(24.8 kB
view hashes)