Some elliptic integrals in JAX
Project description
jaxellip: JAX implementations of some elliptic integrals
Elliptic integrals are available in scipy.special, but are not implemented in jax.scipy.special, making them neither differentiable nor compatible with JAX’s JIT compilation. This package provides JAX-compatible implementations of several elliptic integrals from scipy.special: ellipk, ellipkm1, and ellipe. The results have been tested against scipy.special to ensure accuracy and performance (see tests).
Usage
- Install
jaxellip.
pip install jaxellip
- Import
jaxellipin your Python code and use it.
import jaxellip
jaxellip.ellipk(0.5) # Complete elliptic integral of the first kind
jaxellip.ellipkm1(0.5) # Complete elliptic integral of the first kind around m = 1
jaxellip.ellipe(0.5) # Complete elliptic integral of the second kind
Elliptic integrals
The elliptic integrals in jaxellip follow the same parameter conventions as scipy.special. In particular, the input parameter $m$ is the elliptic parameter, defined as $m = k^2$, where $k$ is the modulus. This differs from some literature or libraries (e.g., Boost or Abramowitz & Stegun), where the integrals are sometimes expressed in terms of $k$ directly.
The function ellipkm1(m) computes the complete elliptic integral of the first kind with argument $1 - m$, i.e., $K(1 - m)$. This is particularly useful for improved numerical stability and precision when $m$ is close to 1, since $K(m)$ diverges logarithmically as $m \to 1$.
Complete elliptic integral of the first kind
$$ K(m) = \int_0^{\pi/2} \frac{1}{\sqrt{1 - m \sin^2 \theta}} d\theta $$
Complete elliptic integral of the second kind
$$ E(m) = \int_0^{\pi/2} \sqrt{1 - m \sin^2 \theta} d\theta $$
Complete elliptic integral of the third kind
$$ \Pi(n, m) = \int_0^{\pi/2} \frac{1}{(1 - n \sin^2 \theta) \sqrt{1 - m \sin^2 \theta}} d\theta $$
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 jaxellip-0.0.1.tar.gz.
File metadata
- Download URL: jaxellip-0.0.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3d1ef022a8a7bec2d39c8112c9e8d4c4c56aaac498022e81fd635705664e3f8
|
|
| MD5 |
2aa40a83657e234098fcb6280465db89
|
|
| BLAKE2b-256 |
ae83a13a459ac06e7cab4cca8571fa4b1d22074b18fb35e60fab962203c09cc3
|
Provenance
The following attestation bundles were made for jaxellip-0.0.1.tar.gz:
Publisher:
publish-a-release.yaml on sinaatalay/jaxellip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jaxellip-0.0.1.tar.gz -
Subject digest:
e3d1ef022a8a7bec2d39c8112c9e8d4c4c56aaac498022e81fd635705664e3f8 - Sigstore transparency entry: 198392564
- Sigstore integration time:
-
Permalink:
sinaatalay/jaxellip@554a5b4ed24144db68db959517c49f2257db71da -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/sinaatalay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-a-release.yaml@554a5b4ed24144db68db959517c49f2257db71da -
Trigger Event:
release
-
Statement type:
File details
Details for the file jaxellip-0.0.1-py3-none-any.whl.
File metadata
- Download URL: jaxellip-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d6c3b50f16acf9d6a9f9d09f4d9a16379ff31e5548bd7e05646d7df0a5c66ed
|
|
| MD5 |
ae3e67b08675e71d948fb42a4d9d2f5b
|
|
| BLAKE2b-256 |
3ca65365930d96cdd716a89a9fd1705970f2ced662d95fff736db135d776a8f2
|
Provenance
The following attestation bundles were made for jaxellip-0.0.1-py3-none-any.whl:
Publisher:
publish-a-release.yaml on sinaatalay/jaxellip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jaxellip-0.0.1-py3-none-any.whl -
Subject digest:
2d6c3b50f16acf9d6a9f9d09f4d9a16379ff31e5548bd7e05646d7df0a5c66ed - Sigstore transparency entry: 198392566
- Sigstore integration time:
-
Permalink:
sinaatalay/jaxellip@554a5b4ed24144db68db959517c49f2257db71da -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/sinaatalay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-a-release.yaml@554a5b4ed24144db68db959517c49f2257db71da -
Trigger Event:
release
-
Statement type: