Skip to main content

Hybrid Dependency Hypergraphs for quantum computation: translation, visualization, and partitioning.

Project description

hdh

HDH Logo

Hybrid Dependency Hypergraphs for Quantum Computation
PyPI version · MIT Licensed · Version 0.0.2 · Author: Maria Gragera Garces

Work in Progress — Preparing for 1.0


What is HDH?

HDH (Hybrid Dependency Hypergraph) is an intermediate representation designed to describe quantum computations in a model-agnostic way. It provides a unified structure that makes it easier to:

  • Translate quantum programs (e.g., from Qiskit or QASM) into a common hypergraph format
  • Analyze and visualize the logical and temporal dependencies within a computation
  • Partition workloads across devices using tools like METIS or KaHyPar, taking into account hardware and network constraints

Current Capabilities

  • Qiskit circuit translation
  • OpenQASM 2.0 file parsing
  • Graph-based printing and canonical formatting
  • Partitioning with METIS using custom HDH-to-graph translation
  • Model-specific abstractions for:
    • Quantum Circuits
    • Measurement-Based Quantum Computing (MBQC)
    • Quantum Walks
    • Quantum Cellular Automata (QCA)
  • Analysis tools for:
    • Cut cost estimation across partitions
    • Partition size reporting
    • Parallelism tracking by time step
    • Integration with networkx and metis

Includes test examples for:

  • Circuit translation (test_convert_from_qiskit.py)
  • QASM import (test_convert_from_qasm.py)
  • MBQC (mbqc_test.py)
  • Quantum Walks (qw_test.py)
  • Quantum Cellular Automata (qca_test.py)
  • Protocol demos (teleportation_protocol_logo.py)

Installation

pip install hdh

Quickstart

From Qiskit

from qiskit import QuantumCircuit
from hdh.frontend.qiskit_loader import convert_qiskit_circuit_to_hdh

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)

hdh = convert_qiskit_circuit_to_hdh(qc)
hdh.print()

From QASM file

from hdh.frontend.qasm_loader import convert_qasm_file_to_hdh

hdh = convert_qasm_file_to_hdh("test_qasm_file.qasm")
hdh.print()

Partitioning

from hdh.partitioning.metis_partition import compute_metis_partition

partition = compute_metis_partition(hdh, num_bins=2)
print(partition)

Example Use Cases

  • Visualize quantum protocols (e.g., teleportation)
  • Analyze dependencies in quantum walk evolutions
  • Explore entanglement flow in MBQC patterns
  • Partition large circuits across heterogeneous QPUs

Coming Soon

  • Compatibility with Cirq, Braket, and Pennylane
  • Full graphical UI for HDH visualization
  • Native noise-aware binning strategies
  • Better cut handling for distributed execution

Tests and Demos

All tests are under tests/ and can be run with:

pytest

If you're interested in the HDH of a specific model, see:

  • mbqc_test.py for MBQC circuits
  • qca_test.py for Cellular Automata
  • qw_test.py for Quantum Walks
  • teleportation_protocol_logo.py for a protocol-specific demo

Contributing

Pull requests welcome. Please open an issue or get in touch if you're interested in:

  • SDK compatibility
  • Optimization strategies
  • Frontend tools (visualization, benchmarking)

Citation

More formal citation and paper preprint coming soon. Stay tuned for updates.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hdh-0.0.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hdh-0.0.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file hdh-0.0.3.tar.gz.

File metadata

  • Download URL: hdh-0.0.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for hdh-0.0.3.tar.gz
Algorithm Hash digest
SHA256 81f35a94f878baed3a2ebac6540ff9c1dda95038de2057de2ab581eea74479a3
MD5 8fa0935c925addd9aca1f16472067309
BLAKE2b-256 cbc07f7ceb65a263212c78c9195087b194880d5a1349683df1100a9c13fe439e

See more details on using hashes here.

File details

Details for the file hdh-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: hdh-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for hdh-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0226b59c9fe62358d3c5dc41b1d341b0e8658e511743896d380749aefe2f2eca
MD5 4952e0173c333e8f8e45bd5cae599246
BLAKE2b-256 5672bb4bfa270e29490e4bf744dba70555e03e7660a7039f7df638b47928f350

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page