Skip to main content

rslab (Python bindings)

NumPy/SciPy bindings for RSLAB, a pure-Rust sparse direct solver: symmetric and complex-symmetric LDL^T (Bunch-Kaufman), unsymmetric LU, and a KLU path for circuit-shaped matrices. All numeric work happens in Rust. Supported dtypes: float64, float32, complex128, complex64.

pip install rslab

Usage

import numpy as np
import scipy.sparse as sp
import rslab

x = rslab.spsolve(A, b)              # one-shot, on the automatic path

f = rslab.ldlt(A)                    # symmetric or complex-symmetric
x = f.solve(b)
X = f.solve_many(B)                  # n x nrhs
print(f.factor_nnz, f.inertia, f.diagnostics()["summary"])

f = rslab.lu(A_general)              # unsymmetric
y = f.solve_transpose(b)             # A.T @ y = b, on every handle

Circuit-shaped matrices (MNA / SPICE class) take the KLU path, with a numeric-only refactor for fixed-pattern sweeps and its factors exported:

f = rslab.klu(A)
x = f.solve(b)
f.refactor(A_next.data)              # same pattern, new values, no pivot search
y = f.solve_transpose(b)             # A.T @ y = b (conjugate b and y for A^H)
L, U, F = f.L, f.U, f.F              # (R A)[perm_r][:, perm_c] = L @ U + F

The automatic path picks among the three by the work the analysis predicts: KLU for sparse work, LDL^T for symmetric values or LU for dense work.

f = rslab.auto(A)
print(f.backend)                     # 'klu', 'ldlt' or 'lu'
f.refactor(A_next.data)              # in place, on the path the values take

Symbolic reuse

The analysis depends on the pattern only; pay it once per sweep:

sym = rslab.analyze(A)               # AutoSymbolic; path='ldlt', 'lu' or 'klu' for one path
plan = sym.memory_plan(A.dtype.name, threads=8)  # heap before any numeric work
assert plan["peak_bytes"] < available_bytes
for omega in frequencies:
    f = sym.factor(K + 1j * omega * C)   # the matrix or its data array
    x = f.solve(b)

Preconditioners and Krylov solvers

Static pivoting never fails; refinement or a Krylov method recovers the accuracy. gmres, gmres_block, cocg and cocr take any factor handle as preconditioner:

f = rslab.ldlt(A, preconditioner=1e-8)
x = f.solve(b, refine=20)

M = rslab.lu(A, factor_dtype="complex64")  # complex128 A, half the factor memory
x, converged, iters, res, stop = rslab.gmres(A, b, M, tol=1e-10)
x = M.solve(b, refine=5)             # mixed-precision refinement, full accuracy

Settings

Factor knobs are keyword arguments of auto, ldlt, lu, spsolve and analyze, or a rslab.Settings object (rslab.KluSettings for klu). Every tuning constant of the solver is one (nd_fm_passes, race_candidates, solve_block, ...), with the tuned value as default; rslab.Settings().to_dict() lists them all. Common overrides:

f = rslab.lu(A, ordering="metis", threads=8, pivot_threshold=0.5)
s = rslab.Settings(preconditioner=1e-6, factor_dtype="complex64")

Settings a path does not read are listed under diagnostics()["warnings"]. Every keyword, handle and method is documented in the generated reference docs/api.md (help(rslab.lu) shows the same text).

Logging

rslab.set_log_level("info")          # or the RLA_LOG environment variable
log = logging.getLogger("rslab")
rslab.set_log_sink(lambda level, msg: log.log(logging.getLevelName(level.upper()), msg))

License

MIT.

Metadata

Release files for rslab 1.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rslab 1.9.1
File Size Uploaded Provenance Actions
rslab-1.9.1.tar.gz 621.1 kB With provenance Details for rslab-1.9.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rslab 1.9.1
File Actions
rslab-1.9.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for rslab-1.9.1-cp39-abi3-win_amd64.whl
rslab-1.9.1-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for rslab-1.9.1-cp39-abi3-manylinux_2_28_x86_64.whl
rslab-1.9.1-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for rslab-1.9.1-cp39-abi3-manylinux_2_28_aarch64.whl
rslab-1.9.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for rslab-1.9.1-cp39-abi3-macosx_11_0_arm64.whl
rslab-1.9.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for rslab-1.9.1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 16.1 MB

Release files / rslab-1.9.1.tar.gz

Download URL rslab-1.9.1.tar.gz
Size 621.1 kB
Tags Source
SHA-256 checksum
How to use checksums
22972332c75fb26a035bc352c7bb0bb373ae83447b89e209e1b5690709cdac7f
BLAKE2b-256 checksum
How to use checksums
90c8d641190840fe607da085487f78682ceae1de35c65372ceb2d8b01aa382fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / rslab-1.9.1-cp39-abi3-win_amd64.whl

Download URL rslab-1.9.1-cp39-abi3-win_amd64.whl
Size 3.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2278c3ca36f8ae8414ccc0409094c1a3764030bf284088f3a7c813fc0658fb8a
BLAKE2b-256 checksum
How to use checksums
f5a8428c0d8aa3793487c40baa5e451779b6b9edd632f98d1f88bff5c24088fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / rslab-1.9.1-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL rslab-1.9.1-cp39-abi3-manylinux_2_28_x86_64.whl
Size 3.5 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
eb961a92e293afa53a158ea1c77e22b066839a7b67c7ab28a2c5b756cfd1772d
BLAKE2b-256 checksum
How to use checksums
7e5aa13b12c514c88fac02306f0409c723fd1e07e12e76c689407f59e6a07ae2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / rslab-1.9.1-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL rslab-1.9.1-cp39-abi3-manylinux_2_28_aarch64.whl
Size 3.0 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
76382df69c14e78f7b5c0c77ad0165687308544ab52fef75c30594da2aed9b96
BLAKE2b-256 checksum
How to use checksums
3aef0d95bd471a8ca31e2bd9790b8210e192153ece26a4f06734c1d61ecd24e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / rslab-1.9.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL rslab-1.9.1-cp39-abi3-macosx_11_0_arm64.whl
Size 2.7 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5e42a3020cfb624aa753d6cb977db426c3e0da8ecfecfc6772c5d1addf9dfbd4
BLAKE2b-256 checksum
How to use checksums
4e339444b7a38a821e97ead9b3a8d8092afa6e1db8e2726f58e28acf2ce6c392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / rslab-1.9.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL rslab-1.9.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 3.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b78f1622e6c691504d997f451edcf129c02f96b1178746265820e7815553e21c
BLAKE2b-256 checksum
How to use checksums
69227fd06a72b38e12ee699d8e99892e94cd9b8ec514c310b8dd151b217b7065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Security for rslab 1.9.1

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for rslab-1.9.1.tar.gz

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 Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.9.1 This release

6 release files Full provenance

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