Skip to main content

nbklu: Python bindings for SuiteSparse KLU

nbklu provides:

  • Full low-level bindings for the public klu.h API families
    • 32-bit index real (klu_*)
    • 32-bit index complex (klu_z_*)
    • 64-bit index real (klu_l_*)
    • 64-bit index complex (klu_zl_*)
  • A high-level solver API with typed variants.

Installation

pip install nbklu
# optional SciPy integration
pip install "nbklu[scipy]"
# or from source
pip install git+https://github.com/determ1ne/nbklu.git

Solver usage

import numpy as np
from nbklu import KLUSolver

n = 5
Ap = np.array([0, 2, 5, 9, 10, 12], dtype=np.int32)
Ai = np.array([0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4], dtype=np.int32)
Ax = np.array([2.0, 3.0, 3.0, -1.0, 4.0, 4.0, -3.0, 1.0, 2.0, 2.0, 6.0, 1.0], dtype=np.float64)
b = np.array([8.0, 45.0, -3.0, 3.0, 19.0], dtype=np.float64)

solver = KLUSolver(index_bits=32, complex_values=False)
solver.analyze(n, Ap, Ai)
solver.factor(Ax)
x = solver.solve(b)
print(x)

Typed solver variants

  • KLUSolver32Real
  • KLUSolver32Complex
  • KLUSolver64Real
  • KLUSolver64Complex

All variants support:

  • analyze / analyze_given
  • factor / refactor
  • solve / tsolve
  • sort, flops, rgrowth, condest, rcond, scale, extract

Low-level API

Import nbklu._ext for direct C-parity functions (analyze, z_factor, l_solve, zl_extract, version, ...). Complex APIs accept both:

  • interleaved float64 arrays (KLU layout)
  • numpy.complex128 arrays.

Notes

SciPy API (nbklu.scipy)

SciPy integration interface mirrors scipy.sparse.linalg patterns:

import numpy as np
from scipy.sparse import csc_matrix
from nbklu.scipy import spsolve, factorized, splu

A = csc_matrix(...)
b = np.array(...)

x = spsolve(A, b)

solve = factorized(A)
x2 = solve(b)

lu = splu(A)
x3 = lu.solve(b)
x4 = lu.solve(b, trans="T")

This module accepts SciPy sparse matrices/arrays and internally dispatches to the appropriate KLU family.

Release files for nbklu 0.3.0

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

Source distribution (sdist)

Source distribution for nbklu 0.3.0
File Size Uploaded
nbklu-0.3.0.tar.gz 213.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nbklu 0.3.0
File
nbklu-0.3.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
nbklu-0.3.0-cp314-cp314t-win32.whl CPython 3.14 CPython 3.14 free-threading Windows x86-32 Details
nbklu-0.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details
nbklu-0.3.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
nbklu-0.3.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
nbklu-0.3.0-cp312-abi3-win32.whl CPython 3.12 abi3 Windows x86-32 Details
nbklu-0.3.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
nbklu-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
nbklu-0.3.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
nbklu-0.3.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
nbklu-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details
nbklu-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
nbklu-0.3.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
nbklu-0.3.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
nbklu-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.2+ x86-64 Details
nbklu-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 4.2 MB

Release files / nbklu-0.3.0.tar.gz

Download URL nbklu-0.3.0.tar.gz
Size 213.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e11413f81f635ce768496ae5c0840d330a26eb93591c26e90eb1c60768fb7787
BLAKE2b-256 checksum
How to use checksums
54f4311a2c4eb7defc5dd23f187b676e4fb5390279ef11c97ac53b46ae4c5e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp314-cp314t-win_amd64.whl

Download URL nbklu-0.3.0-cp314-cp314t-win_amd64.whl
Size 236.1 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
b16a55487bb8d584a2cd24ccd156f638086636a2b51a333ac81e7f6cd373b0f9
BLAKE2b-256 checksum
How to use checksums
007562422f357434d7f9afae0fac8773e623737d08afbeb014ed09312e73c07e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp314-cp314t-win32.whl

Download URL nbklu-0.3.0-cp314-cp314t-win32.whl
Size 199.8 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-32
SHA-256 checksum
How to use checksums
c1855cc71e1dca48b18fde7e73b610f743f8b35a3e3e1c6b78b472c118cc326e
BLAKE2b-256 checksum
How to use checksums
582cc00bacac83c4c981759cdae11ba8084d3a813e9c1e36c8ed91083e8dbd40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL nbklu-0.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 341.0 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
50a09f752b1fa3c73f2f4e31d2c5eff9fc35712716c81123d8f2880c8177fa12
BLAKE2b-256 checksum
How to use checksums
d3af120ce807465382615df51bf1110c0e542e34738204aaa57a2ec724181f3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL nbklu-0.3.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 242.4 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f54e8c6830f65a54e634f21954d2374a6333007ec8af95a9f84efd8be0620223
BLAKE2b-256 checksum
How to use checksums
600d2d7b635f5c3a091a932772e6c9e8adfe6facd8594fc41aecd1f41cd79826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp312-abi3-win_amd64.whl

