Open database for multi-dimensional numerical integration
[!NOTE] The first stable release is under active development.
Stay tuned for any updates!
OpenQuad offers a collection of highly efficient quadrature methods for evaluating integrals on different domains and geometries, including 1d intervals, spherical surfaces, Euler angles and more. These methods serve as building blocks for constructing custom quadratures, making this package versatile for integrals over arbitrary multi-dimensional domains and tensor spaces.
Key features:
- Access a large collection of state-of-the-art quadrature methods (Gauss quadratures, spherical designs, uniform coverings, ...).
- Combine methods to create customized product quadratures.
- Integrate Python functions and array data with a single command.
- Export quadrature points and weights for use in other software.
Found a bug? Open an issue.
Missing a feature? Start a discussion.
We appreciate and welcome your contribution!
Installation
This package is available on
PyPi. Install it with pip
into your active environment:
python -m pip install openquad
Basic usage
Obtain Gauss-Legendre sample points and weights for degree 71 on the interval
[-10, 5]:
from openquad import Rn
quad = Rn([
('GaussLegendre', dict(degree=71, a=-10, b=5)),
])
quad.points
quad.weights
Integrate a function func(theta, phi) over the surface of the
two-dimensional unit sphere using a spherical design of degree 7:
from openquad import S2
quad = S2([
('S2-Design-Graef', dict(degree=7)),
])
quad.integrate(func)
Create a quadrature method for an integral over the three Euler angles,
using Lebedev-Laikov quadrature of degree 5 for the first two angles
combined with the composite trapezoid rule with 6 sample points for the third
angle, and export sample points and weights in a text file:
from openquad import SO3
quad = SO3([
('LebedevLaikov', dict(degree=5)),
('Trapezoid', dict(size=6)),
])
quad.savetxt('points_and_weights.dat')
For further information, including advanced examples, background information, and details on the implementation, see the documentation.
Citation
If this package was useful for your research, please cite it.
Metadata
Release files for openquad 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openquad-0.3.0.tar.gz | 97.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openquad-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 195.7 MB
Release files / openquad-0.3.0.tar.gz
| Download URL | openquad-0.3.0.tar.gz |
|---|---|
| Size | 97.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2afe0e9106959299cd240c367d95057994fedfe554ec3476930268c2dc1dae37
|
|
BLAKE2b-256 checksum How to use checksums |
aeb094f741468fa8bc1c8d4aaef952395722464156ef761b63ddee1b92fd9385
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / openquad-0.3.0-py3-none-any.whl
| Download URL | openquad-0.3.0-py3-none-any.whl |
|---|---|
| Size | 97.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a490c87d20f9cdb2d593b69aa7fc11feec03919a55f487ac5ab73dace867793
|
|
BLAKE2b-256 checksum How to use checksums |
89f9e969e76dd5bda308972c5731a11bf6f5ea9cd820e704bf7828768da7e7de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|