Hybrid Dependency Hypergraphs for quantum computation: translation, visualization, and partitioning.
Project description
Hybrid Dependency Hypergraphs for Quantum Computation
· MIT Licensed ·
· Author: Maria Gragera Garces
Work in Progress - Preparing for 1.0
Documentation can be found at: https://grageragarces.github.io/HDH/
What is 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
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.converters.convert_from_qiskit 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.convert_from_qasm 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
If you're interested in the HDH of a specific model, see in manual_tests:
mbqc_test.pyfor MBQC circuitsqca_test.pyfor Cellular Automataqw_test.pyfor Quantum Walksteleportation_protocol_logo.pyfor a protocol-specific demo
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hdh-0.1.6.tar.gz.
File metadata
- Download URL: hdh-0.1.6.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.13 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2a66690b0d1d22f73b126e8d80f7a4e83c13fa776f9beb31d04e7f5652b0295
|
|
| MD5 |
6842ed6c67ce8f2affb9fe1631bc7769
|
|
| BLAKE2b-256 |
fcd40621170a49bece8892c1663447a84c074fc9e4e1ca0a70531e30b176c178
|
File details
Details for the file hdh-0.1.6-py3-none-any.whl.
File metadata
- Download URL: hdh-0.1.6-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.13 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
310ab8c8429cf66353f6fa3ea674e67e4319d046a0007c8f67d7fdcbc249b0b3
|
|
| MD5 |
3546decebccf3574d11c317ad04e4067
|
|
| BLAKE2b-256 |
66cf99407024c18c760a203579f83cc15960472f0fdbf49255fa32a9db983c83
|