lineax
Linear solvers in JAX and Equinox.
What it is and what it does
Lineax is a JAX library for solving linear systems and least-squares problems, with support for both explicit matrices and implicit linear operators (e.g., Jacobians, transposes). It integrates with JAX's autodiff, autoparallelism, and GPU/TPU support, allowing you to differentiate through linear solves with numerically stable gradients. The library works with PyTree-valued matrices and vectors, and supports structured matrix types like symmetric matrices.
Typical use cases include solving Ax=b when A may be ill-posed or rectangular, computing least-squares solutions via QR or other solvers, and building implicit operators for problems where materializing the full matrix is infeasible or inefficient. It is part of the broader JAX ecosystem and depends on Equinox for PyTree utilities and jaxtyping for type annotations.
Use it for:
- Solve overdetermined or underdetermined linear systems without materializing the full matrix operator.
- Compute least-squares solutions with numerically stable gradients for optimization and inverse problems.
- Build implicit Jacobian and Hessian operators for Newton-like methods in scientific computing.
- Solve quadratic minimization problems by constructing a Hessian linear operator and solving the normal equations.
- Integrate linear solves into JAX-based neural network training pipelines with automatic differentiation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lineax solves linear systems and least-squares problems in JAX, handling both explicit matrices and implicit linear operators without materializing them.
Yes, if you work in JAX and need linear solves or least-squares. The library is actively maintained, has low install friction, and integrates seamlessly with JAX's autodiff and GPU/TPU support. The Apache 2.0 license poses no restrictions. Alpha status (Development Status 3) means the API may change, but the package is in active use and well-documented.
Install
lineax on PyPI
pip
pip install lineaxuv
uv add lineaxpoetry
poetry add lineaxInstalling lineax
Before you install
Low install friction with a pure-Python wheel. Actively maintained as of August 2026 with recent releases. Requires JAX 0.4.38+ and Equinox 0.11.10+, which are themselves substantial dependencies.
License in practice
Apache 2.0 permissive license allows commercial and derivative use with minimal restrictions—attribution and license notice required in distributions.
Quickstart
pip install lineax
import jax.random as jr
import lineax as lx
matrix_key, vector_key = jr.split(jr.PRNGKey(0))
matrix = jr.normal(matrix_key, (10, 8))
vector = jr.normal(vector_key, (10,))
operator = lx.MatrixLinearOperator(matrix)
solution = lx.linear_solve(operator, vector, solver=lx.QR())
Requires Python 3.11+, JAX 0.4.38+, and Equinox 0.11.10+.
Verify before relying
- Whether structured matrix support (e.g. symmetric) provides measurable performance gains in typical workflows.
- Stability and numerical accuracy of gradients through least-squares compared to alternative autodiff approaches.
- Performance characteristics of implicit operators on GPU/TPU relative to explicit matrix solves.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (~=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — equinox, jax, jaxtyping, typing-extensions |
| Maintenance | actively maintained — 105 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 523,152/month — #6,197 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lineax-0.1.1-py3-none-any.whl
Keywords: deep-learning, equinox, jax, least-squares, linear-solvers, neural-networks, numerical-methods
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
klujaxSolves sparse linear systems in JAX using the…
copyleft · top 15,000 on PyPI
optimistixOptimistix provides nonlinear solvers for root…
permissive · top 15,000 on PyPI
trianglesolverSolves for unknown sides and angles of a…
permissive · top 15,000 on PyPI
diffraxDiffrax provides numerical solvers for…
permissive · top 15,000 on PyPI
linear-operatorLinearOperator abstracts structured matrix…
permissive · top 5,000 on PyPI
equinoxEquinox provides neural network and model…
permissive · top 5,000 on PyPI
optaxOptax provides composable building blocks for…
permissive · top 5,000 on PyPI
jaxtypingProvides type annotations and runtime…
permissive · top 5,000 on PyPI
ott-jaxOTT-JAX solves optimal transport…
permissive · top 15,000 on PyPI
qpsolversProvides a unified Python interface to solve…
copyleft · top 5,000 on PyPI