Skip to main content

QHOT

PyPI version Python versions Tests Documentation License DOI

The QHOT window on a 1080p display: holograms of colloidal spheres on the video screen, with optical traps on seven of them, and the Video tab beside it with the recorder, the controls of a GenICam camera and the filter rack

The QHOT window on a simulated video frame: holograms of colloidal spheres, computed with pylorenzmie, with traps on seven of them at heights from 35 to 180 pixels, so that the markers differ in size. The Video tab shows the recorder, the controls of a simulated GenICam camera and the filter rack, with Sample and Hold on.

QHOT is a Python application 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, with undo and redo
  • 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 (1800+ tests)

Requirements

  • Python 3.11+
  • A Qt binding: PyQt6 (the one QHOT runs on) or PyQt5 ≥ 5.15
  • qtpy ≥ 2.0
  • pyqtgraph ≥ 0.13
  • numpy ≥ 1.24
  • scipy ≥ 1.10
  • tomlkit ≥ 0.11
  • QVideo ≥ 4.28.0

Tested hardware

QHOT has been demonstrated to work correctly on hardware: it controlled a Holoeye Pluto spatial light modulator attached as the secondary display of an Ubuntu system with an NVIDIA graphics card.

Installation

pip install "QHOT[pyqt6]"   # or QHOT[pyqt5]

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

The flags of the command line choose the camera, the hologram backend and the SLM:

Flag Chooses
-g a GenICam camera through viva-genicam (preferred: no vendor SDK)
-f, -b, -i, -m, -v a GenICam camera through a vendor's producer (FLIR, Basler, IDS, MATRIX VISION, Allied Vision), which QVideo opens in a process of its own on macOS and Linux
-c, -p an OpenCV camera, a Raspberry Pi camera
-t, -j, -n, -u the hologram backend: PyTorch, numba, NumPy, CuPy
-s the SLM window on the primary screen, even with a second screen
--log-level LEVEL show the log messages of QHOT and QVideo at this level and above (DEBUG, INFO, WARNING, ERROR, CRITICAL)

With no camera flag, QHOT shows a simulated camera. qhot -h lists them all, and qhot --version says which versions of QHOT and QVideo are installed.

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 (fuzz, reproducible with a seed)
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
│   ├── tasks/        — The task manager and its widgets
│   └── traps/        — Trap base classes and overlay
├── traps/            — Concrete trap implementations
├── tasks/            — Concrete tasks, for the queue
└── tests/            — Unit tests

References

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.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QHOT 2.4.0
File Size Uploaded Provenance Actions
qhot-2.4.0.tar.gz 258.6 kB With provenance Details for qhot-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for QHOT 2.4.0
File Interpreter ABI Platform Actions
qhot-2.4.0-py3-none-any.whl Python 3 none any Details for qhot-2.4.0-py3-none-any.whl

Total release size: 430.6 kB

Release files / qhot-2.4.0.tar.gz

Download URL qhot-2.4.0.tar.gz
Size 258.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e8761a90999aced05542665c849ac507c75ba1727fd85916190b870452436bd4
BLAKE2b-256 checksum
How to use checksums
860db271f5041b2caec13c2b98aca909d07a0e4d2925272c381cf9e21c369c69
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 15, 2026.

Transparency log

Release files / qhot-2.4.0-py3-none-any.whl

Download URL qhot-2.4.0-py3-none-any.whl
Size 172.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8facacf3f26b021537a2afa3d9799a5df8c713e6f6ca5b5540fcf23b035deb3
BLAKE2b-256 checksum
How to use checksums
5be72a9af51d667500aacc9b713c38cfffb7f23a2330ddf83ba991565f40b6d4
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 15, 2026.

Transparency log

Security for QHOT 2.4.0

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.

Select from 2 files

Attestation for qhot-2.4.0.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 15, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page