QHOT
QHOT is a Python framework for holographic optical trapping — controlling spatial light modulators (SLMs) to create, move, and reconfigure optical traps in real time using a live camera feed.
Features
- Real-time hologram computation (CGH) with GPU-optional acceleration
- Interactive trap manipulation via camera overlay
- Modular trap types: single tweezers, vortex beams, ring traps, arrays, and dot-matrix text patterns
- Interactive display filter pipeline (smoothing, edge detection, RGB selection, sample-hold)
- Configuration save/restore via TOML
- Full unit-test suite (1400+ tests)
Requirements
- Python 3.11+
- A Qt binding supported by qtpy: PyQt6, PyQt5 ≥ 5.15 or PySide6
- qtpy ≥ 2.0
- pyqtgraph ≥ 0.13
- numpy ≥ 1.24
- scipy ≥ 1.10
- tomlkit ≥ 0.11
- QVideo ≥ 4.11.0
Installation
pip install "QHOT[pyqt6]" # or QHOT[pyqt5], QHOT[pyside6]
Holograms are computed by a backend. The default needs nothing more than NumPy, and each of these is faster, so install the one that suits the machine:
pip install "QHOT[torch]" # PyTorch: Apple GPU, NVIDIA GPU, or all cores
pip install "QHOT[numba]" # numba: compiled, all the cores of the CPU
QHOT uses PyTorch if it is installed, then numba, then NumPy. Choose one
on the command line with -t, -j or -n.
QHOT does not install a Qt binding by default: choose one with an extra, or install one yourself.
Or for development:
git clone https://github.com/davidgrier/QHOT.git
cd QHOT
pip install -e ".[pyqt6]"
Usage
qhot
Or from Python:
from QHOT.qhot import main
main()
Trap types
| Class | Description |
|---|---|
QTweezer |
Single Gaussian tweezer |
QVortex |
Laguerre-Gaussian vortex beam |
QRingTrap |
Ring-shaped optical trap |
QTrapArray |
Rectangular grid of tweezers with optional mask and position jitter |
QLetterArray |
Single dot-matrix character (A-Z, a-z, 0-9) rendered as tweezers |
QTextArray |
String of QLetterArray characters |
Project structure
QHOT/
├── qhot.py — Main application window
├── QHOT.ui — Qt Designer UI layout
├── lib/ — Core library (SLM, CGH, trap infrastructure)
│ ├── QSLM.py
│ ├── QHOTScreen.py
│ ├── QSaveFile.py
│ ├── QDocument.py, QImageFile.py
│ ├── holograms/ — Hologram computation
│ └── traps/ — Trap base classes and overlay
├── traps/ — Concrete trap implementations
└── tests/ — Unit tests
References
- E. R. Dufresne and D. G. Grier, "Optical tweezer arrays and optical substrates created with diffractive optics," Rev. Sci. Instrum. 69, 1974 (1998). https://doi.org/10.1063/1.1148883
- J. E. Curtis, B. A. Koss, and D. G. Grier, "Dynamic holographic optical tweezers," Opt. Commun. 207, 169 (2002). https://doi.org/10.1016/S0030-4018(02)01524-9
- D. G. Grier, "A revolution in optical manipulation," Nature 424, 810 (2003). https://doi.org/10.1038/nature01935
Acknowledgments
This project is maintained with support from the National Science Foundation of the United States under Award Number DMR-2428983.
License
See LICENSE.
Metadata
Release files for QHOT 2.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qhot-2.1.2.tar.gz | 222.3 kB | With provenance | Details for qhot-2.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qhot-2.1.2-py3-none-any.whl | Python 3 | none | any | Details for qhot-2.1.2-py3-none-any.whl |
Total release size: 376.1 kB
Release files / qhot-2.1.2.tar.gz
| Download URL | qhot-2.1.2.tar.gz |
|---|---|
| Size | 222.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
228762c4c66d1548f3d5bdca5aa4b40ae48c88d694c6942ea048ce5b306ab163
|
|
BLAKE2b-256 checksum How to use checksums |
748ecba8dc20bb233e33730ab5094b3eb7aa1dc254edc7fea8b2b7378a96c4a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 1, 2026.
Transparency logRelease files / qhot-2.1.2-py3-none-any.whl
| Download URL | qhot-2.1.2-py3-none-any.whl |
|---|---|
| Size | 153.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
804deef671f5e34059ca70a9470ab71fa452db5c2eff842b7942519f910daa26
|
|
BLAKE2b-256 checksum How to use checksums |
d4c42fef8e0e25b6e4a33566fdaa910cc69e227962a6e36fccfba90617653744
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 1, 2026.
Transparency logSecurity for QHOT 2.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for qhot-2.1.2.tar.gz
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 Nov 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.