A high-performance MTBDD quantum simulator for Qiskit
Project description
qiskit-medusa
qiskit-medusa is a high-performance MTBDD-based quantum circuit simulator for Qiskit. It provides a Python interface to MEDUSA (Multi-Terminal Binary DEcision Diagram-based QUantum SimulAtor), a quantum simulator written in C that leverages the Sylvan library for efficient MTBDD operations.
This package bridges MEDUSA with Qiskit, allowing you to simulate quantum circuits using Qiskit's high-level API while benefiting from MEDUSA's efficient symbolic simulation capabilities.
Features
- MTBDD-based simulation: Leverages Multi-Terminal Binary Decision Diagrams for efficient quantum state representation
- Symbolic loop simulation: Support for parametric quantum circuits and symbolic computation
- Qiskit integration: Seamless integration with Qiskit for quantum circuit design and manipulation
- High performance: Written in C with custom MTBDD operations via Sylvan
- OpenQASM support: Process circuits in OpenQASM format
Installation
Requirements
- Python >= 3.8
- C/C++ compiler (gcc, clang, or MSVC)
- CMake >= 3.15
- GMP library (libgmp-dev on Ubuntu/Debian)
- scikit-build-core >= 0.10
Install via pip
Simply install the package from PyPI:
pip install qiskit-medusa
The installation automatically builds the C extension and compiles the MEDUSA simulator with its dependencies (Sylvan and Lace).
Building from source
If you want to build from source:
git clone https://github.com/yourusername/qiskit-medusa
cd qiskit-medusa
pip install -e .
For development installation with additional tools:
pip install -e ".[dev]"
Quick Start
from qiskit import QuantumCircuit, transpile
from qiskit_medusa.backend import MedusaBackend
# Initialize the Medusa backend
backend = MedusaBackend()
# Enable symbolic simulation (optional)
medusa_backend.set_options(symbolic=True)
# Create a simple quantum circuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
# Transpile the circuit for the Medusa backend
transpiled_qc = transpile(qc, backend=backend)
# Run the circuit on the Medusa backend
job = backend.run(transpiled_qc, shots=5000)
result = job.result()
counts = result.get_counts()
print("Counts:", counts)
Runtime Dependencies
- Qiskit >= 1.0: Quantum computing framework
- NumPy >= 1.20: Numerical computing
- GMP: GNU Multiple Precision Arithmetic Library (system library)
- Sylvan: Multi-Terminal Binary Decision Diagram library (automatically fetched during build)
- Lace: Work-stealing library used by Sylvan (automatically fetched during build)
Build Dependencies
- scikit-build-core >= 0.10: Build backend for Python extension
- CMake >= 3.15: Build system
- GMP development headers (libgmp-dev on Ubuntu/Debian)
Development Dependencies
- pytest: Testing framework
- black: Code formatter
- pylint: Linter
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
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 qiskit_medusa-0.1.0.tar.gz.
File metadata
- Download URL: qiskit_medusa-0.1.0.tar.gz
- Upload date:
- Size: 42.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3834a2173dcb8df3e5a97378e65c5b543e0c066d856aba2b92b7913435099878
|
|
| MD5 |
27d21c540c78016554f2733cb8730e6a
|
|
| BLAKE2b-256 |
71802917ae79cb141a30477ec769f494c6265e61f7938d48efe581516bc8cc60
|
File details
Details for the file qiskit_medusa-0.1.0-cp313-cp313-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: qiskit_medusa-0.1.0-cp313-cp313-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 458.5 kB
- Tags: CPython 3.13, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a17406dc672d18dbc789255d07bb458fb259277019832286915a8440d02e5d3
|
|
| MD5 |
167bed2a9b37d96440029c0cb544e50f
|
|
| BLAKE2b-256 |
4140b24b476357c7b2c9d733d9e3a7696908ea88b10f82cb2a0da8461aecbb6b
|