Skip to main content

FastGL computes Gauss-Legendre quadrature nodes and weights O(1000)x faster than scipy.special.roots_legendre. It does so by implementing an iteration-free algorithm developed in Bogaert (2014). This Python package is a thin wrapper around the C++ code from that paper. A classical iterative algorithm from Kendrick Smith is also implemented, which is around 20x faster than the SciPy implementation. Both are OpenMP parallelized.

  • Free software: BSD license

Usage

This module contains functions to compute the sample points and weights for Gauss-Legendre quadrature given the quadrature order.

>>> import fastgl
>>> N = 100
>>> mu, w_mu = fastgl.roots_legendre(N) # FastGL calculation
>>> mu, w_mu = fastgl.roots_legendre_brute(N) # Classical Iterative calculation

Here, mu is a numpy array containing the cosine of the sample points (ranging from -1 to 1) and w_mu is a numpy array containing the corresponding quadrature weights.

Installing

Make sure your pip tool is up-to-date. To install fastgl, run:

$ pip install fastgl --user

This will install a pre-compiled binary suitable for your system (only Linux and Mac OS X with Python>=3.10 are supported).

If you require more control over your installation, e.g. using Intel compilers, please see the section below on compiling from source.

Compiling from source (advanced / development workflow)

The easiest way to install from source is to use the pip tool, with the --no-binary flag. This will download the source distribution and compile it for you. Don’t forget to make sure you have CC and FC set if you have any problems.

For all other cases, below are general instructions.

First, download the source distribution or git clone this repository. You can work from master or checkout one of the released version tags (see the Releases section on Github). Then change into the cloned/source directory.

Once downloaded, you can install using pip install . inside the project directory. We use the meson build system, which should be understood by pip (it will build in an isolated environment).

We suggest you then test the installation by running the unit tests. You can do this by running pytest.

To run an editable install, you will need to do so in a way that does not have build isolation (as the backend build system, meson and ninja, actually perform micro-builds on usage in this case):

$ pip install --upgrade pip meson ninja meson-python cython numpy pybind11
$ pip install  --no-build-isolation --editable .

Contributions

If you have write access to this repository, please:

  1. create a new branch

  2. push your changes to that branch

  3. merge or rebase to get in sync with master

  4. submit a pull request on github

