Skip to main content

Efficient numerical computation of the Pfaffian for dense and banded skew-symmetric matrices.

Project description

pfapack: Efficient numerical computation of the Pfaffian for dense and banded skew-symmetric matrices

Code and algorithms are taken from arXiv:1102.3440 which is authored by Michael Wimmer.

pytest codecov docs version PyPI - Python Version Ruff

Install

pip install pfapack

Or using conda:

conda install -c conda-forge pfapack

Usage

from pfapack import pfaffian as pf
import numpy.random

A = numpy.random.rand(100, 100)
A = A - A.T
pfa1 = pf.pfaffian(A)
pfa2 = pf.pfaffian(A, method="H")
pfa3 = pf.pfaffian_schur(A)
print(pfa1, pfa2, pfa3)

The package includes optimized C/FORTRAN implementations that can be used for better performance:

from pfapack.ctypes import pfaffian as cpf
pfa1 = cpf(A)
pfa2 = cpf(A, method="H")
print(pfa1, pfa2)

[!WARNING] On Windows, the C bindings require MSYS2 to be installed with the MinGW64 toolchain. The current Windows build system has some limitations and requires external dependencies. We welcome contributions to improve the Windows build system, such as using Microsoft's toolchain (MSVC) directly or finding better ways to handle the OpenBLAS dependency.

Citing

If you have used pfapack in your research, please cite it using the following bib entry:

@article{wimmer2012algorithm,
    title={Efficient numerical computation of the pfaffian for dense and banded skew-symmetric matrices},
    author={Michael Wimmer},
    journal={ACM Transactions on Mathematical Software (TOMS)},
    volume={38},
    number={4},
    pages={1--17},
    year={2012},
    publisher={ACM New York, NY, USA}
}

License

MIT License

Contributions

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

pfapack-1.0.2.tar.gz (173.0 kB view details)

Uploaded Source

Built Distributions

