JAX-native Riemannian manifold optimization
Project description
🔷 PolytopAX
GPU-accelerated differentiable convex hull computation powered by JAX
PolytopAX brings modern computational geometry to the JAX ecosystem, enabling differentiable convex hull computation with GPU acceleration and automatic differentiation for machine learning applications.
✨ Key Features
- 🚀 GPU-Accelerated: Leverage JAX/XLA for high-performance computation
- 🔄 Differentiable: Full compatibility with JAX transformations (
jit,grad,vmap) - 🎯 ML-Ready: Seamless integration into machine learning pipelines
- 📦 Easy to Use: Both functional and object-oriented APIs
- 🔬 Research-Grade: Built for computational geometry research and applications
🚀 Quick Start
Installation
pip install polytopax
Basic Usage
import jax.numpy as jnp
import polytopax as ptx
# Generate random points
points = jax.random.normal(jax.random.PRNGKey(0), (100, 3))
# Compute convex hull
hull_vertices = ptx.convex_hull(points)
print(f"Hull has {len(hull_vertices)} vertices")
# Object-oriented API
hull = ptx.ConvexHull.from_points(points)
print(f"Volume: {hull.volume():.4f}")
print(f"Surface area: {hull.surface_area():.4f}")
# Check point containment
test_point = jnp.array([0.0, 0.0, 0.0])
is_inside = hull.contains(test_point)
Differentiable Optimization
import jax
# Differentiable volume computation
def volume_loss(points):
hull = ptx.ConvexHull.from_points(points)
return -hull.volume() # Maximize volume
# Compute gradients
grad_fn = jax.grad(volume_loss)
gradients = grad_fn(points)
# Batch processing with vmap
batch_points = jnp.stack([points, points + 0.1])
batch_volumes = jax.vmap(lambda p: ptx.ConvexHull.from_points(p).volume())(batch_points)
🔧 API Overview
Core Functions
convex_hull(points)- Compute convex hull verticespoint_in_convex_hull(point, vertices)- Point containment testconvex_hull_volume(vertices)- Volume computationconvex_hull_surface_area(vertices)- Surface area computation
ConvexHull Class
ConvexHull.from_points(points)- Create from point cloud.volume()- Compute volume.surface_area()- Compute surface area.contains(point)- Test point containment.centroid()- Compute centroid
🎯 Use Cases
- Robotics: Path planning and obstacle avoidance
- Machine Learning: Constraint optimization and geometric deep learning
- Computer Graphics: Collision detection and rendering
- Computational Physics: Molecular dynamics and simulations
- Finance: Risk management and portfolio optimization
🏗️ Why PolytopAX?
| Feature | PolytopAX | SciPy | Qhull |
|---|---|---|---|
| GPU Acceleration | ✅ | ❌ | ❌ |
| Differentiable | ✅ | ❌ | ❌ |
| JAX Integration | ✅ | ❌ | ❌ |
| Batch Processing | ✅ | ❌ | ❌ |
| ML Pipeline Ready | ✅ | ❌ | ❌ |
📖 Documentation
🔬 Examples
Explore comprehensive examples in the examples/ directory:
🛣️ Roadmap
- v0.1.0 ✅ Core differentiable convex hull algorithms
- v0.5.0 🔄 Exact algorithms (Quickhull, incremental)
- v0.8.0 📋 Advanced operations (intersections, Minkowski sums)
- v1.0.0 🎯 Riemannian manifold integration (→ GeomAX)
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines and Development Setup.
📄 License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
🔗 Links
- Documentation: polytopax.readthedocs.io (coming soon)
- PyPI: pypi.org/project/polytopax (coming soon)
- Issues: GitHub Issues
Built with ❤️ for the JAX and computational geometry communities
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 polytopax-0.0.1.tar.gz.
File metadata
- Download URL: polytopax-0.0.1.tar.gz
- Upload date:
- Size: 83.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a95f2de5d658d2037be4e2f960804f6329377d8598f7c30fff279d70d925a2fa
|
|
| MD5 |
77911684ecd100a34089a905ecd7565d
|
|
| BLAKE2b-256 |
b25abb7f6dfea780415c10136f7dfbe74630591a6587cba4f198b12e68a72310
|
Provenance
The following attestation bundles were made for polytopax-0.0.1.tar.gz:
Publisher:
release.yml on lv416e/polytopax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polytopax-0.0.1.tar.gz -
Subject digest:
a95f2de5d658d2037be4e2f960804f6329377d8598f7c30fff279d70d925a2fa - Sigstore transparency entry: 264413906
- Sigstore integration time:
-
Permalink:
lv416e/polytopax@d76644603f0f9f15a246b4f4af87c2ba4293ec49 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/lv416e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d76644603f0f9f15a246b4f4af87c2ba4293ec49 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polytopax-0.0.1-py3-none-any.whl.
File metadata
- Download URL: polytopax-0.0.1-py3-none-any.whl
- Upload date:
- Size: 102.3 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 |
3b0f04a9dcf96743a63e8cabd549cee3a8b60c19320431acdd647581c0f03078
|
|
| MD5 |
91807614cde3bf26526b09a7319298c0
|
|
| BLAKE2b-256 |
05cbc099d1237ac12068cd58db67615788bcd9872fc67d6667dd93e01118c831
|
Provenance
The following attestation bundles were made for polytopax-0.0.1-py3-none-any.whl:
Publisher:
release.yml on lv416e/polytopax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polytopax-0.0.1-py3-none-any.whl -
Subject digest:
3b0f04a9dcf96743a63e8cabd549cee3a8b60c19320431acdd647581c0f03078 - Sigstore transparency entry: 264413908
- Sigstore integration time:
-
Permalink:
lv416e/polytopax@d76644603f0f9f15a246b4f4af87c2ba4293ec49 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/lv416e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d76644603f0f9f15a246b4f4af87c2ba4293ec49 -
Trigger Event:
push
-
Statement type: