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.
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.

Get started!

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.

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.3.0.tar.gz (97.8 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: openquad-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 2afe0e9106959299cd240c367d95057994fedfe554ec3476930268c2dc1dae37
MD5 83e1566f8ca8db46f16a6b62ad3d4ae9
BLAKE2b-256 aeb094f741468fa8bc1c8d4aaef952395722464156ef761b63ddee1b92fd9385

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openquad-0.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a490c87d20f9cdb2d593b69aa7fc11feec03919a55f487ac5ab73dace867793
MD5 05f5b09d24495e776d7bfd6746f3c094
BLAKE2b-256 89f9e969e76dd5bda308972c5731a11bf6f5ea9cd820e704bf7828768da7e7de

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