unilinalg
Linear algebra for Python — dense and sparse matrices, the classic decompositions (LU, Cholesky, QR, SVD, symmetric eigenpairs), and fixed-dimension geometric vectors, backed by the native UniLinalg library.
UniLinalg factors and solves through LU with partial pivoting, Cholesky for
symmetric positive-definite systems, Householder QR for least squares, and
one-sided Jacobi SVD. Matrix.solve's optional refine=True runs one
UniAccurate-backed iterative refinement step to recover the last few ULP a
plain float64 solve can miss — the other three decompositions don't expose
this option through the Python API. CSR sparse matrices cover the
mostly-zero case; Vec2/Vec3/Vec4 cover fixed-dimension geometry,
distinct from the runtime-sized Matrix.
Install
pip install unilinalg
Prebuilt wheels include the native UniLinalg library for Linux, macOS, and Windows on CPython 3.10–3.14. Installing a wheel needs neither Nim nor a C compiler.
Quick start
import unilinalg
a = unilinalg.Matrix.from_rows([[1.0, 2.0, 1.0],
[2.0, 1.0, 3.0],
[1.0, 1.0, 1.0]])
a.solve([8.0, 13.0, 6.0]) # [1.0000000000000007, 2.0, 2.9999999999999996]
a.solve([8.0, 13.0, 6.0], refine=True) # [1.0, 2.0, 3.0] -- exact with refinement
spd = unilinalg.Matrix.from_rows([[4.0, 2.0], [2.0, 3.0]])
spd.cholesky().to_rows() # [[2.0, 0.0], [1.0, 1.4142135623730951]]
diag = unilinalg.Matrix.from_rows([[2.0, 0.0], [0.0, 5.0]])
u, s, v = diag.svd()
s # [5.0, 2.0]
dense = unilinalg.Matrix.from_rows([[5.0, 0.0, 0.0],
[0.0, 8.0, 3.0],
[0.0, 6.0, 0.0]])
sparse = dense.to_sparse()
sparse.nnz # 4
sparse.matvec([1.0, 2.0, 3.0]) # [5.0, 25.0, 12.0]
x, y = unilinalg.Vec3(1.0, 0.0, 0.0), unilinalg.Vec3(0.0, 1.0, 0.0)
x.cross(y) # Vec3(0.0, 0.0, 1.0)
unilinalg.Vec2(3.0, 4.0).length # 5.0
What's included
| Category | Python API |
|---|---|
| Dense matrix | Matrix -- construction, indexing, +/-/@/*, transpose, almost_equal |
| Linear solve | Matrix.solve (LU, partial pivoting), Matrix.determinant |
| Decompositions | Matrix.cholesky, Matrix.qr, Matrix.svd, Matrix.symmetric_eigen |
| Accurate refinement | refine=True on solve -- one UniAccurate-backed correction step |
| Sparse matrix | Sparse (CSR) -- Matrix.to_sparse, Sparse.to_dense, Sparse.matvec, Sparse.nnz |
| Fixed-dimension vectors | Vec2, Vec3, Vec4 -- arithmetic, dot, length, normalize; Vec3.cross; Vec2.cross2d/perp/perp_cw |
A numeric-looking element is coerced through float(...), same as a plain
Python list of numbers would be — but a singular matrix, a shape mismatch,
or a genuinely non-numeric component raises ValueError/TypeError rather
than returning a wrong-shaped or silently wrong result.
For an executable tour of the API, see the Python quickstart notebook.
Links
- Source, Nim API, C ABI, and design records: https://github.com/lituus-lab/UniLinalg
- Issues: https://github.com/lituus-lab/UniLinalg/issues
- License: Apache-2.0
Development
Building from source (contributing, or a platform without a prebuilt wheel) needs a Nim toolchain.
nimble pyLib # native lib for this platform
cd py
python3 setup.py build_ext --inplace # build the Cython extension
python3 -m pytest -q # test
On Windows, use python instead of python3 (PowerShell and cmd.exe
both resolve it; python3 is a POSIX-only convention):
nimble pyLib
cd py
python setup.py build_ext --inplace
python -m pytest -q
Run the build before the test in every case: pytest imports the
unilinalg package straight out of this checkout, so it only finds the
_core extension once build_ext --inplace has compiled it.
Metadata
Release files for unilinalg 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unilinalg-1.1.0.tar.gz | 236.9 kB | Details |
Built distributions (wheels)
Total release size: 6.2 MB
Release files / unilinalg-1.1.0.tar.gz
| Download URL | unilinalg-1.1.0.tar.gz |
|---|---|
| Size | 236.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
668af76a3e182e079a388d600410d90b9555e42cae32eb5953190db9ddb53c7e
|
|
BLAKE2b-256 checksum How to use checksums |
78ec16a317d01351da5344f24b23288fa12799277ae80887fbb0f3c65810e1fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp314-cp314-win_amd64.whl
| Download URL | unilinalg-1.1.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 146.7 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
289a67dabe18cdd5c41d3d1f90bb029f4f1a591dd3c0257fe925c11c3dabbe2b
|
|
BLAKE2b-256 checksum How to use checksums |
1b320e9c2907f9ee87dfcda689e9f277e8f265cb5b1c947faf0ea2b76e1e922d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp314-cp314-manylinux_2_35_x86_64.whl
| Download URL | unilinalg-1.1.0-cp314-cp314-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 761.8 kB |
| Tags | CPython 3.14 Linux glibc 2.35+ x86-64 |
|
SHA-256 checksum How to use checksums |
275fafe540f237615b6bb3cef2c5e9f85b4c896fc74127eabd7d58c16c32ab99
|
|
BLAKE2b-256 checksum How to use checksums |
3d3833f45aed316a50fcceacfc66d8f32be1b0ec7e72783b722a3ba82602b55b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp314-cp314-macosx_10_15_x86_64.macosx_26_0_arm64.whl
| Download URL | unilinalg-1.1.0-cp314-cp314-macosx_10_15_x86_64.macosx_26_0_arm64.whl |
|---|---|
| Size | 276.6 kB |
| Tags | CPython 3.14 macOS 10.15+ x86-64 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4803b65d62542c932352639442aa31b6a4dc3b0063b02e0c4f4e0322816fe62c
|
|
BLAKE2b-256 checksum How to use checksums |
be5f8e01483124ac8653857cc14ccf4c6aed0c5a5b88ccbe443a7482814c06f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp313-cp313-win_amd64.whl
| Download URL | unilinalg-1.1.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 142.2 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0ba1aa36af417516e999d9019d1a8ce731585d95b1fb3edd6b66432344ae3c36
|
|
BLAKE2b-256 checksum How to use checksums |
f8e423225cba5f0468fadf109316f6df5a31e394267ac7d0e6f078ad92adf477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp313-cp313-manylinux_2_35_x86_64.whl
| Download URL | unilinalg-1.1.0-cp313-cp313-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 767.7 kB |
| Tags | CPython 3.13 Linux glibc 2.35+ x86-64 |
|
SHA-256 checksum How to use checksums |
e677dde47e5c5a7399f11f6867bc184542d3d3701aaa7f9df932fcfaf29dbd3b
|
|
BLAKE2b-256 checksum How to use checksums |
2d007056f4ffce95ba3bf12200f222e2c5acd635de96eebf3ec9c16f4ec87bbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp313-cp313-macosx_10_13_x86_64.macosx_26_0_arm64.whl
| Download URL | unilinalg-1.1.0-cp313-cp313-macosx_10_13_x86_64.macosx_26_0_arm64.whl |
|---|---|
| Size | 275.2 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e0ffd9b8e4bff023a89dd7a2526f0c67bcb9b89ea1a9fd1283ce90fc10850c5
|
|
BLAKE2b-256 checksum How to use checksums |
1205e056ec23025fba25a490a942bdb1b966c4fc50e69294559256cc4d457bef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp312-cp312-win_amd64.whl
| Download URL | unilinalg-1.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 142.2 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9cfe7e3579b60a275b3009b4b07ac03936f79de1b9e53361bfa0d67c360bb495
|
|
BLAKE2b-256 checksum How to use checksums |
5469a7b6f3664e5a594378b255dfee0f00e790164a233826b2217b8203c060d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp312-cp312-manylinux_2_35_x86_64.whl
| Download URL | unilinalg-1.1.0-cp312-cp312-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 770.0 kB |
| Tags | CPython 3.12 Linux glibc 2.35+ x86-64 |
|
SHA-256 checksum How to use checksums |
ba9d18319c464dad82f0aaf840075f4824a12ab45c933b835d72a48e4a36d16d
|
|
BLAKE2b-256 checksum How to use checksums |
97ab3707a222daa8674ef92154cadf2a67c8f8d740258c55d3694e017c1b6557
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp312-cp312-macosx_10_13_x86_64.macosx_26_0_arm64.whl
| Download URL | unilinalg-1.1.0-cp312-cp312-macosx_10_13_x86_64.macosx_26_0_arm64.whl |
|---|---|
| Size | 274.0 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b135a8810332aa62cd5a8b6d2e5cd942ff670e82ab43d8f7813426ba05d06176
|
|
BLAKE2b-256 checksum How to use checksums |
c6b397c9bb344e7c0104812dc7b97f58ed4356f5a10bb9051485ae168fbf698f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp311-cp311-win_amd64.whl
| Download URL | unilinalg-1.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 140.8 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b352ad0a0b6861ebeeb9653ec0841c782181b249c8c05a3d7dadde5cefdfadde
|
|
BLAKE2b-256 checksum How to use checksums |
1f0fcf0bbd0b806a0630af9b81231e08b4800a8b2a2ba84829e466c82aae766b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp311-cp311-manylinux_2_35_x86_64.whl
| Download URL | unilinalg-1.1.0-cp311-cp311-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 793.4 kB |
| Tags | CPython 3.11 Linux glibc 2.35+ x86-64 |
|
SHA-256 checksum How to use checksums |
0b13a36ab7b830a10ade7b9b1423caa28e77276971ce054edd66a69f5d0bacd8
|
|
BLAKE2b-256 checksum How to use checksums |
3428228dff0b89affb46c88a31d7de3ca15432a5b533b6ec639b7e1d0e2cfe7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp311-cp311-macosx_10_9_x86_64.macosx_26_0_arm64.whl
| Download URL | unilinalg-1.1.0-cp311-cp311-macosx_10_9_x86_64.macosx_26_0_arm64.whl |
|---|---|
| Size | 274.2 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5a03c551454167198210cd64276d2d619843c12557be2cdf8bed4d6f0f9e85dc
|
|
BLAKE2b-256 checksum How to use checksums |
732c74124fd3141d745c97071323be660567c6014935d25f1e87684929a3e96a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp310-cp310-win_amd64.whl
| Download URL | unilinalg-1.1.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 141.2 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6ea2be6a7b83ed7e9d2138d6d5d8d3db12ac534d2aaedad3fb70fd8d3bbb60fd
|
|
BLAKE2b-256 checksum How to use checksums |
4a48b64f4772ae654cc6ada2ca5ae4ab47aab02ac548718be4ee0b3569682786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl
| Download URL | unilinalg-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 753.6 kB |
| Tags | CPython 3.10 Linux glibc 2.35+ x86-64 |
|
SHA-256 checksum How to use checksums |
89858c8693e738c36216bdebdf5bdf8a6f557eae9852172330c211b6a54c68b7
|
|
BLAKE2b-256 checksum How to use checksums |
d9f867764d26703041c49e8f9962d1e204dfdb7d3410cf9e9feb217330ac1c18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / unilinalg-1.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_26_0_arm64.whl
| Download URL | unilinalg-1.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_26_0_arm64.whl |
|---|---|
| Size | 275.0 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
96a11a9a6443dd1fcf083d8e8879358b07457e9335216b68dc3e0b1c4df74692
|
|
BLAKE2b-256 checksum How to use checksums |
1c163bc15f5201b4a7fce051ad9fa99ee1747571c35c700dee396b89e5b24c65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency log