Skip to main content

HDH Logo

Hybrid Dependency Hypergraphs for Quantum Computation

PyPI version · Docs · Unitary Foundation · MIT Licensed


What is a HDH?

HDH (Hybrid Dependency Hypergraph) is an intermediate directed hypergraph-based representation designed to encode the dependecies 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.


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 QASM file

from hdh.converters import from_qasm
from hdh.visualize import plot_hdh

qasm_path = os.path.join(os.path.dirname(__file__), 'test_qasm_file.qasm')
hdh = from_qasm('file', qasm_path)

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.

Release files for hdh 0.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 hdh 0.4.0
File Size Uploaded
hdh-0.4.0.tar.gz 33.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hdh 0.4.0
File Interpreter ABI Platform
hdh-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 72.4 kB

Release files / hdh-0.4.0.tar.gz

Download URL hdh-0.4.0.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
24b6f73c84a017099be491048dcf11cb938c0f7e611ebbd6fb6b8c59a6efc96e
BLAKE2b-256 checksum
How to use checksums
d5badcf9864c94ef77f3b512b793658b6c5661c7387b048efeee1b76b3a74fcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.7 Darwin/25.5.0

Release files / hdh-0.4.0-py3-none-any.whl

Download URL hdh-0.4.0-py3-none-any.whl
Size 38.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3cf595e66ef4999fb11b31b179cae567b914114c20df31d5e7f9566b54f9149
BLAKE2b-256 checksum
How to use checksums
f63bd6c437759794c14569b0fef3e4e9e11a4037e538f643646aa62c4c29f7eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.7 Darwin/25.5.0

Release history Release notifications | RSS feed

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.8

2 release files

0.2.6

2 release files

0.2

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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