Skip to main content

AI-driven quantum circuit compiler using GNN + LLM

Project description

quantumopt

AI-driven quantum circuit compiler using Graph Neural Networks + Claude LLM — tested on real research circuits

License: MIT Python 3.10+ Qiskit

What It Does

quantumopt takes your quantum circuit and returns an optimized version that runs more accurately on IBM quantum hardware — with a plain English explanation you can cite in your paper.

Installation

pip install quantumopt

Usage

from qiskit import QuantumCircuit
from quantumopt import compile

# Your research circuit
qc = QuantumCircuit(5)
qc.h(0)
qc.cx(0, 1)
qc.cx(1, 2)
qc.ry(0.5, 0)
qc.rz(0.3, 1)

# Compile and optimize
result = compile(qc, hardware="ibm_brisbane")

# Results
print(result.depth_reduction)    # "31%"
print(result.gate_reduction)     # "32%"
print(result.explanation)        # Claude-generated report
print(result.optimized_circuit)  # Ready to run on IBM

Benchmark Results

Tested on 41 real circuits from QASMbench (published research circuits):

Metric quantumopt Baseline
Avg depth reduction 13.2% 0%
Avg gate reduction 15.2% 0%
Circuits improved 34/41 N/A
Circuits made worse 0/41 N/A
Best result 89% N/A

Tested on 10,240 synthetic circuits:

Metric Result
GNN prediction accuracy (±10%) 82%
GNN prediction accuracy (±20%) 100%
Avg predicted improvement 64.5%

Example Explanation Output

When ANTHROPIC_API_KEY is set, quantumopt generates research-quality explanations:

"Transpilation of the target circuit for IBM Brisbane hardware yielded a 31.6% reduction in circuit depth (128 → 88 layers) and a 31.6% reduction in total gate count (326 → 223 gates). Among the applied optimization passes, merge_rotations contributed most substantially, as consecutive single-qubit rotation gates collapse into single parametrized operations. The resulting reduction in two-qubit gate exposure is particularly consequential for hardware execution, as each eliminated layer directly reduces coherence-time consumption against Brisbane's median T₂ timescales (~100–200 µs)."

How It Works

  1. Your circuit is encoded as a Directed Acyclic Graph
  2. A trained GNN (82% accuracy) predicts optimization potential and recommends optimization actions
  3. Qiskit transpiler optimizes for target hardware
  4. Claude generates a hardware-specific explanation you can cite in your paper

Supported Algorithms

VQE, QAOA, QFT, Grover, GHZ, Bernstein-Vazirani, Deutsch-Jozsa, Amplitude Estimation, Phase Estimation

Supported Hardware

  • IBM Brisbane (default)
  • More backends coming

Configuration

# Required for AI explanations
export ANTHROPIC_API_KEY=your-key-here

# Optional — for real IBM hardware execution
export IBM_QUANTUM_TOKEN=your-token-here

Requirements

  • Python 3.10+
  • Qiskit >= 1.0.0
  • PyTorch >= 2.0.0
  • torch-geometric >= 2.4.0
  • anthropic >= 0.20.0 (optional, for explanations)

Citation

If you use quantumopt in your research please cite:

Syamala, N. (2025). quantumopt: An AI-driven quantum 
circuit compiler using Graph Neural Networks and Large 
Language Models. GitHub.
https://github.com/nsyamala1/quantumopt

License

MIT License — free for research and commercial use.

Contact

Built by Naveen Syamala GitHub: github.com/nsyamala1 Issues: github.com/nsyamala1/quantumopt/issues

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

quantumopt-0.1.0.tar.gz (347.5 kB view details)

Uploaded Source

Built Distribution

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

quantumopt-0.1.0-py3-none-any.whl (345.3 kB view details)

Uploaded Python 3

File details

Details for the file quantumopt-0.1.0.tar.gz.

File metadata

  • Download URL: quantumopt-0.1.0.tar.gz
  • Upload date:
  • Size: 347.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for quantumopt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a20fcfd864e99f39e0ba2f18690c2e3fd8d9bbc3d6ada0264dddb9ae74269c6c
MD5 581ac371ab5f66610fdd86f4eb5f56f1
BLAKE2b-256 3ba9f3fde4303bb262ee3075fd9fe6e4ffa799ce488d643733c3b164d89e0535

See more details on using hashes here.

File details

Details for the file quantumopt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quantumopt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 345.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for quantumopt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 607d498297ed9acd3206584f3fdec24dd47a09d3a6be4cb2517b639c34508722
MD5 3d08404683bda4dad4129cd31e8e273a
BLAKE2b-256 9468bad2753db8787930737192ffbc79c68ae1a377429d1e46ef84642db0fd93

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