Skip to main content

Open database for multi-dimensional numerical integration

Project description

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: openquad-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 ff3775914ed37658b4ff202f43576577e65b7d327c263bfa525b70742ccf2e54
MD5 6038c442d95ac561740ffb0e02613564
BLAKE2b-256 4852a8406e411ce8b2b019de453238b7b4ec0df05ebbef8347236db0f19286de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openquad-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a6ad9c81fcf55232c93a0154c5f8c0b2e494f9c77817c766059c0b5a00f887e
MD5 12f09583ec97a9ce14b4cb6d9536d10d
BLAKE2b-256 91eb1d1ddc552a0dbb448000291b96b851ca97ddc5a6dfdd0cae6a4cd703c044

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