JAX-PT
JAX-PT is a rewrite of the FAST-PT codebase to be compatible with JAX's autodifferentiation and JIT compilation tools. This code can be integrated into full JAX data computation pipelines or used on its own. When compiled, the main JAX-PT functions (same as Fast-PT) can see a 5-100x speed increase on Fast-PT 4.0. (depending on the function) For more in depth examples on the features of functionality of Jax-PT, please see examples.
FAST-PT
FAST-PT is a code to calculate quantities in cosmological perturbation theory at 1-loop (including, e.g., corrections to the matter power spectrum). The code utilizes Fourier methods combined with analytic expressions to reduce the computation time to scale as N log N, where N is the number of grid points in the input linear power spectrum.
Installation
Default Installation
pip install jax-pt
Dev Installation:
pip install jax-pt[dev]
GPU Usage
JAX-PT allows for you to specify a device to run your computations on. During init pass 'cpu', 'gpu', or any other jax.Device to the device kwarg:
import jax
import jax.numpy as jnp
from jaxpt import JAXPT
# Check available devices
print("Available devices:", jax.devices())
k = jnp.logspace(-3, 1, 1000)
# Create JAXPT instance (defaults to CPU)
jpt = JAXPT(k, warmup="moderate")
# Specify to use GPU
jpt = JAXPT(k, warmup="moderate", device="gpu")
# Add a different jax Device
devices = jax.devices()
jpt = JAXPT(k, warmup="moderate", device=devices[0]) # or any index from devices list
Please remember to install the correct jax CUDA libraries for your CUDA version. For example:
pip install jax[cuda12]
Metadata
Release files for jax-pt 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jax_pt-1.0.0.tar.gz | 23.0 kB | Without provenance | Details for jax_pt-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jax_pt-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for jax_pt-1.0.0-py3-none-any.whl |
Total release size: 40.9 kB
Release files / jax_pt-1.0.0.tar.gz
| Download URL | jax_pt-1.0.0.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4314eb2e090c1abef06d42a0cc8aebb1feb3081c06dd363e95d729ab730ce1c6
|
|
BLAKE2b-256 checksum How to use checksums |
fa021f882cc85444756ce220e2e501b07a6b46e9fbef1347a1325a8eb5ea3467
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / jax_pt-1.0.0-py3-none-any.whl
| Download URL | jax_pt-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00c731307197359e93cb81733715ebb4a420b9441828152e122fdcb539cb91f3
|
|
BLAKE2b-256 checksum How to use checksums |
bb3e11a6111718d439ad6377f9e383fd8eb6654d456a60b567c423b1bd2785db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for jax-pt 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.