PyHank - Quasi-Discrete Hankel Transforms for Python
Edward Rogers
PyHank is a python implementation of the quasi-discrete Hankel transform as developed by Manuel Guizar-Sicairos and Julio C. Guitierrez-Vega
"Computation of quasi-discrete Hankel transforms of the integer order for propagating optical wave fields" Manuel Guizar-Sicairos and Julio C. Guitierrez-Vega J. Opt. Soc. Am. A 21 (1) 53-58 (2004)
It was designed for use primarily in cases where a discrete Hankel transform is required, similar to the FFT for a Fourier transform. It operates on functions stored in NumPy arrays. If you want an Hankel transform that operates on a callable function, you may be interested in hankel by Steven Murray.
I have used this code extensively for beam-propagation-method calculations of radially-symmetric beams. In the radially symmetric case, the 2D FFT over x and y that would be used in a non-symmetric system is replaced by a 1D QDHT over r, making the computational load much lighter and allowing bigger simulations.
PyHank was inspired by Adam Wyatt's Matlab version which I used for many years, before moving to Python and needing my own implementation. It aims to simplify the interface (using Python's object-oriented approach) and utilise existing NumPy/SciPy functions wherever possible.
It has both a simple single-shot interface, and a more advanced approach that speeds up computation significantly if making multiple transforms on the same grid.
Contributions and comments are welcome using Github at: http://github.com/etfrogers/pyhank
Installation
Installation can simply be done from pip. PyHank requires numpy and scipy, but these will be installed by pip if necessary.
pip install pyhank
For building the docs, the following are required:
- sphinx-gallery >= 0.7
- matplotlib >= 3.2
For development, and running the tests, the following are recommended:
- pytest ~= 5.4.3
- flake8 ~= 3.8.3
- pytest-flake8 ~= 1.0.6
- pytest-cov ~= 2.10.0
Bugs & Contribution
Please use Github to report bugs, feature requests and submit your code: http://github.com/etfrogers/pyhank
Documentation
The documentation for PyHank can be found at Read the docs
Usage
See the Usage examples at ReadTheDocs
Release files for pyhank 2.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyhank-2.5.1.tar.gz | 37.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhank-2.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.9 kB
Release files / pyhank-2.5.1.tar.gz
| Download URL | pyhank-2.5.1.tar.gz |
|---|---|
| Size | 37.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6eb9616e65a536215917a7f05ff161b37fe080448a46c1bd97741384fabff37e
|
|
BLAKE2b-256 checksum How to use checksums |
a5b8ec9e1e2a705ef85494489b8e5b398d1d539872d0434b7af9464c04657e1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / pyhank-2.5.1-py3-none-any.whl
| Download URL | pyhank-2.5.1-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d744271684e348b4a51024c2e17c6f1b3dafbbe05d6b29d97e68b62a39388bed
|
|
BLAKE2b-256 checksum How to use checksums |
ca3ca3440fbc5cd34d19945cff5ea8dd00850d12f327c1ba7360b5c8d2d421e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency log