GeoJAX
GeoJAX is a JAX-native toolkit for Riemannian geometry and manifold optimization. Geometry objects provide manifold primitives, models provide JAX scalar cost functions, and class-style solvers combine the two.
[!IMPORTANT] GeoJAX is alpha software. The 0.1 series deliberately favors a coherent scientific API over backward compatibility.
Highlights
- Exact geodesic operations where closed forms are available, with machine-readable retraction and transport proxies elsewhere.
- Matrix manifolds, Lie groups, hyperbolic spaces, shape spaces, low-rank models, and arbitrary pytree products.
- JAX autodifferentiation, JIT-compatible geometry primitives, composable batch helpers, and pytree-safe optimization state.
- Executable tutorial pages that place mathematical discussion, code, output, and figures in one document.
Installation
GeoJAX requires Python 3.11 or newer. The human-facing project name is
GeoJAX; the Python package, repository slug, and PyPI distribution are all
lowercase geojax. Install it with:
PyPI
python -m pip install geojax
GitHub source
git clone https://github.com/kisungyou/geojax.git
cd geojax
python -m pip install .
For development, replace the final command with
python -m pip install -e ".[dev,docs,examples]".
Quick Start
The following problem minimizes a Rayleigh quotient on the unit sphere. Its
solution is a dominant eigenvector of A.
import jax.numpy as jnp
from geojax.geometry import Sphere
from geojax.optimization import ConjugateGradient, Minimize
M = Sphere(size=3)
A = jnp.array(
[[3.0, 1.0, 0.0],
[1.0, 2.0, 0.0],
[0.0, 0.0, 0.5]]
)
problem = Minimize(
M=M,
cost=lambda x: -x @ A @ x,
solver=ConjugateGradient(verbosity=0),
key=0,
)
x_hat, final_cost, history = problem.solve()
Sphere(size=3) is the unit sphere embedded in R^3. Minimize obtains the
ambient derivative with JAX, converts it through the geometry, and delegates
the iteration to the selected solver.
JAX Transformations
Geometry instances are static configuration objects. Their numerical protocol
methods accept array or pytree arguments and compose with jax.jit; random
generation takes explicit PRNG keys, and exp_batch, log_batch, and
dist_batch compose jax.vmap with JIT compilation. GeoJAX also supports
JAX-derived gradients and Hessian-vector products on array and Product states.
Solver solve() methods are deliberately Python drivers rather than
whole-solver JIT kernels. They perform stopping checks, callbacks, timing,
line-search control flow, and conversion of diagnostics to Python scalars.
Costs, derivative callbacks, and geometry operations used inside those drivers
may still be independently JIT compiled.
Scientific Scope
The public geometry namespace includes Euclidean, sphere, oblique, simplex, hyperbolic, torus, Grassmann, Stiefel, generalized orthogonality, Lie-group, SPD, fixed-rank, elliptope, spectrahedron, correlation, Kendall-shape, and pytree product geometries.
The public solver set is:
SteepestDescentConjugateGradientTrustRegionsBarzilaiBorweinLBFGSNewtonCGParticleSwarmNelderMeadAdaptiveRegularizationCubicsGaussNewtonandLevenbergMarquardtforLeastSquaresStochasticGradientforFiniteSumAlternatingGradientforProductgeometries
Gradient solvers share public fixed-step, Armijo, adaptive Armijo, and strong-Wolfe line-search strategies.
See the geometry guide, optimization guide, and executable tutorials for the mathematical and computational conventions.
Documentation
The documentation website is published at kisungyou.com/geojax.
Install the documentation dependencies and build the complete site locally:
python -m pip install -e ".[docs,examples]"
make website
python -m http.server 8000 --directory site
The build executes every tutorial, fails on Sphinx warnings, and audits the
generated HTML for malformed mathematics and broken local references. Open
http://127.0.0.1:8000 after the server starts.
Development
python -m pip install -e ".[dev,docs,examples]"
make test
make test-float32
ruff check geojax tests
python -m build
python -m twine check dist/*
Before a release, make test-matrix exercises the supported Python versions,
the declared dependency floor, current dependencies, and both JAX precision
modes. See the
testing guide
for the exact matrix.
The geometry protocol and optimization protocol describe the contracts expected from new implementations. Maintainers can follow the release checklist for manual TestPyPI and PyPI publication.
Citation
Academic users can cite the project using
CITATION.cff.
Release history is recorded in
CHANGELOG.md.
License
GeoJAX is released under the
MIT License.
Licenses and attribution for documentation data and fonts are recorded in
THIRD_PARTY_NOTICES.md.
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 geojax-0.1.1.tar.gz.
File metadata
- Download URL: geojax-0.1.1.tar.gz
- Upload date:
- Size: 3.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da034e38ce020abfcbc1da58a7b3f04faadc829ef906493fc78a55e4035feb9b
|
|
| MD5 |
acc9de2963693a8a5ec9f577e7dd32b9
|
|
| BLAKE2b-256 |
92b05f61b0d5ae25d6ab42af1e990d5543b7acebff079194e565a0bb3a729f86
|
File details
Details for the file geojax-0.1.1-py3-none-any.whl.
File metadata
- Download URL: geojax-0.1.1-py3-none-any.whl
- Upload date:
- Size: 101.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75476d99b8194465d838f15d6830b7e972181f700eb3ba7aa27f2a6c315744f7
|
|
| MD5 |
8981feb0f4d16b49e6efadbb9b3d8d4f
|
|
| BLAKE2b-256 |
1748c78cd27122c09f0cf0b69a6b6a97f2cbed7854c097de65fc72db4344d28c
|