Compute Jacobi polynomial from order 0 to N efficiently in NumPy / PyTorch / JAX / array API
Project description
Jacobi Poly
Documentation: https://jacobi-poly.readthedocs.io
Source Code: https://github.com/34j/jacobi-poly
Compute Jacobi polynomial from order 0 to N efficiently in NumPy / PyTorch / JAX / array API
Installation
Install this via pip (or your favourite package manager):
pip install jacobi-poly
Usage
from jacobi_poly import jacobi_all, gegenbauer_all, legendre_all
import torch
# Both CPU (Numba) and CUDA (Numba for CUDA) are supported.
torch.set_default_device("cuda")
x = torch.asarray(1.0) # the points to evaluate at
alpha = torch.asarray(2.0)
beta = torch.asarray(3.0)
n_end = 4 # from order 0 to order 3
# Jacobi polynomial from order 0 to 3
jacobi = jacobi_all(x, alpha=alpha, beta=beta, n_end=n_end)
print(jacobi)
# tensor([ 1., 3., 6., 10.], device='cuda:0')
# Gegenbauer polynomial from order 0 to 3
gegenbauer = gegenbauer_all(x, alpha=alpha, n_end=n_end)
print(gegenbauer)
# tensor([ 1.0000, 4.0000, 10.0000, 20.0000], device='cuda:0')
# Generalized Legendre polynomial from order 0 to 3
# If ndim == 3, same as Legendre polynomial
legendre = legendre_all(x, n_end=n_end, ndim=3)
print(legendre)
# tensor([1., 1., 1., 1.], device='cuda:0')
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jacobi_poly-1.0.6.tar.gz.
File metadata
- Download URL: jacobi_poly-1.0.6.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c85e615a220c7f9ad8769f7ae6ffde9267d03a573bd3be6f2e747e61481f9af
|
|
| MD5 |
74a63be5f76f8b3c4c893091d233004f
|
|
| BLAKE2b-256 |
f45339d1ee12c08a3ccd426401ba1cd9dfd7f47c85d4c73c5fc6f4c86ef02fac
|
Provenance
The following attestation bundles were made for jacobi_poly-1.0.6.tar.gz:
Publisher:
ci.yml on 34j/jacobi-poly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jacobi_poly-1.0.6.tar.gz -
Subject digest:
9c85e615a220c7f9ad8769f7ae6ffde9267d03a573bd3be6f2e747e61481f9af - Sigstore transparency entry: 790195595
- Sigstore integration time:
-
Permalink:
34j/jacobi-poly@a7fad9a617396f1980ee61146b9d8607e875e895 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/34j
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a7fad9a617396f1980ee61146b9d8607e875e895 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jacobi_poly-1.0.6-py3-none-any.whl.
File metadata
- Download URL: jacobi_poly-1.0.6-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afc24c89e6c7cc5d52cbd54b3f6b3de0a7ddd4cb66bd56190db22b20c2355cf4
|
|
| MD5 |
968e9f1b28f7fc3df349632f7078d5b2
|
|
| BLAKE2b-256 |
944a7eb8bd7466947029a57a8dcdad5a5f25e2fd5726e9e96876d06ec5a2fa59
|
Provenance
The following attestation bundles were made for jacobi_poly-1.0.6-py3-none-any.whl:
Publisher:
ci.yml on 34j/jacobi-poly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jacobi_poly-1.0.6-py3-none-any.whl -
Subject digest:
afc24c89e6c7cc5d52cbd54b3f6b3de0a7ddd4cb66bd56190db22b20c2355cf4 - Sigstore transparency entry: 790195600
- Sigstore integration time:
-
Permalink:
34j/jacobi-poly@a7fad9a617396f1980ee61146b9d8607e875e895 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/34j
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a7fad9a617396f1980ee61146b9d8607e875e895 -
Trigger Event:
push
-
Statement type: