Qcraft: Quantum Circuit Design, Optimization, and Surface Code Mapping Platform
Project description
Qcraft: A Modular Platform for Quantum Circuit Optimization and Surface Code Mapping via Reinforcement Learning
Abstract
Qcraft is a research-grade, modular desktop application for quantum circuit design, optimization, and surface code mapping. It leverages reinforcement learning (RL) to address the challenges of scalable, hardware-aware quantum compilation and error correction. This work presents the architecture, configurable workflows, and the novel RL-based surface code mapping module, highlighting the scientific motivation, reward function design, and future research directions.
1. Introduction
Quantum computing promises exponential speedups for certain problems, but practical realization is hindered by noise, limited connectivity, and hardware constraints. Surface codes are a leading error correction technique, but mapping logical qubits to physical hardware remains a complex, high-dimensional optimization problem. Qcraft addresses this by providing a unified, extensible platform for:
- Quantum circuit design and editing
- Hardware-aware circuit optimization
- RL-driven surface code mapping
- Artifact management and reproducibility
- Curriculum Learning: Progressive training with increasing difficulty, dynamic reward weighting, and robust convergence.
- Hardware Awareness: Supports IBM devices (IonQ in progress), native gate sets, and device-specific constraints.
- Modular and Configurable: YAML/JSON-driven configuration for all workflows, environments, and training parameters.
- Logging and Artifact Management: Automated tracking of training runs, metrics, and model artifacts for reproducibility.
Installation
Requirements
- Python: 3.9–3.11 (3.11 recommended)
- CUDA: 12.4 (required for RL training with surface code agents)
- Tested on: Linux, NVIDIA RTX 3070, CUDA 12.4, IBM Q devices
Install from PyPI
pip install qcraft
Installation
Option 1: Install from PyPI (Recommended)
pip install qcraft
Option 2: Install from GitHub Release Tarball
Download the latest qcraft-<version>.tar.gz from https://github.com/deba10106/Qcraft.git (see Releases tab), then install with:
pip install /path/to/qcraft-<version>.tar.gz
Note:
- Python 3.9–3.11 supported (3.11 recommended)
- CUDA 12.4 required for RL training
Usage
Main GUI
qcraft
Usage
To launch the Qcraft desktop application, simply run:
qcraft
Reward Functions: Overview
Surface Code Multi-Patch Agent
- Highly configurable reward function: Encourages valid mappings, hardware connectivity, adjacency, resource utilization, error minimization, and logical correctness.
- Curriculum learning: Dynamic reward weights and phase multipliers across training stages.
- See
configs/multi_patch_rl_agent.yamlfor all tunable parameters.
Circuit Optimization Module
- Reward engine: Penalizes gate count, depth, and SWAPs; rewards native gate usage and penalizes invalid gates.
- Curriculum learning: Difficulty and reward weights progress as training advances.
- See
configs/optimizer_config.yamlfor all tunable parameters.
Configuration and Customization
- All major workflows and RL environments are configured via YAML files in the
configs/directory. - Surface Code Agent:
configs/multi_patch_rl_agent.yaml - Circuit Optimization Agent:
configs/optimizer_config.yaml - Device/Hardware:
configs/ibm_devices.yaml,configs/ionq_devices.yaml - Other: Logging, visualization, and more via their respective YAML files.
Packaging and PyPI Publishing
To build and publish your own version:
# Clean previous builds
rm -rf dist/*
# Build the package
python3 setup.py sdist bdist_wheel
# Check the package
pip install twine
# Upload to PyPI
twine upload dist/*
Support and Extensibility
- Qcraft is modular and extensible for new devices, reward functions, and optimization passes.
- Contributions and feedback are welcome for further research and development.
Citation
If you use Qcraft in academic work, please cite the corresponding paper or this repository.
For detailed technical documentation, architecture, and workflow explanations, please refer to the full README in the source repository.
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
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 qcraft-0.1.6.tar.gz.
File metadata
- Download URL: qcraft-0.1.6.tar.gz
- Upload date:
- Size: 156.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a74bcf3d15e51529daa59e5a67417f1d541e562ab0f6c1dd4946fb1f12cb894
|
|
| MD5 |
3e2b51ba8d2015ef5a27168bd8499fba
|
|
| BLAKE2b-256 |
e21fe60d0017ad9a739e633bc5692b75d713a3d194dfd5152c7b853305d44474
|
File details
Details for the file qcraft-0.1.6-py3-none-any.whl.
File metadata
- Download URL: qcraft-0.1.6-py3-none-any.whl
- Upload date:
- Size: 188.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1f1870c6ad72bd9acec555a5949b8f034e49b9337e06e7b0d9a55f5d8102aa4
|
|
| MD5 |
2421f54c6f827ff2ee69950779d2dde3
|
|
| BLAKE2b-256 |
903cfe2d3c02366552eb278a6356e20272cc2533181a3c4222fd89bf03413d13
|