Healpix JAX implementation.
Project description
jax-healpy
jax-healpy: A JAX-based implementation of HEALPix functions for high-performance scientific computing.
This project provides a comprehensive JAX-native implementation of HEALPix (Hierarchical Equal Area isoLatitude Pixelization) functions, designed for modern scientific computing with GPU acceleration, automatic differentiation, and seamless integration with machine learning workflows.
⚠️ WARNING: BETA STAGE - This project is in active development. APIs may change and some features are still under development.
Key Features
- 🚀 GPU Acceleration: Leverage JAX's XLA compilation for high-performance computing on CPUs and GPUs
- 🔄 Automatic Differentiation: Full support for forward and reverse-mode automatic differentiation
- 📊 Vectorized Operations: Efficient batch processing of HEALPix operations
- 🔧 HEALPix Compatibility: Drop-in replacement for many healpy functions
- 🌐 Spherical Harmonics: Integration with s2fft for spherical harmonic transforms
- 🎯 Clustering Tools: Advanced clustering algorithms for astronomical data analysis
Installation
Prerequisites
First, install JAX following the official documentation for your target architecture (CPU/GPU).
Install jax-healpy
Install via PyPI:
pip install jax-healpy
For spherical harmonics functionality, install with recommended dependencies:
pip install jax-healpy[recommended]
Development Installation
Clone the repository and install in editable mode:
git clone https://github.com/pchanial/jax-healpy.git
cd jax-healpy
pip install -e .
Quick Start
import jax.numpy as jnp
import jax_healpy as hp
# Create a HEALPix map
nside = 64
npix = hp.nside2npix(nside)
# Convert pixel indices to sky coordinates
pixels = jnp.arange(npix)
theta, phi = hp.pix2ang(nside, pixels)
# Convert sky coordinates back to pixels
recovered_pixels = hp.ang2pix(nside, theta, phi, nest=False)
# Spherical harmonics transform (requires s2fft)
alm = hp.map2alm(skymap, lmax=128)
reconstructed_map = hp.alm2map(alm, nside=nside)
Performance Benchmarks
Execution time measured on high-performance computing systems:
Test System:
- CPU: Intel(R) Xeon(R) Gold 2648 @ 2.50GHz
- GPU: NVIDIA Tesla V100-SXM2-16GB
jax-healpy demonstrates significant performance improvements, especially for GPU-accelerated workloads and batch operations.
Documentation
Complete documentation is available at jax-healpy.readthedocs.io
Development
Setting up Development Environment
Install development dependencies:
pip install -e .[test]
Running Tests
Execute the test suite:
pytest
Code Quality
This project uses pre-commit hooks for code quality:
pip install pre-commit
pre-commit install
High-Performance Computing
Environment Setup
For HPC systems, load required modules:
module load python/3.10
python -m venv venv
source venv/bin/activate
pip install jax-healpy
GPU Support
Ensure JAX is properly configured for your GPU architecture. See the JAX GPU installation guide for details.
Contributing
We welcome contributions! Please see our Contributing Guide for details on:
- Setting up the development environment
- Code style and testing requirements
- Submitting pull requests
- Reporting issues
Citation
If you use jax-healpy in your research, please cite:
@software{jax_healpy,
author = {Chanial, Pierre and Biquard, Simon and Kabalan, Wassim},
title = {jax-healpy: JAX-based HEALPix implementation},
url = {https://github.com/pchanial/jax-healpy},
year = {2024}
}
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Acknowledgments
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
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 jax_healpy-0.5.tar.gz.
File metadata
- Download URL: jax_healpy-0.5.tar.gz
- Upload date:
- Size: 201.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
908807069aa72caaabb5f1e4b776fdf263ad2083a10d0d77036ca3cdb63e97c0
|
|
| MD5 |
f60564be022a708e9478e5c6b93ffdbd
|
|
| BLAKE2b-256 |
c270375f87f66da059bdf445c77cda54158350b4e3d50aaacd143b84c6ddad6c
|
Provenance
The following attestation bundles were made for jax_healpy-0.5.tar.gz:
Publisher:
release.yml on CMBSciPol/jax-healpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_healpy-0.5.tar.gz -
Subject digest:
908807069aa72caaabb5f1e4b776fdf263ad2083a10d0d77036ca3cdb63e97c0 - Sigstore transparency entry: 564166989
- Sigstore integration time:
-
Permalink:
CMBSciPol/jax-healpy@9fb7d711447487c320abc44125af3463ea45fe6a -
Branch / Tag:
refs/tags/v0.5 - Owner: https://github.com/CMBSciPol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fb7d711447487c320abc44125af3463ea45fe6a -
Trigger Event:
release
-
Statement type:
File details
Details for the file jax_healpy-0.5-py3-none-any.whl.
File metadata
- Download URL: jax_healpy-0.5-py3-none-any.whl
- Upload date:
- Size: 73.7 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 |
e00bd98e16904d2d3b36044b537ab06b27f1c1586542bd33393070668ef65d0b
|
|
| MD5 |
b9a158bb75eb57f82bb8025398ffcf31
|
|
| BLAKE2b-256 |
9068d983e1ff6af51858d9b4babdd77e6f69fc4f63af59496648cfbb6ddac56e
|
Provenance
The following attestation bundles were made for jax_healpy-0.5-py3-none-any.whl:
Publisher:
release.yml on CMBSciPol/jax-healpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_healpy-0.5-py3-none-any.whl -
Subject digest:
e00bd98e16904d2d3b36044b537ab06b27f1c1586542bd33393070668ef65d0b - Sigstore transparency entry: 564166996
- Sigstore integration time:
-
Permalink:
CMBSciPol/jax-healpy@9fb7d711447487c320abc44125af3463ea45fe6a -
Branch / Tag:
refs/tags/v0.5 - Owner: https://github.com/CMBSciPol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fb7d711447487c320abc44125af3463ea45fe6a -
Trigger Event:
release
-
Statement type: