Skip to main content

Python bindings for the libsparseir library, providing efficient sparse intermediate representation for many-body physics calculations

Project description

Python bindings for libsparseir

This is a low-level binding for the libsparseir library.

Requirements

  • Python >= 3.10
  • CMake (for building the C++ library)
  • C++11 compatible compiler
  • numpy

Optional Dependencies

  • OpenBLAS (recommended for better performance)
    • macOS: brew install openblas
    • Ubuntu/Debian: sudo apt install libopenblas-dev
    • CentOS/RHEL: sudo yum install openblas-devel

Build

Install Dependencies and Build

uv sync

This will:

  • Install Python dependencies (numpy)
  • Build the C++ libsparseir library using CMake
  • Install the Python package in development mode

Build with OpenBLAS Support

To enable OpenBLAS support for improved performance:

# Set environment variable to enable BLAS
export SPARSEIR_USE_BLAS=1
uv sync

Or for a single build:

SPARSEIR_USE_BLAS=1 uv sync

The build system will automatically detect OpenBLAS if it's installed in standard locations. If OpenBLAS is installed in a custom location, you may need to set additional environment variables:

export CMAKE_PREFIX_PATH="/path/to/openblas"
export SPARSEIR_USE_BLAS=1
uv sync

Clean Build Artifacts

To remove build artifacts and files copied from the parent directory:

uv run clean

This will remove:

  • Build directories: build/, dist/, *.egg-info
  • Copied source files: include/, src/, fortran/, cmake/, CMakeLists.txt
  • Compiled libraries: pylibsparseir/*.so, pylibsparseir/*.dylib, pylibsparseir/*.dll
  • Cache directories: pylibsparseir/__pycache__

Performance Notes

BLAS Support

This package supports BLAS libraries for improved linear algebra performance:

  • With OpenBLAS: Significant performance improvements for matrix operations
  • Without BLAS: Uses Eigen's built-in implementations (still efficient, but slower for large matrices)

The build system will automatically detect and use OpenBLAS if available. You can verify BLAS support by checking the build output for messages like:

BLAS support enabled
Found OpenBLAS at: /opt/homebrew/opt/openblas

Troubleshooting

Build fails with "Could NOT find BLAS":

# Install OpenBLAS first
brew install openblas  # macOS
sudo apt install libopenblas-dev  # Ubuntu

# Then force BLAS detection
SPARSEIR_USE_BLAS=1 uv sync

OpenBLAS not detected automatically:

# Set CMake prefix path manually
export CMAKE_PREFIX_PATH="/usr/local/opt/openblas"  # or your OpenBLAS path
export SPARSEIR_USE_BLAS=1
uv sync

Verify BLAS support in built package:

import pylibsparseir
# Check build logs or library dependencies to confirm BLAS linking

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pylibsparseir-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pylibsparseir-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pylibsparseir-0.1.0-cp313-cp313-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pylibsparseir-0.1.0-cp313-cp313-macosx_13_0_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

pylibsparseir-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pylibsparseir-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pylibsparseir-0.1.0-cp312-cp312-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pylibsparseir-0.1.0-cp312-cp312-macosx_13_0_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pylibsparseir-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pylibsparseir-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pylibsparseir-0.1.0-cp311-cp311-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pylibsparseir-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pylibsparseir-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pylibsparseir-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pylibsparseir-0.1.0-cp310-cp310-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

pylibsparseir-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

File details

Details for the file pylibsparseir-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f13b454f6232bc4e8193018ebb1eed1ebb0ab707c5d7be7c9211551f230b6bdf
MD5 c9d15a5e24f7895cbac6e852a760e30a
BLAKE2b-256 ef9e3bce469ebd29fcf949de5fee12a49452128f75be602f877fa309014114d6

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f51120ff0a439f69d7ec20317b6b629ceeeef85c187e619fbae47599d7517269
MD5 c508c0cae695d5a3c8a636e70ec595fc
BLAKE2b-256 b38f6ee1bed66215cfbd1d78a394df7b9881ebec4c35221c01e59d5908702b83

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5202decdd84309ad2dca2f7d2dd998899e82508f95d5315fb73a38c717fd39c3
MD5 2ecc153661cb49f1902f465f664bef1e
BLAKE2b-256 716ff98efcc3096b6ae28e3a7d3839e93e1446848d29c2a3667f80d6d80992ce

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 693e27e9b510343c462ac335a2cda8405f305e192abaefe9057c717f91ac325d
MD5 af2a00ad77a2cb19a77928d9f75a44c8
BLAKE2b-256 32be3548b984f084ccb8d80380eea5d5cd6250036a00e1c8543fc7e605ccfaa4

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 83ec133df45e3fa29ed217d27792bba6928d41a181617380c47fd13163945165
MD5 67d841edb0b3906d9d8f199d54ed9a35
BLAKE2b-256 c0baa7af668ecc1a50bca5457ca5c45ddd0c3a21d45d864608c96f53fb1635d4

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b859ae007b300fbe3240bdae8ad327564240b352000fed37edf498fef04ef1f
MD5 ed8df49b7f994c2c117a8f891173e960
BLAKE2b-256 623337683ce1a23b0221ae1c0b7e0e85e649c36afe69e79de9a0485bf8e33527

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0c795cc7d26ca175ad7423c85c5588063be5163d27ea04b0e5f92f57801f0f5f
MD5 ed0dbb7e2eb7e3d6ba22a03311a1d903
BLAKE2b-256 e4937f47458d7de14a4082f4eaf03e3b1131f8d0eb5c8418019634e94d79974a

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f0ccdf4b5002428676310810ffeaac2ada37d2457601f50c448078c40ccb86aa
MD5 52aa5c9e447e86c26052eb087f397ee2
BLAKE2b-256 dc68a4475f17927b7d8e2597dac5ca48ef2037dc773675937d0da0494ed8ea4d

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d705e705ac74bf10fe12d2d1ceccae4c72514dd6876e7c7f1f4950944cbd3f22
MD5 8fedc6ff81820f6e4dd9281bac9b1bf2
BLAKE2b-256 4140ad0ad9929d63d0c3b8405b6dda5531ce1d749b9c583bc9ad8e9fe01b9cfd

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 42c70d24cf4919d76a884fde992ee1c5d6c4d95209bc4d53724824d6122ca114
MD5 465bf163dd8e672b2869513a204f8cfd
BLAKE2b-256 adcea8c5ae08898fa429086f6a132bfd8f23b2495a4779e43353f03c9497e787

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2ab07fac466e62bcf3613490d22ee1a9f102b5689dbe0f48d3d8f605ff343db1
MD5 d5c5f6691925241e783c389dfa7f36ee
BLAKE2b-256 1e25903bbf2aa319e02ce43bf02d9c8fb5aaf9f1945acebd493b6ecea4bf8a18

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9b5cb73f80428230569de23a9f53867c4f6e954159624ce07e211b2550af619c
MD5 e53406040c614e5f643b897a7922607f
BLAKE2b-256 fce0538a262b34e4283ae2447f44e57d5584a4e87e56bac30f18cff7629c2b26

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4c4b28be196fa1682a860a5ddf41572884b1f061f95fc0940ca32e6e7cdc421f
MD5 6693ad9de151bd725e7fed325f7765a2
BLAKE2b-256 b90349884e0ef2f752298f11360dd4512a94c3019499be3b61faedc033148e21

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aea3f95d7bf75a67426c603454497a797586c1225e3a888d7559968a01d693c4
MD5 ad31803a32668c472d68e43b21eb9b69
BLAKE2b-256 9851af030c849287b4a93f2bda9f00afad3a5974986c3a21482e30048de20449

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2b8338d4ba3e9fbc218035a6aed783700661912e1e9cc7d0efcbd09b5e07596c
MD5 f29176511b371726d8b1b9293fe9823c
BLAKE2b-256 ec5b5a600f7d135d73af8d907d5c973321f945289a0d736c8a90d09662540b38

See more details on using hashes here.

File details

Details for the file pylibsparseir-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pylibsparseir-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8bedca06546b44e2e88512e96aa326dddb37267d5e505b9febfedef52f47a09b
MD5 ead2259f374e35c4a1b9748615245fc0
BLAKE2b-256 f78ffd61440ba1334a2908e71b2510c117329ab87d9327000057a6021d3cb6c9

See more details on using hashes here.

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