Skip to main content

A JAX library for solving block tri-diagonal matrix systems

Project description

blocktrix

Repo Status PyPI Version Status Test Status Ruff License Software DOI

A JAX library for efficiently solving block tri-diagonal matrix systems on GPUs.

Author: Philip Mocz (@pmocz)

Implements both a block Thomas (serial) solver and a block cyclic reduction B-cyclic (parallel) solver.

⚠️ Warning: Work in Progress ⚠️

This library is still under active development and is not guaranteed to work at this point XXX.

Installation

pip install blocktrix

Usage

import jax
from blocktrix import solve_block_tridiagonal_bcyclic, random_block_tridiagonal

# Generate a random test system
key = jax.random.PRNGKey(42)
n_blocks, block_size = 8, 4

lower, diag, upper, rhs = random_block_tridiagonal(key, n_blocks, block_size)

# Solve the system
x = solve_block_tridiagonal_bcyclic(n_blocks, lower, diag, upper, rhs)

Quickstart

It's fast!

Timing comparison

Speedup

Links

Cite this repository

If you use this software, please cite it as below.

@software{Mocz_Blocktrix_2026,
   author = {Mocz, Philip},
      doi = {https://doi.org/10.5281/zenodo.18226420},
    month = jan,
    title = {{Blocktrix}},
      url = {https://github.com/pmocz/blocktrix},
  version = {0.0.4},
     year = {2026}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blocktrix-0.0.5.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blocktrix-0.0.5-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file blocktrix-0.0.5.tar.gz.

File metadata

  • Download URL: blocktrix-0.0.5.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blocktrix-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9559a300c7ee6e25cc4c8c46bf16c6ee7a9c24daa2c210990311bc710f105065
MD5 91a3579875b7093e67b9ad940eed8cee
BLAKE2b-256 9beddd18d2768bf6efd5f78bf50568ba7f585965c2953fd221c2badc9b95d0a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for blocktrix-0.0.5.tar.gz:

Publisher: publish-package.yml on pmocz/blocktrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file blocktrix-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: blocktrix-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blocktrix-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7ebe8500d89b8cb8de95d0accc8d5e836ee7edb6a08fd9f9c1238b129556043c
MD5 0932d757dcbb7e6a90ff4b1991055e27
BLAKE2b-256 3d27b6b677f20fa617ce188c40b26ffdcefaf774b835694caa359cd7deff5006

See more details on using hashes here.

Provenance

The following attestation bundles were made for blocktrix-0.0.5-py3-none-any.whl:

Publisher: publish-package.yml on pmocz/blocktrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page