patrick-kidger/lineax

Linear solvers in JAX and Equinox. https://docs.kidger.site/lineax

What it solves

Lineax is a JAX library designed to solve linear systems (solving for $x$ in $Ax = b$) and linear least squares problems. It handles cases where the matrix $A$ may be rectangular or ill-posed, providing a more unified and stable way to handle these mathematical operations within the JAX ecosystem.

How it works

Lineax uses linear operators to represent matrices and Jacobians, allowing it to solve problems without ever needing to materialize a full matrix in memory. It supports various solvers, such as QR solvers and Conjugate Gradient (CG) methods, and integrates deeply with JAX to leverage autodiff, GPU/TPU support, and autoparallelism.

Who it’s for

It is intended for researchers and developers working in scientific computing, machine learning, and AI for science, who need efficient, numerically stable linear algebra operations that are compatible with JAX and Equinox.

Highlights

  • PyTree-valued matrices and vectors: Supports complex data structures for linear algebra.
  • General linear operators: Handles Jacobians and transposes without materializing matrices.
  • PyTree-valued matrices and vectors: Support for both real-valued and complex-valued inputs.
  • Numerical stability: Provides stable gradients through linear least squares.
  • JAX Integration: Full support for autodiff, GPU/TPU acceleration, and structured matrices (e.g., symmetric).
  • Performance: Improved compilation times and runtime for certain algorithms.

Related

  • Project
  • Project
  • Project
  • Project
  • Project