pfapack-1.0.2-cp313-cp313-win_amd64.whl (204.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pfapack-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pfapack-1.0.2-cp313-cp313-macosx_14_0_arm64.whl (867.6 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pfapack-1.0.2-cp313-cp313-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

pfapack-1.0.2-cp312-cp312-win_amd64.whl (204.5 kB view details)

Uploaded CPython 3.12Windows x86-64

pfapack-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pfapack-1.0.2-cp312-cp312-macosx_14_0_arm64.whl (867.6 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pfapack-1.0.2-cp312-cp312-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pfapack-1.0.2-cp311-cp311-win_amd64.whl (204.5 kB view details)

Uploaded CPython 3.11Windows x86-64

pfapack-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pfapack-1.0.2-cp311-cp311-macosx_14_0_arm64.whl (867.6 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pfapack-1.0.2-cp311-cp311-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pfapack-1.0.2-cp310-cp310-win_amd64.whl (204.5 kB view details)

Uploaded CPython 3.10Windows x86-64

pfapack-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pfapack-1.0.2-cp310-cp310-macosx_14_0_arm64.whl (867.6 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pfapack-1.0.2-cp310-cp310-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

File details

Details for the file pfapack-1.0.2.tar.gz.

File metadata

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

File hashes

Hashes for pfapack-1.0.2.tar.gz
Algorithm Hash digest
SHA256 43a91649eb9d21ddaaa0b302436e0b2c2fe162c42a5c02b747fa6bf3672fff39
MD5 e9e4071675c48cc5320a6ab9c922779c
BLAKE2b-256 43d8f7ee33420bf9043a672bd8115c4734e4ac0938a1384f1d6a34361ee1729d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2.tar.gz:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.0.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 204.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pfapack-1.0.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 72de4de4a8f226f19de1d3ab823f83cc6e1c1fa479388f106b727dc5df6c1da0
MD5 b0b2f7fdf44fd8863db37d10c9647164
BLAKE2b-256 243c9805da5d96482cc58448a6912ee284250e01e092d1a2081d7b0349f10897

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp313-cp313-win_amd64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44f43c871e6517e47dbd4a0ee7a2bb670619ddf0e2b7ba77f5424f5da0a37d7b
MD5 4b14c2d2b51a6c9b09c62c0bd9bb407b
BLAKE2b-256 2d1241a6bbe295baba822922c23d454826d2c5b71ddbbf30a98514dad9dc5f93

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a43fc8f408ae6be10fa27e4d36d4943aed0443afe7404f9a1fa99fde2806e680
MD5 eeebcf662d33df61785a4839d2094f4b
BLAKE2b-256 5982e28d3b3d85be5e1a2e59a205762dc3ea43d841fce4077b8d7b5ad48ae58c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f5cbedfa65eef48d4fb0db54a73d5be930566bfbe078f6033fb9bbd008b7bd4b
MD5 ec93ed1a2f14d9c1473247d6505a6092
BLAKE2b-256 ee899cff36bc2b241a59c1f1c2ae56c12d1b68dd6907715d8ec4a3836e6c2654

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp313-cp313-macosx_13_0_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.0.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 204.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pfapack-1.0.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c7f7f82493ebe96c98297db9475e634c5fecb7864fb66ddff0620aeeae7d07f9
MD5 532663bd37b6d17aaa64eb0e572fc3e6
BLAKE2b-256 4527cf42f06c88eef88117037ae6923ecc8c934a2a98cf6e3ff6745aac89670d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp312-cp312-win_amd64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa82297dfdb91a744fa0167cd03308601262c810886ee9a901853f56ece848ca
MD5 c56235b1191798c65f17ed3fdf1bd1aa
BLAKE2b-256 d423bfc2e767c55539d76b1a9722fd61eea9e247f61c9cf710e93178c8b0f3ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6becc2138326036bd9588037d0e8b12809942e7bce1b04155ed4799a01848585
MD5 bfcd55dcf01a1a371c9f4b8bcbd15ad2
BLAKE2b-256 ff0793460a11262bf58524bee1b8bf37e990c3b46d4e76a67fc334fe40345ba5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 aa32f109eb44b86c1af331424d78285cec2e17449ca018f626b98fb82d53e452
MD5 f18260efa74a07ae18163b89cd5850d1
BLAKE2b-256 6754498fb0047d8079c1dd3750319d704a8be8520a967f28a4324f0f99678137

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.0.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 204.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pfapack-1.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d285c4eeb0c771414270795f8dff0c8524c5d364e795b5d405b9aaf52abcb3f6
MD5 d79225544101008b7e481463aca9e2bd
BLAKE2b-256 e98bb0e0ffeb7dc25885c0fba9909546d4b1ebd38b6b0f7b23efc197caf4804b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp311-cp311-win_amd64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 68829b5864a5cdf2ef06d2f31ff68e48398a0234dfbfead9f21b0321a119c3bc
MD5 5bbca9cde258c457e2accebc02bbe869
BLAKE2b-256 cb7004bb4b34b0d27ec254100407509ba2e05dcc02b051c459ade0bbf556311d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9649402579ba58b4926bc26eea4c25a8ce2605573fa6dc5866b5e26edf8fcf30
MD5 f0b25862a2c8ed3ea31fddeea45c07e4
BLAKE2b-256 60121e5559750a1f03ca2fe1e2f14d09411f32a32c835f3222c0956e5274ef20

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 db7028e54c3e8f8ef6a37fd9ace8dcc12f8020e28ef7390ccb240f7ad3a5dd4a
MD5 6abfa959069969f60d6d8243489607fa
BLAKE2b-256 81f004b509514094248aca8ca6a2faf8da840e9d8c8c3073b154f0ff1e590319

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.0.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 204.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pfapack-1.0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d44b6c077afd278d8d56df81e5b14b8cd6cfd16ec40ae81d17cc2010624be9cf
MD5 75ee0494a54f8131244b5a396a4224e1
BLAKE2b-256 35a102df78e08c09aec27e41ceac569c223a72812b88be0452072bf1b7a99f13

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp310-cp310-win_amd64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35a2b6a3e14b234343274f7041a2b63e0b689858abcb62b6f95a6bd970d4a582
MD5 8c85baae821d782dc4dde21b1cf71bdd
BLAKE2b-256 8ce48a61ac80aeaf1d56e2dccca813e11014d00a6d68662fcbd5fbaaf146790d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4792a69cea926ab1729726f36eb2fc69db2b8e63b412df0ccb390dc56c34e079
MD5 3c1f79f2fe39f2c7ec97c4ffa7c6e137
BLAKE2b-256 6f6f0c1800a6daecb517a7699b9bb7f4a1f7ce6cf6b14271d5bf50d5406f142e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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

File details

Details for the file pfapack-1.0.2-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.0.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 72af115d864446eda07030b10434b53c269c753a5c5973b3a8eb361ffb1e9d15
MD5 1ee5e143c6de00f019a162ed6fb85f89
BLAKE2b-256 777a8a6f64272f5a7d47f6dc09ed313a1a391cb7230b6f2a58a028c9b49b4ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.0.2-cp310-cp310-macosx_13_0_x86_64.whl:

Publisher: build_wheels.yml on basnijholt/pfapack

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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page