Hardware control library for the Public Quantum Network (PQN)
pqn-hardware provides the instrument drivers, network messaging, and protocols used to operate hardware at PQN nodes. It is consumed as a library by the FastAPI-based Node service that lives in pqn-node, and can also be used standalone for bench experiments or scripts.
This package was split off from pqn-stack (now pqn-node) to let hardware work and app work evolve independently.
pqn_hardware.base—Instrumentprotocols and common abstractions (rotator, timetagger, polarimeter, …).pqn_hardware.network— ZMQ-based router, instrument provider, and client for cross-machine messaging between hardware and consumers.pqn_hardware.pqn.drivers— concrete instrument drivers (Thorlabs rotators, TimeTagger, QKD, polarimeter, …).pqn_hardware.pqn.protocols— quantum protocols (CHSH, QKD, tomography, visibility).pqn_hardware.constants— shared polarization/Bell-state definitions used by both protocols and downstream consumers.pqn-hwCLI — start anInstrumentProvideror aRouter.
git clone https://github.com/PublicQuantumNetwork/pqn-hardware.git
cd pqn-hardware
uv syncRequires Python 3.12+ and uv.
Start a router:
uv run pqn-hw start-router --config configs/config_messaging_example.tomlStart an instrument provider:
uv run pqn-hw start-provider --config configs/config_messaging_example.tomlOr pass config via CLI flags:
uv run pqn-hw start-provider \
--name provider1 \
--router-name router1 \
--instruments '{"dummy1": {"import": "pqn_hardware.pqn.drivers.dummies.DummyInstrument", "desc": "Test Instrument", "hw_address": "123456"}}'See configs/config_messaging_example.toml for the full config shape.
pqn-node depends on this package via a git URL pinned to a tag or commit:
dependencies = [
"pqn-hardware @ git+https://github.com/PublicQuantumNetwork/pqn-hardware.git@<tag-or-sha>",
]The Public Quantum Network is supported in part by NSF Quantum Leap Challenge Institute HQAN under Award No. 2016136, Illinois Computes, and by the DOE Grant No. 712869, "Advanced Quantum Networks for Science Discovery."
Reach the PQN team at publicquantumnetwork@gmail.com.