Installing the HDH Python Library

February 2026

← Back to other guides

This guide shows you how to install HDH (Hybrid Dependency Hypergraph), a Python library for quantum computation workflow analysis and partitioning. HDH provides a unified hypergraph-based intermediate representation for quantum programs.

Option 1: Install from PyPI (Recommended)

Install the latest stable version directly from PyPI.

pip install hdh

Verify the installation:

python -c "import hdh; print('HDH successfully installed!')"

Option 2: Install from GitHub

1. Clone the repository

git clone https://github.com/grageragarces/HDH.git
cd HDH

2. Install the package

pip install -e .
Note: The -e flag installs in editable mode, allowing you to modify the source code.

3. Verify the installation

python -c "import hdh; print('HDH successfully installed!')"

Quick Start Example

Test your installation with a simple quantum circuit conversion.

from qiskit import QuantumCircuit
from hdh.converters import from_qiskit
from hdh.visualize import plot_hdh

# Create a simple Bell state circuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)

# Convert to HDH
hdh_graph = from_qiskit(qc)

# Visualize
plot_hdh(hdh_graph)
print("HDH conversion successful!")
Note: This example requires Qiskit: pip install qiskit

Common Issues

Common pitfalls:

Additional Resources