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.

license tests codecov docs version PyPI - Python Version

Install

Recommended way (because it includes faster C/FORTRAN bindings)

conda install pfapack

Alternatively use

pip install pfapack

Usage

from pfapack import pfaffian as pf
import numpy.matlib

A = numpy.matlib.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)

If installed with conda, C/FORTRAN code is included with Python bindings, use it like:

from pfapack.ctypes import pfaffian as cpf

pfa1 = cpf(A)
pfa2 = cpf(A, method="H")

print(pfa1, pfa2)

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

Uploaded Source

Built Distribution

pfapack-0.3.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pfapack-0.3.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for pfapack-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e4685a2aaacbeaf9e23d4cb925c6bfb5b276a2e9ebac8dca08958cd6d4e5db7b
MD5 0d3bf5f644cfde6db3bbd26cfcc1c1fe
BLAKE2b-256 2b82c37863481ba47caef992e7647a3b421194b7e85a79f567af635cdb79c38f

See more details on using hashes here.

File details

Details for the file pfapack-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pfapack-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for pfapack-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86618a39dc62eaa2b1e865d1b1a664dcfac32d6c43893b3e26023a2d4ea7e1a8
MD5 e8c8ebe3e6b2e39db1ce10b8872800f8
BLAKE2b-256 eaf0324e25217785032641686cfb1bf20f898eba3993b969aa9bfe2b578615e9

See more details on using hashes here.

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