Skip to main content

Python bindings for SuiteSparseQR.

Project description

pyspqr: Simple Python Wrapper for SuiteSparseQR

import scipy as sp
from pyspqr import qr

A = sp.sparse.random(1000, 1000, format='csc')

Q, R, E = qr(A)

Where Q is an orthogonal linear operator represented by Householder reflections plus a permutation, R is a sparse upper triangular matrix, and E is a permutation linear operator. They are used as follows:

import numpy as np
from scipy.sparse.linalg import spsolve, spsolve_triangular

x = np.random.randn(1000)

assert np.allclose(Q @ (R @ (E @ x)), A @ x)

assert np.allclose(
    E.T @ spsolve_triangular(R, Q.T @ x, lower=False),
    spsolve(A, x)
    )

We are working on offering an easy interface when the input matrix is not square and/or not full rank, and the user is interested in a least-squares or minimum-norm solution. (It’s already doable also in those cases with the current outputs, but it’s not too user-friendly.)

Installation

pip install pyspqr

We publish compiled wheels in PyPI for all the major platforms, including Windows and ARM64 Linux. See here for all platforms and architectures available. They “just work”.

We use ABI3 reduced Python3 API and the newer Numpy2 ABI, so the wheels run on any Python greater or equal than 3.6, both with Numpy 1 and 2.

Wheels ship bundled with the latest version of SuiteSparse, compiled in CI/CD by this repository, and also include an optimized multi-threaded OpenBLAS, which is used by SuiteSparse for supernodal operations.

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

pyspqr-0.1.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distributions

pyspqr-0.1.0-cp36-abi3-win_amd64.whl (8.9 MB view details)

Uploaded CPython 3.6+ Windows x86-64

pyspqr-0.1.0-cp36-abi3-musllinux_1_2_x86_64.whl (13.0 MB view details)

Uploaded CPython 3.6+ musllinux: musl 1.2+ x86-64

pyspqr-0.1.0-cp36-abi3-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.6+ manylinux: glibc 2.28+ ARM64

pyspqr-0.1.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

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

pyspqr-0.1.0-cp36-abi3-macosx_14_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.6+ macOS 14.0+ ARM64

pyspqr-0.1.0-cp36-abi3-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.6+ macOS 11.0+ ARM64

pyspqr-0.1.0-cp36-abi3-macosx_10_9_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.6+ macOS 10.9+ x86-64

File details

Details for the file pyspqr-0.1.0.tar.gz.

File metadata

  • Download URL: pyspqr-0.1.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyspqr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8a335bf06a3f8101d105937a6d869e8231511dca9e6037a78cded3cb60b4da2
MD5 8b8f18749e9c807c28def4be075f4e1c
BLAKE2b-256 6feae6072e899e9e2d45a509be6309f301af716c65f5cf233ea4221d906a7e33

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0.tar.gz:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-win_amd64.whl.

File metadata

  • Download URL: pyspqr-0.1.0-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 8.9 MB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 156dc76879dde0a14c2d21cf4c2969a0fd1f7f3ac85433d810792935a555422e
MD5 d695ec5031589962a7054ac7f6b3df2d
BLAKE2b-256 24c64756ec88abfb420b0647db83bb76bcc17e313059331f6b647f1d573624c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-win_amd64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 32c7cc66049b368d1d572a265d39becf3e28e4a185f3f0fc723abafe454ab5de
MD5 32e14c3a6129331011fc762f3a52d8d5
BLAKE2b-256 1cce22772b56f9f06105a3c9c70b173769c46c0de3afaf0ae9c854eef511816c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-musllinux_1_2_x86_64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b4353fcbc4fcf9d4c08dd3a6aa856468f03edd3db8c24e87070f7a5aa9b35a08
MD5 977b49144b61a5b41224c000aaf97f5b
BLAKE2b-256 8e9f83b27c1918d64a4daff71994b282d0914a7027e940a8847dc6cefdaad6ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-manylinux_2_28_aarch64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bb60dc5c282c51f4dd1aa497ae5e773849ad03a2e3ffd733d36d01b7cfdefdd
MD5 8e1a16f77c979ddaaf5feda6878d4ed6
BLAKE2b-256 ddf4cbb28b6676b8b6add8fa8b03899a60b207279a87843931f04a986736ad9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d6456d021b024c58a50135264321bcaa418e1ef2d8923eeb2c81a2d37327d1e6
MD5 fdcd04da4eb412187710969526d7e7bb
BLAKE2b-256 3e11d5a988e27e6f33a812941add7309a440620cab5862fd9533090d3f4ed38b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-macosx_14_0_arm64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3880b7c67ac4fdd158dbcb38abf1ec2a04f350537e944fc01db53ffd1b3d11b
MD5 3610d64f4f81693254959592f487e1b7
BLAKE2b-256 993b297bc2aabb5947130d4341324064f0bb4dbfd748c5897085a6592ccee986

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-macosx_11_0_arm64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

File details

Details for the file pyspqr-0.1.0-cp36-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyspqr-0.1.0-cp36-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6584802c5799fc8020c0ef6285af9adc160ce4347d57dfff1cd4dcae0cb426d
MD5 27cbea1eaa1bb9e26e8501a73fa49952
BLAKE2b-256 ee581182a0e9fd0979ccbfb07133661982cf8701c5618418dbc5b20933a24d1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspqr-0.1.0-cp36-abi3-macosx_10_9_x86_64.whl:

Publisher: cibuildwheel.yml on enzbus/pyspqr

Attestations:

Supported by

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