Skip to main content

JGOT (JAX Graph Optimal Transport)

PyPI

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:

Examples

Runnable scripts:

  • examples/two_node_benchmark/run.py
  • examples/cycle_neighbor_transport/run.py
  • examples/line_chain_transport/run.py
  • examples/directed_reversible_transport/run.py
  • examples/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)

Source distribution for jgot 0.2.2
File Size Uploaded
jgot-0.2.2.tar.gz 111.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jgot 0.2.2
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page