Skip to main content

Open database for multi-dimensional numerical integration

Project description

openquad
Open database for multi-dimensional numerical integration

Source code on Github Documentation Openquad on the Python Package Index License: GPL v3 arXiv


[!NOTE] The first stable release is under active development.
Watch this repo to 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

Usage

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')

Integrate a Python 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)

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

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.

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

openquad-0.2.0.tar.gz (97.8 MB view details)

Uploaded Source

Built Distribution

openquad-0.2.0-py3-none-any.whl (97.9 MB view details)

Uploaded Python 3

File details

Details for the file openquad-0.2.0.tar.gz.

File metadata

  • Download URL: openquad-0.2.0.tar.gz
  • Upload date:
  • Size: 97.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for openquad-0.2.0.tar.gz
Algorithm Hash digest
SHA256 07ce04c2ea1de7145b667aaae2401b1c2e8cf4a58cba7b3dbe71786c89c171ae
MD5 263845aa9c39a4b1f98338d73c05c561
BLAKE2b-256 30a95fadb37d2fe18e544abad768d0a1676fce5cd684676828f2a5c49dd6bc31

See more details on using hashes here.

File details

Details for the file openquad-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: openquad-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 97.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for openquad-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dbbeace8c765d4bfdddd7f5d61b8907499ff8563df9a292a48bdfa2b99a7879
MD5 564162b4476d25d94bf35111d0226e83
BLAKE2b-256 d1fb8363948e44dfcca162be66ed5098918ebf423400613bfa9c92f8e6bab4b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page