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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file quadax-0.1.0.tar.gz
.
File metadata
- Download URL: quadax-0.1.0.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3638e80dc606131d58ae319c1f5f28c3db8dfcbac5edd2a6d7073d60b8ff5929 |
|
MD5 | 1f44e72038052cd30ee4d1222633528c |
|
BLAKE2b-256 | 7454ed20a9424617db329c853b121699be8e232c1d784f47527efddd0be7675e |
Provenance
File details
Details for the file quadax-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: quadax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ba380c7da81bfd4b16897dc52348546d01361acda22f17c705708d398d7b115 |
|
MD5 | 0807e3e08c6c5dd053e7b10d2f6ba2c6 |
|
BLAKE2b-256 | becf962d78dde3b7e63e28a5e30587d307d41a76de1a4c9101f195676ebdfde2 |