If you do not have write access, create a fork of this repository and proceed as described above.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastgl-0.1.12.tar.gz (91.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fastgl-0.1.12-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (272.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fastgl-0.1.12-cp314-cp314-macosx_13_0_x86_64.whl (409.9 kB view details)

Uploaded CPython 3.14macOS 13.0+ x86-64

fastgl-0.1.12-cp314-cp314-macosx_13_0_arm64.whl (365.8 kB view details)

Uploaded CPython 3.14macOS 13.0+ ARM64

fastgl-0.1.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (272.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fastgl-0.1.12-cp313-cp313-macosx_13_0_x86_64.whl (409.7 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

fastgl-0.1.12-cp313-cp313-macosx_13_0_arm64.whl (365.9 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

fastgl-0.1.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (272.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fastgl-0.1.12-cp312-cp312-macosx_13_0_x86_64.whl (409.7 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

fastgl-0.1.12-cp312-cp312-macosx_13_0_arm64.whl (365.8 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

fastgl-0.1.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (269.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fastgl-0.1.12-cp311-cp311-macosx_13_0_x86_64.whl (407.2 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

fastgl-0.1.12-cp311-cp311-macosx_13_0_arm64.whl (363.7 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

fastgl-0.1.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (268.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fastgl-0.1.12-cp310-cp310-macosx_13_0_x86_64.whl (405.9 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

fastgl-0.1.12-cp310-cp310-macosx_13_0_arm64.whl (362.4 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

Details for the file fastgl-0.1.12.tar.gz.

File metadata

  • Download URL: fastgl-0.1.12.tar.gz
  • Upload date:
  • Size: 91.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fastgl-0.1.12.tar.gz
Algorithm Hash digest
SHA256 7754db91fe799e38283de4bb81026bc930dc3553d2d39f8e1fdef42643f3d43c
MD5 5701e8e458348808243916d2c973a3f7
BLAKE2b-256 c22dd7f7c0cce38bab2465586819dfa8d7525825eec4d7443d7aaf42a1c6a822

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ade2ff00ef7d18a375d60455677e7c93b322263cbbfc388f09a6789a4776972c
MD5 b67a9670433b23bbac7525a24b98487a
BLAKE2b-256 f0d30c33e62a34fc041177fb80eb77bdb178c4270f8174927aaa71526461db2b

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp314-cp314-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp314-cp314-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e30e01e958eda449c78bf7cd6ee6cbb15550db77f404fb0dbb083183fc9a0cf6
MD5 5ec97cbbf839dc3e500b0a56360dbe47
BLAKE2b-256 0353ee9571481a6e8621625172ad7b77fbac7ee79d828471a36c6c85119df9f8

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp314-cp314-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 00f69252eb306f347c7c46dd7cb996a809033bd29ce80432b990498496df02e5
MD5 5d58c966bdba0b53f7e7e055b0b9e68e
BLAKE2b-256 5ba3f2708163508a29e0c2d3da9e37f0e511177e3acf500595bc90c7332f7c5d

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc04cedf7a46436b8fac39a5a0899c68c46080b68cbf3fe7a48bc7818b7c542a
MD5 efbfc0447f2b4dbf97d4bf322bbe3ca7
BLAKE2b-256 9206d671a159ff4b70be0ce8dd48091c263df7ea47cf7bfe2e0a074b5f6a5ea6

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 945faa8cb1bd6aaad1570cc2db9d33bb40e62c5dd9686afa1c1fc91704dbd813
MD5 7d1b595db49c6acf4eaf2a8b244b9325
BLAKE2b-256 8688cc564239e84837e41a312c5b0fff8e44a97b8234804e7666901b817f53b8

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 0bab1c799984a3fe627520b9bf28dd7bd98811f1c6aca4a9685c2706705b9b9d
MD5 fc80385924d59b4b19e1bf029ae5d24e
BLAKE2b-256 6b72fa978c2d7cc60a01ccf5d084b91460fad8dde7b97ce05bb8a3c689b3f937

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c2326144f74151bd0fd09c906b1069b28ad07f084e888a4dc7adee4865d61d62
MD5 2375a6611ab6aa2e3660a6bce3363c7d
BLAKE2b-256 2998857bb8bb13957dceac56ce7425cdfab23d893ea1bf4ca6b19ba5f670d011

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2e42cc010748552322b70a7ce0466527596ab11a4f88d0fcb49825410cd4ebc9
MD5 59cf1a2db0209c5d4d1a7210e16a4e34
BLAKE2b-256 85d9dc08d7379408160ccae81b441061cdcd1781b3965f87b723d0d6f7bdca25

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 27bbea934d4839a8e22d5b256cb31e60c9084086e484366510f4cd0ce97cfab6
MD5 0da9c840e8b928bded70552f8366d099
BLAKE2b-256 36d3644577efb1a466a90149e2707acc175a3c2ded2ff5484ac4e360b6c6364c

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 01e0a3eb41fcdead5a5448acec3c55cf00c42f05b087a76ea1af4e49546f9017
MD5 10550a73be2bd209c5a768349fd9eb0b
BLAKE2b-256 7fa3ea5b4789780a92b6dc50b392d52d1fea5c5f028e4e3f9f74fcd9e05dd0b0

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8ab071da306c788bc6d2a390a53ff9b89d2f941a6e4bc822f4f7db4960daf19d
MD5 01bad8480d562c8cbb39ae86f789f709
BLAKE2b-256 8111cc7eaf4a83a4239d4b8520a65663c9fd3fa87439cb8f2861205e6949cf3e

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ba6bb705b29a494e49af09726d16f35b5a42bc2ffb2dd4b9325b35987f94c99c
MD5 9578d5b8b16ddf12cb61fececaefbb73
BLAKE2b-256 bbf4ce604a707725e2d6da7f0a7a0488ceda9c414b7840e93cf1b608ea21db2a

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bad225e03dc63689413f5d7dc06c49d9a7302a2c3561e0a0e60d90097cb7c1eb
MD5 70e7802489f06ed8c7f30a72e061fff6
BLAKE2b-256 ba84d4298cde50e9cf40e7c6422464333b72591be629e07e0eab2f635f643a57

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 bf1a8fe9f17bcc481fed75195f2a9e488a383fed6eb85bdd37a3110dba99d634
MD5 dfd6d832073c3d69f8588f812569835b
BLAKE2b-256 e77f1fb92b14f0c734626a31d5097c22c4f68371b094cd9c7a47d56635919de1

See more details on using hashes here.

File details

Details for the file fastgl-0.1.12-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.12-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6e6e6d57f412af7ef53a198190e20ad490e4f5f9e1f10d8b6401c7e22cd97eb0
MD5 b33e21b7258fac1b1c7afa6aaded6f65
BLAKE2b-256 e4a7718f2780c7b028a92e808bf8a8d4ea4b8463b96e81f661ea640f628033e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page