Skip to main content

Python bindings for the Fast Gauss-Legendre (FastGL) algorithm

Project description

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.

>>> from fastgl import roots_legendre
>>> N = 100
>>> mu, w_mu = roots_legendre(N) # FastGL calculation
>>> mu, w_mu = 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.

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

fastgl-0.1.10.tar.gz (89.2 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.10-cp313-cp313-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

fastgl-0.1.10-cp313-cp313-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

fastgl-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

fastgl-0.1.10-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (243.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

fastgl-0.1.10-cp312-cp312-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

fastgl-0.1.10-cp312-cp312-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

fastgl-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

fastgl-0.1.10-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (243.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

fastgl-0.1.10-cp311-cp311-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

fastgl-0.1.10-cp311-cp311-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

fastgl-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

fastgl-0.1.10-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (243.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

fastgl-0.1.10-cp310-cp310-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

fastgl-0.1.10-cp310-cp310-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

fastgl-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (234.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

fastgl-0.1.10-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (243.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

File details

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

File metadata

  • Download URL: fastgl-0.1.10.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastgl-0.1.10.tar.gz
Algorithm Hash digest
SHA256 745bb466fb3a404635ad50d4ae6c8bcb87217e2e409edd12112802c9af6b18ff
MD5 f542ac222a77a6b5627cf3241dd5438d
BLAKE2b-256 f0435ecc7acca1bcb9dba2f536ea22ee31043d420e12b8986b469e0fcc78d878

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 05a56a8fb492c0291087dbb38b7baf9a38231322bf80462457f890b0608be013
MD5 6c7ecd0624c6a9c64eb9d6ea1b85d31d
BLAKE2b-256 0ff46da945b499445fa376a9eb37d4ee5a7a04d2fec3a145a90bcccd7f22c07b

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 a56db6d65fa81186a6b2c18664e47be4f280bfd08511fcfdce211f4afc28ebe5
MD5 00c5a7c63ef61569c20d50dd72cd6746
BLAKE2b-256 6e04c997360bb4cbb9c180395e16254f4a3ed9de7dae58b2de4feed3396220ab

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f81bdb8e0132eb4b6b22dd558457d5dde4eea7bcc1f91598617c7324bb8f6252
MD5 a3de1dc4262779cf6e816cd2b8f874d1
BLAKE2b-256 ed7d023370c78f62444c818e79774e7e831ddec156289793644323a80b83cf2c

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 219b8a602ed6003b262809f0144011d6024443a3f1edb82aede182fe83676cf1
MD5 936b2d1c5f83be20206746b9906aed04
BLAKE2b-256 662533d812a798433dbe25734860c45b25eb5e84802eb759b0006a90f1899477

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f354edb6a6e25d183a375cce7e50c35cb18a4a3a493635a2c553fe3a14733138
MD5 7223f92cbf61a39e676b7fb75435f843
BLAKE2b-256 3b5849bdac4b99c39e9cbcb7c1eca62966b90a60b2a2361ab77edc1af46ea1c5

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 8a4841af290d9c420094689f5b0da3aced251c9e36136a59198e0a5063915573
MD5 eff3a0d8264d187743e44a952dbb16b6
BLAKE2b-256 14faeab421fd343b9e45cd2b97ea0b638e4cd7ce370057ecacc4f5f576e2e58e

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0aa56fc075d64c318aa71fc11aa513e17e4cb636a2f8cd0965b565ff3951205e
MD5 7ca6888f460b17dc021539b9f85a7c7a
BLAKE2b-256 a318bcbf6799b626e6baf1e4f3376a30345af8b9e9fb80bba679449dceeb68e9

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a332338bbc9d6cb07fd67a5d28b23a637270ba7b3891043cb50c077f75158ff4
MD5 46ccddee99536a03b0835ec2b11993db
BLAKE2b-256 fd906596aa97348caa5afbe9c15a25d79622b4ae26ef2a827258db7da9dc3c27

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 da6c8e7173dfe2d64ca1b5552e67643b236a86f22b548dd6b19ecc91f60efb41
MD5 e416930c09ae8d7df439d735f3bcb102
BLAKE2b-256 373d5f77121a9368cadf3e0931265949d651733511e07ef6d51298fbfeedba96

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 6c425b06b64bdb6d0108545433fbb02721fc5d2bf8a2e65a80bffe20b05fcd3e
MD5 64b79323b4aef70cef8c666ef2343597
BLAKE2b-256 d752be99d39f13591fcb4fd518e2e32a29f4b58931977fd009bfcec4847a33bd

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 167eac6297443d5858794016cbb29fe39c47e57f0a0ec49d412915cda2848b26
MD5 9db2e20ad9a8658e2ecdce84212ba469
BLAKE2b-256 b0cc114ad6bb08de7e9408d4df147df62d63de6f12664261788d2ca1c2f1a67a

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7b1977cab1993e407a06beba245b486c47f2da31afb434db1d2423baf0f237e7
MD5 b0240eeadf7c98b02e35f6bec14cf913
BLAKE2b-256 b3e42359e1475b0fea66454904c40bf4c9fa7c33329eb752383e0142435106ff

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ab0a8f8bce83e6af141a32c2e54d090de69cd04b97bdc8fd2feea25e11475e13
MD5 7a9735b0c9c21ea8496e144d9f224c8c
BLAKE2b-256 df7327d5f9f1b9122baad44a3015afa8c9517cc19476b166a1a803cb0e35d043

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp310-cp310-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2eba5a64313038ede99ddbb00149906bd80859e53b3a77910b9e9100872f4782
MD5 bb333f5a532fbfe647ff3256c8c5d64d
BLAKE2b-256 0192c686b59a7bb0184732c0de47e1d5dfcbc6d6bcafd7f8f2fcd0352aef5acf

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81997ead9ec76f84ad427a595cf422d61b1cc60abbceb48b54cddb10b316790f
MD5 9d103b1d88ee8779d002ccf6c25e2e95
BLAKE2b-256 842423ac29aee027f139568052d26d368562a3cc217f3e007a9f982a2875475c

See more details on using hashes here.

File details

Details for the file fastgl-0.1.10-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastgl-0.1.10-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 36ee17bb19abc13a5af5cb738d61845a5c8b647f4367b0bbb98f59faa25d0655
MD5 28879ed66e62c52518e7744ad3db40af
BLAKE2b-256 0c829c94af692dec37fc0b82b6288a21e5390375dbf889329db4adfe03e58323

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 Pingdom Monitoring Sentry Error logging StatusPage Status page