--- id: pot version: "0.9.7.post1" license: MIT license_treatment: permissive maintenance: active --- # POT — Python Optimal Transport Library License: permissive · Maintenance: active · Downloads: 587.8K/mo ## What it is and what it does POT is a Python library for solving optimal transport problems—a mathematical framework for measuring and computing distances between distributions. It provides a large collection of differentiable solvers covering exact linear OT, entropic and quadratic regularized variants, Gromov-Wasserstein distances, unbalanced and partial OT, and specialized algorithms for 1D, circular, and Gaussian mixture model transport. The library also includes machine learning applications such as domain adaptation, transport mapping, and subspace learning. The package depends on numpy and scipy for numerical computation and offers multiple backend support (PyTorch, JAX, TensorFlow, CuPy) to work with different array types. It is actively maintained, production-stable, and widely used in research and applied settings where distribution comparison, alignment, or interpolation is needed. Use it for: - Compute Wasserstein distances and optimal transport plans between point clouds or distributions for metric learning. - Perform domain adaptation by aligning source and target distributions in machine learning pipelines. - Calculate Gromov-Wasserstein distances to compare structured data like graphs or point clouds with different geometries. - Compute Wasserstein barycenters to find representative distributions or aggregate multiple datasets. - Solve unbalanced or partial optimal transport problems when mass conservation is relaxed. - Integrate OT solvers into neural networks via differentiable layers for end-to-end learning. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. POT provides solvers for optimal transport problems, including Wasserstein distances, Gromov-Wasserstein distances, and related algorithms for signal processing, image processing, and machine learning applications. Yes. POT is actively maintained, production-stable (Development Status 5), has no known vulnerabilities, and offers a comprehensive suite of optimal transport algorithms backed by research. The medium install friction is manageable with prebuilt wheels. Install if you need optimal transport solvers for machine learning, domain adaptation, or distribution comparison; skip if you have no use for these mathematical tools. ## Install pip install pot uv add pot poetry add pot ## Installing POT Before you install: Medium install friction due to compiled components (C, C++, Cython). Prebuilt wheels available for Python 3.10–3.13 on macOS, Linux, and Windows. Active maintenance with recent release (16 days old) and 2837 GitHub stars. License in practice: MIT license (permissive) allows commercial and private use with minimal restrictions—include a copy of the license and copyright notice. Quickstart: import pot import numpy as np # Compute Wasserstein distance between two distributions a = np.array([0.5, 0.5]) b = np.array([0.3, 0.7]) M = np.array([[0, 1], [1, 0]]) # cost matrix wasserstein_dist = pot.emd(a, b, M) Requires numpy and scipy. Compiled wheels available for Python 3.7–3.13; source build requires C/C++ compiler and Cython. Verify before relying: - Whether all advertised solvers (e.g., Graph Neural Network layers, all backend integrations) are production-ready or still experimental. - Performance characteristics and scalability limits for large-scale problems mentioned in the description. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 587.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags optimal transport solver, wasserstein distance, gromov-wasserstein, domain adaptation, transport mapping, barycenter computation, entropic regularization OT, optimal-transport, domain-adaptation, computational-geometry [View on SkillFed](https://skillfed.io/packages/pot) · [View on PyPI](https://pypi.org/project/pot/)