Skip to main content

Qcraft: Quantum Circuit Design, Optimization, and Surface Code Mapping Platform

Project description

Qcraft: Quantum Circuit Design, Optimization, and Surface Code Mapping Platform

What is Qcraft?

Qcraft is an advanced, research-grade platform for quantum circuit design, optimization, and surface code mapping. It leverages reinforcement learning (RL), curriculum learning, and hardware-aware optimization to enable scalable, high-fidelity quantum circuit compilation and error correction. Qcraft is modular, extensible, and production-ready, supporting both classical and quantum error-corrected circuit workflows.


Key Features

  • Reinforcement Learning for Quantum Circuit Optimization: Device-aware, reward-driven optimization of quantum circuits, supporting gate fusion, commutation, SWAP insertion, and more.
  • Surface Code Multi-Patch Mapping: RL-based mapping of multiple logical surface code patches to hardware, with advanced reward shaping and curriculum learning.
  • 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

RL Training (Examples)

  • Circuit Optimization RL Training:
    python -m circuit_designer.workflow_bridge --config configs/optimizer_config.yaml
    
  • Surface Code Multi-Patch RL Training:
    python -m scode.rl_agent.train_multi_patch --config configs/multi_patch_rl_agent.yaml
    

Evaluation and Simulation

  • Evaluation:
    python -m evaluation.evaluation_framework --config configs/your_eval_config.yaml
    
  • Execution Simulation:
    python -m execution_simulation.execution_simulator --config configs/your_exec_config.yaml
    

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.4.tar.gz (156.4 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.4-py3-none-any.whl (188.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qcraft-0.1.4.tar.gz
  • Upload date:
  • Size: 156.4 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.4.tar.gz
Algorithm Hash digest
SHA256 1ff1683f859d51ac73037edc0bae88ae175f27bbf8e8b7d53777d7b5124e68c5
MD5 c102c0029acc2eaa2bf07217a7ca203c
BLAKE2b-256 60c951bc9248b9bd5924d30bb087c62d8d4f4ef43e8cb4f2cbc6ff78f5bd81e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qcraft-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 188.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 36e7256817c18cede2de3bb969763744db3d61f5f3f93b0cb817062793f2f0bf
MD5 7822f3fe7ec4d9d1b612c876c4ee166a
BLAKE2b-256 d4f9d154f463e708519b1ef566267eabb08c432298f44ec7669d8cc18d57cf3e

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