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.11.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.11-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.11-cp313-cp313-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

fastgl-0.1.11-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.11-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.11-cp313-cp313-macosx_13_0_x86_64.whl (128.5 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

fastgl-0.1.11-cp313-cp313-macosx_13_0_arm64.whl (126.3 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

fastgl-0.1.11-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.11-cp312-cp312-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

fastgl-0.1.11-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.11-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.11-cp312-cp312-macosx_13_0_x86_64.whl (128.4 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

fastgl-0.1.11-cp312-cp312-macosx_13_0_arm64.whl (126.3 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

fastgl-0.1.11-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.11-cp311-cp311-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

fastgl-0.1.11-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.11-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.11-cp311-cp311-macosx_13_0_x86_64.whl (128.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

fastgl-0.1.11-cp311-cp311-macosx_13_0_arm64.whl (126.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

fastgl-0.1.11-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.11-cp310-cp310-musllinux_1_2_i686.whl (1.4 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

fastgl-0.1.11-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.11-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (243.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

fastgl-0.1.11-cp310-cp310-macosx_13_0_x86_64.whl (127.7 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

fastgl-0.1.11-cp310-cp310-macosx_13_0_arm64.whl (125.7 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: fastgl-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 0b8b248c17fe36f70143834f4ffd2a36fe6d3a22360749db92d0e8b2d34b18cf
MD5 d414301adcce136b03d716edd92fe01e
BLAKE2b-256 209ae4fd95ca7eeaa00b99ff8e530a40500ac1746473049aa9307f55aa2f307c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c5189a755d6493c041b5ef1c6a12273998eba75d00875cd6a243b54f00718eee
MD5 4ccf58edfb18ddbafcf0c8bbba928335
BLAKE2b-256 28ae6441ca09f7f4571f3b372031ebc446eb3d609714e7bd28d332dc59232af2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 5f519bdc2ed8cdb706ac4f90a0699b41ce2105a4448ce1ad0745b90cc3aef56f
MD5 5d6b1054e393ae2e7bfc835bed4ec378
BLAKE2b-256 c3a8bf2b29ddaa5655ba6557874c774a2e413c8955803a3d48cd1be1b18122b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 159f1d10246a7f4776491531a1c659ec8de939a95c7ec31796bf9963d0b2ec46
MD5 eb3123cb325fa1541556d71b8b126f34
BLAKE2b-256 427c1f9828c21599f2dbcf11c5f2dc211f428b292ac6b2247d95b0881ee0cbd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 feac23acded43fe919ba4fbf4824254845a6e9d034a3f2f51e03f11c347e5138
MD5 1e69d11e9de0f00d9cb246a15802bdd7
BLAKE2b-256 d511076fab405b801708bbe15ed62262b5040962c677452a0ded4b0425c77b71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 865f07f52dc912c77b2b256ef9bf86bdf9a976dc1631603ad03133ff2d902e1d
MD5 75eb1f51d644a47bc693c6d2ac68d8e4
BLAKE2b-256 b9557576abfe0f633b60e6e6b949530d00ce0cdb725d5cbae87713dccf543461

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 3100bf9a80af502cf102fe5635f56c9ea167b3ed06292620f1ee878f0fb45814
MD5 5c079245a5f25da21e9c71103b05249a
BLAKE2b-256 36926705560a03cf604dfdf7b81d9e45210bc715777a175afc9871d14166ea5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4364cb80b095c1f8eb0fcdfe004514cb6ae05ae933aace756d21f8dce7a4cc11
MD5 6ca2e9048e0bd5bf54dd24b49b23333a
BLAKE2b-256 d7f41317de3ccd539dba8e4c49ac9632464819fee2a06a7d4fca18ad006971a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 6be24d2324f4e3e8d198a2e5ccfaf4cfa744ef791ebaa08d5875ffe5d5578d4b
MD5 ef4bbee0a83a81c7da141aac01576a95
BLAKE2b-256 9ae5283adea402c10cb98126072e0e10efa47da5ce1180b46d73b7c5583ebdf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a60b7a536daaa919878d674238c4b0785c2e835c6463e874aed36aa89b1061c
MD5 0f99a07ec0ab29f34573910f4ea28878
BLAKE2b-256 58aaf2fdc7046d6c17ec4ae01ed71c3183f282a54179c112a952fd7da35a2c2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c9039044979c3b17b6af2768732c6efde21df2ea85d9df467ecb263275cf2a7b
MD5 bd5a3b71d4426c0dd5e9f27d8ec7d6b9
BLAKE2b-256 25d4ebe9b1adc11710583a4cf060a83ab2bb780c868fb83b999f170664e8c3bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ca4d3c7ec4a75b1f4fc4beca92ceb8e9d629469a7dd6c355cc674e4ddf685fd3
MD5 b8d0807a1797736d196bd5b3747b5d2d
BLAKE2b-256 b567eec4e87b1b10c41630b320689f629d4bdbc33c7e2023316920afa2fa7d41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 f311bc6473f12fba730e329e0229fd634b6954a1dc0d88d2358bcf17a28519e2
MD5 3776367da70750641b12f31eda5f9ab3
BLAKE2b-256 5317a7875a8e7b86e2f9e162203911d777359d2512b0997ff81cf4c1e1996c8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cfc210a0fcc2df52317c6ae4d14f168aaeff33cf9e2cdabaa047b384e8d886bc
MD5 ff98884b8a425c2afced086326ae2f5f
BLAKE2b-256 6861414fc42f9cde4aa21c0daf07b8a4685a5fd1ef0d6b8cea1e2e2f1edf4607

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 cb977113eb8b9d714b554d8d0ffb83811025db54ffe7227c5e8ea96bdf24c3ae
MD5 8c28b33712e669eab699677b9728ca34
BLAKE2b-256 d7022ffa797c1155c414025e66daefec00385a5ed6e0a192657a6ddb853ef796

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 316e3e0a39a3025d155928d3f606eeccbe8f1066e8a3cf07543718e73493da3c
MD5 72f17d789987cbe951827ba4ee298c1c
BLAKE2b-256 17eaf62637286a67a650a355b3bb0eadd8073099621019f82c3b807396fbe2aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 347a9a17afd651b9efb97de55b6215daec42d9e20c7686e847416ddef3a12a8f
MD5 80587f50c01052465d6ee4f0fa9a4d01
BLAKE2b-256 b62d81a85d36eb25d7ce72b7aed8bdbfe976b1acafa88d0ed7417eb6f12f5e24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4bde6a8fca419381af489c7531c1bcba98b77579aa2a30edaa9574ed472f2ece
MD5 d87cf280da2bd8732ae6d73fb9a4aea5
BLAKE2b-256 3264f4f23866ba7007e7e53c522aeee18475f15e70d97e00b669384ef7c7e169

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a831030facf55278550282ac5d4207cc8a7933c0dfc4f2d08dc56bca8d2bd100
MD5 ae2ba482381dd77780d40dee5fae0540
BLAKE2b-256 3d89fdd143c2bd3940a4a5d18a96ed6102d3d2f653a279bf3c4ef13ffe81fe42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 49d8c9e4a1ac285fd55506dd0f7ceb2b4fbd125d823d73a0c514f0ff24e9b1a1
MD5 87883fe1e7cf77e9127d30650d6f3245
BLAKE2b-256 bc7a420356855bfb5800b82f69aef14ba6173dcd3be9460a66f9652fb670f6ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 aeea145ef3abe8f19b472d04b15e0fc361bcb24f7bcb0e74ea1a1e9612a97392
MD5 98462670fe6050c14877fb018b251b22
BLAKE2b-256 ba57f8967776f560076a851072c007efc51d3b3a36394d729493963bdf818c2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71fa1c138ae546a217faa2aabb3ff46962a3e310a66c41e6738ac0dba70fe6bd
MD5 bb2a2f80a58edb0b4dd6451c8cb8f603
BLAKE2b-256 f38aa56d81b0b7adc31b988a93574bcd0efbc623f853d03b599abcbab194eb77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 0acac5c6e4b64a8bb39af73b82fca2185f2825261d0929e379cd050e224f78d8
MD5 631af03257467469c88935ba7cbefbc4
BLAKE2b-256 ff4da16b35d183327c9e9d7543283e4096692eef44e97f7388ca203eac4a9d86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 928fb89675ca1cc95ba7ecb2da70dc10f6d54c99e5a8cea1dc53dc64377e1f00
MD5 142b2c9c1e56593220e545c5f133a70b
BLAKE2b-256 bb21a43e3c390b76992673ccda81f08161bd303b121880bb8ba55ed42c520c11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastgl-0.1.11-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 011d6c109f97f9cd59271a9193e11890a89c352aa6ae9eff8b13cd2febb77920
MD5 5313a0601c505d1a5c351fcea57bf579
BLAKE2b-256 00bd84b95b4ff1b1b6c563756497154c4b9bd2dc55a0d11adfe3473345a2b8fe

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