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.2.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distributions

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

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

Uploaded CPython 3.6+Windows x86-64

pyspqr-0.2.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.2.0-cp36-abi3-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.28+ ARM64

pyspqr-0.2.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.2.0-cp36-abi3-macosx_14_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.6+macOS 14.0+ ARM64

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

Uploaded CPython 3.6+macOS 11.0+ ARM64

pyspqr-0.2.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.2.0.tar.gz.

File metadata

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

File hashes

Hashes for pyspqr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4a181aa3a38f7c02e2a1be3a798a9f84c547c381abdb2bec82bbc739d4410728
MD5 10f921fb3e86d002a54730bccb310708
BLAKE2b-256 86843b5666bee73d0e14afc6b61c01f01cbc44eb360010e047a46eb4a74106b6

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

  • Download URL: pyspqr-0.2.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.2.0-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9491833d50250549e5f2a9c013b784da55358bd520eeef778849673afd51c374
MD5 c7e2ad26072617cd0778c22cfed7c1a5
BLAKE2b-256 3d0a7f195801588a9fd05a6242e0b5132cb30e7f5c68af240f7d16e6c60d994f

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

File hashes

Hashes for pyspqr-0.2.0-cp36-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1b941f98299eb508910720a0a5785e71e3ee03295764953b73700555c5ec1496
MD5 f152e05544e528c84890efa8ecc35b44
BLAKE2b-256 4acb0ed2ea598d1057e67bcd90193a1a21250c5e9b83555952f7824d383ca906

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

File hashes

Hashes for pyspqr-0.2.0-cp36-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 12f7c01e7fdfde8a99ab57ea8026c56b0ab2f1c967980f3d972adb2ba39dce00
MD5 e2435faef03b658cd28ef7938af932b7
BLAKE2b-256 a1b660f36fd959c1da1cc6963a0013050fbcaf0cbd4cd430dccd985b5fc6b343

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

File hashes

Hashes for pyspqr-0.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73d05e5f63e5293d998ec18e54eca357b102528d827d50ccae217f2bb83f30d7
MD5 8239bbd268239c1a7d54b47b35677127
BLAKE2b-256 005247bce69423ef8e6bce11d6d719ce7ae4110d6c126572a11dd59ff8f6c754

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

File hashes

Hashes for pyspqr-0.2.0-cp36-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6944c41e8431c4dee8cb41636928383dddb153f7ffd5dcd3fccbf72dda86fca6
MD5 ee06001e8d0439deda2aea8f56680d7b
BLAKE2b-256 c8532ffb8ee7f0b297f20ad8a3c62a0818824722905fd81e2ab7c26cf6aeba23

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

File hashes

Hashes for pyspqr-0.2.0-cp36-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7232c7993e139aa9c86f96c14dfdfaf0e260c71196a34d7c24ec0d13df72f88c
MD5 ed3985e0edc087bebe647beb0284ffa5
BLAKE2b-256 628f68f246c3c39e671dca9aebb5241c4fb98972d98f271240fefd1f9d3bf106

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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

File details

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

File metadata

File hashes

Hashes for pyspqr-0.2.0-cp36-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 66a39076aaa3826059e89ed9e8d2e9c3d2d015df9ac46b9d83f79002fd432c2a
MD5 c0477cd23d8efa9353b2e052e6b4be56
BLAKE2b-256 49b68fc5ff40984132e97478da6ada1d3c807906661b3f9637d4972c17fb40d6

See more details on using hashes here.

Provenance

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

Publisher: cibuildwheel.yml on enzbus/pyspqr

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