This release is a pre-release and may not be stable for production use.
MHRQI: Multi-scale Hierarchical Representation of Quantum Images
MHRQI is a Python-based framework for representing images using hierarchical quantum circuits. It provides a multi-scale quad-tree decomposition to improve the robustness and efficiency of quantum image representations.
🚀 Key Features
-
MHRQI Core: A robust Object-Oriented framework for hierarchical quantum image encoding.
-
MHRQIResult: A powerful results object for automated decoding, reconstruction, and metric calculation.
-
Multi-scale Encoding: Maps image data to quantum states using a hierarchical qudit structure.
-
Denoising Application: A functional extension for quantum denoising based on sibling smoothing and hierarchical consistency.
-
Standardized Benchmarks: Built-in
BenchmarkSuitefor comparison against classical denoisers (BM3D, NL-Means, SRAD). -
Medical Specialization: optimized and tested on medical imaging datasets (e.g., OCT scans).
🛠️ Installation
# Clone the repository
git clone https://github.com/Keno-00/MHRQI.git
cd MHRQI
# Install dependencies and package in editable mode
pip install -e .
💻 Usage
Command Line Interface
MHRQI provides a comprehensive CLI for running the denoising pipeline.
# Run denoising with default settings
mhrqi --denoise
# Specify image size and number of shots
mhrqi --size 16 --shots 100000 --denoise
# Use a specific input image
mhrqi --img resources/drusen1.jpeg --denoise
Use mhrqi --help to see all available options.
Python API (Library Usage)
You can use MHRQI as a dependency in your own projects (e.g., a "Quantum Vision Suite").
import cv2
import numpy as np
from mhrqi import MHRQI
from mhrqi.utils import general as utils
# 1. Prepare image
img = cv2.imread("image.jpg", cv2.GRAYSCALE)
img_resized = cv2.resize(img, (16, 16))
img_normalized = img_resized.astype(np.float64) / 255.0
# 2. Initialize MHRQI model
depth = 4 # for 16x16 image (log2(16))
model = MHRQI(depth=depth)
# 3. Generate hierarchical coordinate matrix and upload data
hierarchical_coord_matrix = utils.generate_hierarchical_coord_matrix(16, 2)
model.upload(hierarchical_coord_matrix, img_normalized)
# 4. Apply denoising (optional)
model.apply_denoising()
# 5. Simulate
result = model.simulate(shots=10000)
# 6. Reconstruct image using the powerful Result object
img_recon = result.reconstruct()
# 7. Compute quality metrics (MSE, SSIM, NIQE, etc.)
metrics = result.compute_metrics(reference_image=img_normalized)
print(f"Metrics: {metrics}")
# 8. Plot the result
result.plot(title="Denoised OCT Scan")
📂 Project Structure
MHRQI/
├── mhrqi/ # Main package
│ ├── core/ # Quantum circuit implementations
│ ├── utils/ # General & visualization utilities
│ ├── benchmarks/ # Scaling and comparison suites
│ └── cli/ # Command-line interface logic
├── docs/ # Documentation source (MkDocs)
├── tests/ # Unit and integration tests
├── pyproject.toml # Project metadata and configuration
└── .github/ # CI/CD workflows and templates
📚 Documentation
For detailed guides and API documentation, see the docs/ folder or visit the documentation site:
pip install -e .[docs]
mkdocs serve
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for setup instructions and development workflows.
📝 Citation
If you use this work in your research, please cite:
TODO: add here preprint or citation when paper has been published
📄 License
This project is licensed under the Apache License 2.0 - see LICENSE for details.
Metadata
Release files for mhrqi 0.1.3.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mhrqi-0.1.3.dev0.tar.gz | 2.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mhrqi-0.1.3.dev0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.9 MB
Release files / mhrqi-0.1.3.dev0.tar.gz
| Download URL | mhrqi-0.1.3.dev0.tar.gz |
|---|---|
| Size | 2.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77ce10cd1a738872db78ba90f5a1a2c93677328ce64bbb9b199f4ca8f6abd837
|
|
BLAKE2b-256 checksum How to use checksums |
cee7a537fce1f9af045286ea06354310e1447496ee64e4df1fb12aafbbf84ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.
Transparency logRelease files / mhrqi-0.1.3.dev0-py3-none-any.whl
| Download URL | mhrqi-0.1.3.dev0-py3-none-any.whl |
|---|---|
| Size | 45.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1edfbfc37c24fe9d128109cca0b0caa5f88bf2f6f2b4d3bedd0422b0e385eca9
|
|
BLAKE2b-256 checksum How to use checksums |
97a93784f0ca46201895f2d56b11fa1e4e77ff2fb2e1a6a637ef28f37d93ac15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.
Transparency log