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:
create a new branch
push your changes to that branch
merge or rebase to get in sync with master
submit a pull request on github
If you do not have write access, create a fork of this repository and proceed as described above.
Metadata
Release files for fastgl 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastgl-0.1.12.tar.gz | 91.3 kB | Details |
Built distributions (wheels)
Total release size: 5.3 MB
Release files / fastgl-0.1.12.tar.gz
| Download URL | fastgl-0.1.12.tar.gz |
|---|---|
| Size | 91.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7754db91fe799e38283de4bb81026bc930dc3553d2d39f8e1fdef42643f3d43c
|
|
BLAKE2b-256 checksum How to use checksums |
c22dd7f7c0cce38bab2465586819dfa8d7525825eec4d7443d7aaf42a1c6a822
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgl-0.1.12-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 272.5 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ade2ff00ef7d18a375d60455677e7c93b322263cbbfc388f09a6789a4776972c
|
|
BLAKE2b-256 checksum How to use checksums |
f0d30c33e62a34fc041177fb80eb77bdb178c4270f8174927aaa71526461db2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp314-cp314-macosx_13_0_x86_64.whl
| Download URL | fastgl-0.1.12-cp314-cp314-macosx_13_0_x86_64.whl |
|---|---|
| Size | 409.9 kB |
| Tags | CPython 3.14 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
e30e01e958eda449c78bf7cd6ee6cbb15550db77f404fb0dbb083183fc9a0cf6
|
|
BLAKE2b-256 checksum How to use checksums |
0353ee9571481a6e8621625172ad7b77fbac7ee79d828471a36c6c85119df9f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp314-cp314-macosx_13_0_arm64.whl
| Download URL | fastgl-0.1.12-cp314-cp314-macosx_13_0_arm64.whl |
|---|---|
| Size | 365.8 kB |
| Tags | CPython 3.14 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
00f69252eb306f347c7c46dd7cb996a809033bd29ce80432b990498496df02e5
|
|
BLAKE2b-256 checksum How to use checksums |
5ba3f2708163508a29e0c2d3da9e37f0e511177e3acf500595bc90c7332f7c5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgl-0.1.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 272.2 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cc04cedf7a46436b8fac39a5a0899c68c46080b68cbf3fe7a48bc7818b7c542a
|
|
BLAKE2b-256 checksum How to use checksums |
9206d671a159ff4b70be0ce8dd48091c263df7ea47cf7bfe2e0a074b5f6a5ea6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp313-cp313-macosx_13_0_x86_64.whl
| Download URL | fastgl-0.1.12-cp313-cp313-macosx_13_0_x86_64.whl |
|---|---|
| Size | 409.7 kB |
| Tags | CPython 3.13 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
945faa8cb1bd6aaad1570cc2db9d33bb40e62c5dd9686afa1c1fc91704dbd813
|
|
BLAKE2b-256 checksum How to use checksums |
8688cc564239e84837e41a312c5b0fff8e44a97b8234804e7666901b817f53b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp313-cp313-macosx_13_0_arm64.whl
| Download URL | fastgl-0.1.12-cp313-cp313-macosx_13_0_arm64.whl |
|---|---|
| Size | 365.9 kB |
| Tags | CPython 3.13 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0bab1c799984a3fe627520b9bf28dd7bd98811f1c6aca4a9685c2706705b9b9d
|
|
BLAKE2b-256 checksum How to use checksums |
6b72fa978c2d7cc60a01ccf5d084b91460fad8dde7b97ce05bb8a3c689b3f937
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgl-0.1.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 272.2 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c2326144f74151bd0fd09c906b1069b28ad07f084e888a4dc7adee4865d61d62
|
|
BLAKE2b-256 checksum How to use checksums |
2998857bb8bb13957dceac56ce7425cdfab23d893ea1bf4ca6b19ba5f670d011
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp312-cp312-macosx_13_0_x86_64.whl
| Download URL | fastgl-0.1.12-cp312-cp312-macosx_13_0_x86_64.whl |
|---|---|
| Size | 409.7 kB |
| Tags | CPython 3.12 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
2e42cc010748552322b70a7ce0466527596ab11a4f88d0fcb49825410cd4ebc9
|
|
BLAKE2b-256 checksum How to use checksums |
85d9dc08d7379408160ccae81b441061cdcd1781b3965f87b723d0d6f7bdca25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp312-cp312-macosx_13_0_arm64.whl
| Download URL | fastgl-0.1.12-cp312-cp312-macosx_13_0_arm64.whl |
|---|---|
| Size | 365.8 kB |
| Tags | CPython 3.12 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
27bbea934d4839a8e22d5b256cb31e60c9084086e484366510f4cd0ce97cfab6
|
|
BLAKE2b-256 checksum How to use checksums |
36d3644577efb1a466a90149e2707acc175a3c2ded2ff5484ac4e360b6c6364c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgl-0.1.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 269.9 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
01e0a3eb41fcdead5a5448acec3c55cf00c42f05b087a76ea1af4e49546f9017
|
|
BLAKE2b-256 checksum How to use checksums |
7fa3ea5b4789780a92b6dc50b392d52d1fea5c5f028e4e3f9f74fcd9e05dd0b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp311-cp311-macosx_13_0_x86_64.whl
| Download URL | fastgl-0.1.12-cp311-cp311-macosx_13_0_x86_64.whl |
|---|---|
| Size | 407.2 kB |
| Tags | CPython 3.11 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
8ab071da306c788bc6d2a390a53ff9b89d2f941a6e4bc822f4f7db4960daf19d
|
|
BLAKE2b-256 checksum How to use checksums |
8111cc7eaf4a83a4239d4b8520a65663c9fd3fa87439cb8f2861205e6949cf3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp311-cp311-macosx_13_0_arm64.whl
| Download URL | fastgl-0.1.12-cp311-cp311-macosx_13_0_arm64.whl |
|---|---|
| Size | 363.7 kB |
| Tags | CPython 3.11 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ba6bb705b29a494e49af09726d16f35b5a42bc2ffb2dd4b9325b35987f94c99c
|
|
BLAKE2b-256 checksum How to use checksums |
bbf4ce604a707725e2d6da7f0a7a0488ceda9c414b7840e93cf1b608ea21db2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgl-0.1.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 268.3 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bad225e03dc63689413f5d7dc06c49d9a7302a2c3561e0a0e60d90097cb7c1eb
|
|
BLAKE2b-256 checksum How to use checksums |
ba84d4298cde50e9cf40e7c6422464333b72591be629e07e0eab2f635f643a57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp310-cp310-macosx_13_0_x86_64.whl
| Download URL | fastgl-0.1.12-cp310-cp310-macosx_13_0_x86_64.whl |
|---|---|
| Size | 405.9 kB |
| Tags | CPython 3.10 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
bf1a8fe9f17bcc481fed75195f2a9e488a383fed6eb85bdd37a3110dba99d634
|
|
BLAKE2b-256 checksum How to use checksums |
e77f1fb92b14f0c734626a31d5097c22c4f68371b094cd9c7a47d56635919de1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fastgl-0.1.12-cp310-cp310-macosx_13_0_arm64.whl
| Download URL | fastgl-0.1.12-cp310-cp310-macosx_13_0_arm64.whl |
|---|---|
| Size | 362.4 kB |
| Tags | CPython 3.10 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e6e6d57f412af7ef53a198190e20ad490e4f5f9e1f10d8b6401c7e22cd97eb0
|
|
BLAKE2b-256 checksum How to use checksums |
e4a7718f2780c7b028a92e808bf8a8d4ea4b8463b96e81f661ea640f628033e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|