Hybrid Dependency Hypergraphs for Quantum Computation
What is a HDH?
HDH (Hybrid Dependency Hypergraph) is an intermediate directed hypergraph-based representation designed to encode the dependencies arising in any quantum workload. It provides a unified structure that makes it easier to:
- Translate quantum programs (e.g., a circuit or a mbqc pattern) into a unified hypergraph format
- Analyze and visualize the logical and temporal dependencies within a computation
- Partition workloads across devices, taking into account hardware and network constraints
Current Capabilities
- Qiskit, Braket, Cirq and Pennylane circuit mappings to HDHs
- OpenQASM 2.0 file parsing
- Model-specific abstractions for:
- Quantum Circuits
- Measurement-Based Quantum Computing (MBQC)
- Quantum Walks
- Quantum Cellular Automata (QCA)
- Capability to partition HDHs and evaluate partitions
Installation
pip install hdh
Qiskit conversion works out of the box. Cirq, PennyLane, Amazon Braket, and the KaHyPar/METIS partitioners are optional and installed via extras:
pip install hdh[cirq] # Cirq conversion (needs Python >=3.11)
pip install hdh[pennylane] # PennyLane conversion (needs Python >=3.11)
pip install hdh[braket] # Amazon Braket conversion (needs Python >=3.11)
pip install hdh[kahypar] # KaHyPar-based partitioning
pip install hdh[metis] # METIS-based partitioning (metis_telegate)
pip install hdh[all] # everything above (needs Python >=3.11)
Tested against Cirq 1.7, PennyLane 0.45, and amazon-braket-sdk 1.125 — all
three now require Python >=3.11 upstream, so those extras aren't installable
on Python 3.10.
hdh[metis] installs the Python binding only — it talks to a
system-installed METIS C library via ctypes, so METIS itself must already be
available on your machine (e.g. via your OS package manager or built from
source). Without it, metis_telegate automatically falls back to a
Kernighan-Lin partition and reports which method it used.
Upgrading from 0.4? HDH.add_node changed signature in 0.5 — see
CHANGELOG.md.
Quickstart
From Qiskit
from qiskit import QuantumCircuit
from hdh.converters import from_qiskit
from hdh.visualize import plot_hdh
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
hdh = from_qiskit(qc)
plot_hdh(hdh)
From OpenQASM 2.0
from hdh.converters import from_qasm
from hdh.visualize import plot_hdh
qasm = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0], q[1];
measure q -> c;
"""
hdh = from_qasm('string', qasm)
# or, from a file: hdh = from_qasm('file', 'path/to/circuit.qasm')
plot_hdh(hdh)
Tests and Demos
All tests are under tests/ and can be run with:
pytest
Contributing
Pull requests welcome. Please open an issue or get in touch if you're interested in:
- SDK compatibility
- Frontend tools (visualization, benchmarking)
or if you've found a bug!
Citation
More formal citation and paper preprint coming soon. Stay tuned for updates.
Metadata
Release files for hdh 1.0.0
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 |
|---|---|---|---|---|
| hdh-1.0.0.tar.gz | 40.3 kB | Without provenance | Details for hdh-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hdh-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for hdh-1.0.0-py3-none-any.whl |
Total release size: 88.0 kB
Release files / hdh-1.0.0.tar.gz
| Download URL | hdh-1.0.0.tar.gz |
|---|---|
| Size | 40.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ffc35fa570d4e778daf182274b713924e0596aa62c1d8d390947f5dd553378e
|
|
BLAKE2b-256 checksum How to use checksums |
f6be0aed867c76bc1ede2bfb7ff83282fe464c8d97952860acd24280cac5f9cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.7 Darwin/27.0.0
|
Release files / hdh-1.0.0-py3-none-any.whl
| Download URL | hdh-1.0.0-py3-none-any.whl |
|---|---|
| Size | 47.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3159cdcd159326359767e8bda3b3c1ed69d40fae26f62ecf4d5aeef3117415e
|
|
BLAKE2b-256 checksum How to use checksums |
46dc728de9a710e5ff7a53d3a96c640799f085a39875361d3a2e46d41c2953b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.7 Darwin/27.0.0
|
Security for hdh 1.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.