Skip to main content

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.yaml for 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.yaml for 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

qcraft-0.1.5.tar.gz (156.6 kB view details)

Uploaded Source

Built Distribution

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

qcraft-0.1.5-py3-none-any.whl (188.8 kB view details)

Uploaded Python 3

File details

Details for the file qcraft-0.1.5.tar.gz.

File metadata

  • Download URL: qcraft-0.1.5.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

Hashes for qcraft-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fe89da32e700b6d349869f66c5e9f5cb2e8bef061c2eda10a6b8b934ce6f6892
MD5 847f3b72df9091a29d7d7e9e5725b4c7
BLAKE2b-256 52d66c8060814305793de99d46faefc0864b337ea39e639c5e6949a75f27c5cf

See more details on using hashes here.

File details

Details for the file qcraft-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: qcraft-0.1.5-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

Hashes for qcraft-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49b632c04b1fbcd9db272d57935517b900ffd610b8c608c11697e01e02557182
MD5 ec1a3a94e979d034c69d8e1343663f96
BLAKE2b-256 f86ec74ea3f368df300ccaeff08deed28a7a91340db7dae088466302a77c6aa3

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