Download URL nbklu-0.3.0-cp312-abi3-win_amd64.whl
Size 223.9 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
59bcc6751d8793142f72123552bbfc8d330a9117f66b56ecc648995d2c7d5577
BLAKE2b-256 checksum
How to use checksums
2ca667ead01abb33bf7b625804b71ae4b314a8ee7102f4dc50d9bfb50fb023fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp312-abi3-win32.whl

Download URL nbklu-0.3.0-cp312-abi3-win32.whl
Size 191.1 kB
Tags CPython 3.12 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
6a2875c07742573d9aa0b8ba51fd71ae98088f71527a6c4353ffd2aa7398ca38
BLAKE2b-256 checksum
How to use checksums
cadc49c40b201f50ca400737f32c2c055207bd7bbbaf7f8676d8ea692ef10ab8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL nbklu-0.3.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 334.9 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
f540a684818c763cbef0b734e00ad426ab39916be47bd38042b7a4e992c3f0d7
BLAKE2b-256 checksum
How to use checksums
ec8cf36217fb46c6132ca55a450471d4feee3323178388a68e9c436fdd0f8d26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL nbklu-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 236.4 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6ee5aec9164b9e5886119e00364b90d997ea1ec945f3ccf647661e57e8353575
BLAKE2b-256 checksum
How to use checksums
af93e39a133f4b56bb9206c8a7aab23961206d69d54271bd6568edc73ff88da0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp311-cp311-win_amd64.whl

Download URL nbklu-0.3.0-cp311-cp311-win_amd64.whl
Size 225.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
1f7c177bd059633aa67dec7fd31e080e80e56829768c7e6bbdb887a5bbbaf1a4
BLAKE2b-256 checksum
How to use checksums
9f24b12fdb0f7f96293412b9200a99f2e20d85264295f4fd1e5f268fd8c7b6aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp311-cp311-win32.whl

Download URL nbklu-0.3.0-cp311-cp311-win32.whl
Size 193.0 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
57fabc1b03aa34c41cc2381cc426863fa2d90b83d054dc55880821266841de7d
BLAKE2b-256 checksum
How to use checksums
e8620ef6ad51de33417ec475c329f359b8377923232b6296d0a50afe649c2304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL nbklu-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 339.6 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
0de8d1746388d5273613933d67c783141fe23d7723f9dabad04216cc07bd05e2
BLAKE2b-256 checksum
How to use checksums
3d8d4196ba229715616d7ae8a76ddeee99df29f94380cdf9c6b13b06b528ecae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL nbklu-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 241.0 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c4c9584a7a3cceda92413cf433d394fe7968d6203c8d4c96ed3f68c389a9dad6
BLAKE2b-256 checksum
How to use checksums
028d4e7c628d198226336f711ea197f50a941ca97fae2962a9e1e1bc1b3a4adb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp310-cp310-win_amd64.whl

Download URL nbklu-0.3.0-cp310-cp310-win_amd64.whl
Size 226.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
2d7460fdbf2eb92c13ad09bb6f23cd8db512e5186e9dfdfaf3aa572527b06deb
BLAKE2b-256 checksum
How to use checksums
083a8f9e846fb46011c3d3e495908d1f8843d10fb24991041f886c2047a0bceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp310-cp310-win32.whl

Download URL nbklu-0.3.0-cp310-cp310-win32.whl
Size 193.1 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
24d7407a3aacb9ee50e8259e1775c11ac2a04a404fd6fab2d6517f1a4005a4e4
BLAKE2b-256 checksum
How to use checksums
4c89562fd2ff8d06641d976d879dea3b51dd4bdcb340f5b11c89fd28b444f808
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl

Download URL nbklu-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl
Size 339.8 kB
Tags CPython 3.10 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
105fd4c9f1e18cd1b4382f0320c402484d29dcc20fa26d850ff01474176df3ae
BLAKE2b-256 checksum
How to use checksums
949e08095949b9acbcb8122501c855e0a62c3ea8604288c5079fac4226d0d076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / nbklu-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL nbklu-0.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 241.2 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3dfff386371328b884d05b0a3e869744788887950d427949ba5a84cafb3150fa
BLAKE2b-256 checksum
How to use checksums
f9e27735c3e00fde0dbae4df3d37c68bae0078deae6db8c1db2f31a7562daf42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

17 release files

0.2.0

17 release files

0.1.0

17 release files

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