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

Uploaded Source

Built Distributions

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

pfapack-1.1.0-cp313-cp313-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pfapack-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pfapack-1.1.0-cp313-cp313-macosx_15_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

pfapack-1.1.0-cp313-cp313-macosx_14_0_arm64.whl (867.7 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pfapack-1.1.0-cp312-cp312-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pfapack-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pfapack-1.1.0-cp312-cp312-macosx_15_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

pfapack-1.1.0-cp312-cp312-macosx_14_0_arm64.whl (867.7 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pfapack-1.1.0-cp311-cp311-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.11Windows x86-64

pfapack-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pfapack-1.1.0-cp311-cp311-macosx_15_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

pfapack-1.1.0-cp311-cp311-macosx_14_0_arm64.whl (867.7 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pfapack-1.1.0-cp310-cp310-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.10Windows x86-64

pfapack-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pfapack-1.1.0-cp310-cp310-macosx_15_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

pfapack-1.1.0-cp310-cp310-macosx_14_0_arm64.whl (867.7 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: pfapack-1.1.0.tar.gz
  • Upload date:
  • Size: 174.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfapack-1.1.0.tar.gz
Algorithm Hash digest
SHA256 849d136e6a195729a1de00d81d51d3625ac9855a237360c4623d54103f4ad833
MD5 befbd32e71834ccdc96ec6c42096bc89
BLAKE2b-256 7e58d366c0b826957f62e66601319a88d424ca1b662f49c75b891737cce11fd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0.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.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 316.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfapack-1.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 83342da86cef24a7789dbe74d72f7f7da27b47c3e7494c71a38affb843147fe1
MD5 408c5c067d6b76a3fa4ebfba33ef5a18
BLAKE2b-256 c5a30a0eadaf3587f66905cb3728d34df9f2fe3cd0a928fceea941b35d7bf34a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c00163a385ecf7893b324752ed5c94b233b66fb8b92c063b2bab6e2767c6f053
MD5 caecd63d7da9cc4c00f30e7f12fcbef0
BLAKE2b-256 e0d29a7a776e7e769328678c0b9152aa0d2a50cdd7e57e44c244d2d3e75008bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp313-cp313-manylinux_2_28_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.1.0-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 786279636cdc7882038e9edd1f7ea53cd342c7c3f294f5b7db5c9cf47578c8c8
MD5 9b77f978fa55fb1c2c13aaa53bf017fc
BLAKE2b-256 b7e629dfd40a176fe7cee48373493733398db6442a5bc1b2d56a716d47c23fec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp313-cp313-macosx_15_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.1.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 707fdb4e073248a118115ab15b8d88d91929f17535a5d55440e1d771b47de3fd
MD5 e6dd5941a239765032b87b4eb4739ed3
BLAKE2b-256 3713a50c99e0ab33c0960ee8b77031a5a8997593db1a7c7da3f557094c28bc33

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 316.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfapack-1.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 87483232f1b4d98c1f3b962c761c280c2e0070f1104210699234a230136ef352
MD5 2a90504e6d98320b5ab7f2b5186c4d3c
BLAKE2b-256 15ab66b24233296c4f9db4f6ad1711b7ae23b0f1430b1ae05ef8f3a9cd7933f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 62becf9036c1e7cd1bf5ec160d80df4484b0e8bc93a14269e4cdf4154f1991f5
MD5 8ec4b961b97dc2adae12528414d02cc1
BLAKE2b-256 02ba2f5201b9996adae93646c2396959b446da26b7a4045013b31db12a917cf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp312-cp312-manylinux_2_28_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.1.0-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0e4fd46f296431a78f5a51c6d8dce01910cfa61e41becfd9d55d13ef0ef46188
MD5 39c19636d13899a7b3497617fd5693b7
BLAKE2b-256 04755372a73615e5d81a2a55dc4b29f3aa94c5cc2e1d15f9166aab21f4b4e365

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp312-cp312-macosx_15_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.1.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fa380df0709f3f3c387bd08f2a9a09dc76ee846655456c8155256e6b5cdd6d32
MD5 a39316613f10f6dadd3ea640f57b88ba
BLAKE2b-256 85faea6c648e1e91375a6d5c102586f236bf846d449848574a9461fb5241eda6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 316.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfapack-1.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ea991bf7f72eb7ab270e70a06e9833ac1fe4998fc6c554759b10d5588fc78771
MD5 15c7bef4f04af5391dd979e8fa4d9b3d
BLAKE2b-256 c3f9d9a96bbffa653df3a6f9a883951a9eed3a44bca1c9567bfb2b09867f9ce1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ecff988b8c067bf946f0154227e5418837d026b551fed2574b0744ab313003cf
MD5 55d43e8c03a67e87645b93a1e725120a
BLAKE2b-256 a725993c5b71256ec4df0148ae77b1b5ac1e7aeb8f6049d6b9dce62438009207

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp311-cp311-manylinux_2_28_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.1.0-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d75eb0595f923391e30b4c4a64c4c51e557225660e2fb11e842ffed5a04de661
MD5 2ebe5dc4f8392b3582d2c65f11fe1235
BLAKE2b-256 fc74c6743d8ca4733a492fe0c3979b11fdb31dd8c5c58e26c67084c1428c1374

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp311-cp311-macosx_15_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.1.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 980db98323b0e9159b7e52ead087d1ae4d6bfd71a96731389841b684c42027c0
MD5 ebb5ce9939ce4acf94b779c5dc8a7d4c
BLAKE2b-256 7b2e7829661d7fefc06de30e6f53d1fd9c8fd5799b5fe714f7a2916491efd074

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pfapack-1.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 316.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfapack-1.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1314cf60ee44023bf8391d9733418986753d59745b78862e12fd64d52568d589
MD5 6e7fe263464778bc4405a35c9aa27569
BLAKE2b-256 d936532191896fa450efb98da686d5f6725f31eadde724a0e55fbf0d3a41279e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e63161d3a2ca938b2aefac46f98636be573991b008ae8cbc8e0e4975fb43e1bc
MD5 0c61850deac8b9b47c98d8de8ae545b3
BLAKE2b-256 02fcd564003e5f40afc32dab7f551dc85f71879158b273cc5423e52e48ec81c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp310-cp310-manylinux_2_28_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.1.0-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f33a7198bb99a235ddc72af90aa9f78679cf343bb735e010fc716fb89481ee9e
MD5 b24163b7fb04f21099267866a3ca6c97
BLAKE2b-256 bffc610c22234e25cb8e7d1cb91e89c88464d8513d8883469a04fc931896832a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-cp310-cp310-macosx_15_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.1.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pfapack-1.1.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 acb37ace240f4e63aa81043451f536928d7313544e2faf1ee33fd34cb38c76f7
MD5 f7b02b5ddfeabfae96c0b365151c11b7
BLAKE2b-256 b0cdac9929fdb33ebebf1552c87651a509d0cb1e8fc26f87205b718e3716baa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfapack-1.1.0-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.

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