Skip to main content

rslab (Python bindings)

NumPy/SciPy bindings for RSLAB, a pure-Rust sparse direct solver and preconditioner: complex/real symmetric LDLᵀ (Bunch-Kaufman) plus unsymmetric LU. A thin wrapper, all numeric work happens in Rust.

Install

pip install rslab

Usage

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

# Symmetric system (real or complex; the dtype selects the path).
A = sp.random(5000, 5000, density=1e-3, format="csc") + sp.eye(5000) * 10
A = A + A.T
b = np.random.rand(5000)

# One-shot solve.
x = rslab.spsolve(A, b)

# Factor once, solve many right-hand sides.
f = rslab.ldlt(A)
x1 = f.solve(b)
X = f.solve_many(np.random.rand(5000, 8))   # n x nrhs

print(f.n, f.factor_nnz, f.inertia, f.dtype)

Complex-symmetric matrices (EM/FEM, PARDISO mtype 6) work identically:

A = A.astype(np.complex128); A.data += 1j * 0.3 * A.data.real
x = rslab.ldlt(A).solve(np.ones(A.shape[0], dtype=np.complex128))

Unsymmetric matrices use the LU path:

f = rslab.lu(A_general)
x = f.solve(b)

Preconditioner mode

Never-fail static pivoting plus iterative refinement for hard/indefinite systems:

f = rslab.ldlt(A, preconditioner=1e-4)
x = f.solve(b, refine=20)        # refine against the original A

Configuration (keyword arguments)

ldlt, lu and spsolve accept:

kwarg default meaning
threads None (auto) None = per-matrix auto predictor, capped at 4 workers; int = fixed (0 = all)
preconditioner None static-pivot floor (e.g. 1e-4); never-fail, refine to solve
drop_tol None incomplete-factor threshold (preconditioner)
method "left_looking" "left_looking" or "multifrontal"
memory "low" "low" or "eager" factor emit strategy
force_accept False accept tiny pivots in exact mode instead of failing

Supported dtypes: float64, float32, complex128, complex64.

License

MIT.

Download files

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

Source Distribution

rslab-0.15.0.tar.gz (4.7 MB view details)

Uploaded Source

Built Distributions

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

rslab-0.15.0-cp39-abi3-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

rslab-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

rslab-0.15.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rslab-0.15.0-cp39-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rslab-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rslab-0.15.0.tar.gz.

File metadata

  • Download URL: rslab-0.15.0.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rslab-0.15.0.tar.gz
Algorithm Hash digest
SHA256 f2f7239d7dbfb3f203ac0e1131c48477856aae7e65746fae7c22160beed98c30
MD5 6b2c17abb7ed83750da4185e1f4f8ca1
BLAKE2b-256 e416bf231e75aa6fd805f0ab077357e9a314371350177e64b5d7a7a6b123033c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.15.0.tar.gz:

Publisher: publish.yml on milanofthe/rslab

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

File details

Details for the file rslab-0.15.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rslab-0.15.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rslab-0.15.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 02a5c99a7b78d406c741807de1b493eb7b5dffcb3f2ae7f54953e737c04c37a7
MD5 ea7d0e5535ad1ed59e6146a8d55f88b6
BLAKE2b-256 afe048e6eb33e01011b347973dba20d57e5b48fea735a6265d2ad13b8f191229

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.15.0-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on milanofthe/rslab

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

File details

Details for the file rslab-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rslab-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6d6a26ccc1f2129e6298f444c8570a4336348a7d88f694f65dec6ede7124c73
MD5 56fd107f45c07baaf14ce711b16f1b48
BLAKE2b-256 6724f4912baa37619bf8a216246e9e261d501d35a24d796e8eca42fb1b0f1346

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on milanofthe/rslab

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

File details

Details for the file rslab-0.15.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rslab-0.15.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 209c8b1420519d55c5bf795dce533c70fbae2e8c4c04999006ece75ea425c798
MD5 b4e47e738a6a6e9a48d12b43e6259611
BLAKE2b-256 d5f57288a296a81e7c07e5710c33a9b5a5c4dc8262998b5bc83b3b6a3c028841

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.15.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on milanofthe/rslab

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

File details

Details for the file rslab-0.15.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rslab-0.15.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5d11d6c1f3d59202f79d88a8a55bac8dc4e317948b4ac127d83e98e18287b24
MD5 fdf17749d14ebb930ac60461d98d046f
BLAKE2b-256 9cca76c87a1ef038e43f1a07fa47ff6549fc3632f1447494cc41680fe9e04a04

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.15.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on milanofthe/rslab

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

File details

Details for the file rslab-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rslab-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c3102a302e332e2a76825701737dc167e8b88c0a47018a70908bd9617913d493
MD5 11ba6c6f349ea73e35d0260ca1d4ab91
BLAKE2b-256 ace9dee0de9513b03853fe266f0be7b78332f20a36dde8bd74b6e802ebc451ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on milanofthe/rslab

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 Sentry Error logging StatusPage Status page