JGOT (JAX Graph Optimal Transport)
jgot solves two-endpoint dynamic optimal transport on sparse reversible graphs
using JAX, following the time-discrete formulation of
Erbar et al. (2020).
Install
PyPI package:
Core library:
pip install jgot
Examples (plotting dependencies included):
pip install "jgot[examples]"
Development environment:
uv sync --group dev
Minimal Example
import jax.numpy as jnp
from jgot import (
GraphSpec,
LogMeanOps,
OTConfig,
OTProblem,
TimeDiscretization,
solve_ot,
)
graph = GraphSpec.from_undirected_weights(
num_nodes=2,
edge_u=[0],
edge_v=[1],
weight=[1.0],
)
mass_a = jnp.array([1.0, 0.0])
mass_b = jnp.array([0.0, 1.0])
rho_a = mass_a / graph.pi
rho_b = mass_b / graph.pi
problem = OTProblem(
graph=graph,
time=TimeDiscretization(num_steps=64),
rho_a=rho_a,
rho_b=rho_b,
mean_ops=LogMeanOps(),
)
sol = solve_ot(problem, OTConfig())
print(float(sol.distance), sol.converged, sol.iterations_used)
Important:
- Densities are represented with respect to
pi. - Endpoints must satisfy
sum(pi * rho) == 1.
Documentation
Detailed docs live under docs.
Recommended starting points:
- Getting Started
- Graph Model
- API Reference
- Examples Guide
- Debugging and Diagnostics
- Numerical Limitations
Examples
Runnable scripts:
examples/two_node_benchmark/run.pyexamples/cycle_neighbor_transport/run.pyexamples/line_chain_transport/run.pyexamples/directed_reversible_transport/run.pyexamples/large_grid_transport/run.py
See examples/README.md for commands and outputs.
Release files for jgot 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jgot-0.2.2.tar.gz | 111.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jgot-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 141.3 kB
Release files / jgot-0.2.2.tar.gz
| Download URL | jgot-0.2.2.tar.gz |
|---|---|
| Size | 111.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed2de55d0ffce66ab1e56b2c47fd92edf061e90a62fe22872d939a51489484b9
|
|
BLAKE2b-256 checksum How to use checksums |
3fdd6d440b00fa430ff4db89c27b4593bafd2715abe2928754a87c6c28d851e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 6, 2026.
Transparency logRelease files / jgot-0.2.2-py3-none-any.whl
| Download URL | jgot-0.2.2-py3-none-any.whl |
|---|---|
| Size | 29.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b89940357e4c0629c655b83d99be06ca73d2faee8458f926c793ee56145824f5
|
|
BLAKE2b-256 checksum How to use checksums |
75d14e9b352aded0b84f8004b3c0c87c3ac230d9b913a392545e917c92b5128a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 6, 2026.
Transparency log