Skip to content

In NISQ era, quantum circuit depths are very crucial for quantum computational advantage. The most expensive gates in terms of T1 decoherence time are the Non-Clifford gates, especially the T-gate. This work is an attempt to optimize the quantum circuit depth by minimizing the number of T-gates in any circuit using Deep Reinforcement Learning.

License

Notifications You must be signed in to change notification settings

QuantumAI-IITM/Quantum-Circuit-Optimization-using-AlphaTensorQuantum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlphaTensor-Quantum

License: Apache 2.0
Build Status
PyPI version
Docs
Discussions


📇 Table of Contents

  1. 🚀 Project Overview
  2. ✨ Key Features
  3. 📖 Scientific Background
  4. 🛠️ Installation & Setup
  5. ⚙️ Quickstart & Examples
  6. 📐 System Architecture
  7. 🧪 Demos & Notebooks
  8. 📈 Benchmark Results
  9. 🧩 API & Module Reference
  10. 👥 Contributing Guidelines
  11. 🗂️ Roadmap
  12. 📜 License
  13. 🙏 Acknowledgements

🚀 Project Overview

AlphaTensor-Quantum is a cutting-edge framework that brings together:

  • Tensor Decomposition: Representing the costly non-Clifford part of a quantum circuit as a symmetric, binary 3-tensor.
  • Deep Reinforcement Learning: Casting decomposition as a single-player game (TensorGame) and training an AlphaZero-style agent to find minimal-rank decompositions.
  • Gadgetization: Automatically discovering and exploiting Toffoli/CS “gadgets” to bundle multiple T-gates into ancilla-based constructions, slashing the effective T-count.

The result? Automated, state-of-the-art T-count optimization that matches or surpasses all human-designed methods on key arithmetic and quantum-chemistry primitives.

AlphaTensor-Quantum Pipeline
Figure 1. From Circuit → Signature Tensor → Waring Decomposition → Optimized Circuit


✨ Key Features

  • 🔍 Signature-Tensor Encoding
    Transform any Clifford+T circuit into a symmetric ternary tensor capturing its phase-polynomial.

  • 🕹️ TensorGame Environment

    • Single-player game: actions = binary vectors; state = residual tensor.
    • Reward = –1 per move; gadgets yield bonus rewards.
  • 🤖 Symmetrized Axial Attention Network

    • Efficiently processes large (up to 72×72×72) tensors
    • 4× speedup and 3× memory reduction vs. naive attention
  • 🛠️ Domain Gadget Integration

    • Toffoli gadgets (7→2 T-equivalents)
    • Controlled-S gadgets (3→2 T-equivalents)
    • Learned purely from reward shaping—no hard-coding.
  • 🎲 Sample-Based MCTS

    • Monte Carlo Tree Search explores only a sampled subset of factors
    • Balances exploration vs. exploitation in huge action spaces
  • 🎓 Synthetic Demonstrations & Data Augmentation

    • Millions of random decompositions, with forced gadget patterns
    • Random basis changes (Clifford transforms) & factor permutations
  • 📊 Comprehensive Benchmarks

    • Arithmetic circuits (adders, GF($2^m$) multipliers)
    • Quantum chemistry oracles (e.g., FeMoco’s Prepare/Select)
    • Unary iteration & phase-gradient primitives
  • 🔧 Extensible & Modular

    • Plug in new gadgets, change metrics (T-depth, weighted gates), or adapt to NISQ devices.

📖 Scientific Background

Quantum fault-tolerance demands minimizing T-gates (magic-state distillation is two orders-of-magnitude costlier than CNOT). The T-count optimization problem is NP-hard, and prior methods rely on hand-crafted rewrite rules or limited tensor tricks.

AlphaTensor-Quantum reframes circuit optimization as:

  1. Phase-polynomial Extraction

    • Any CNOT+T circuit defines $\phi(x)=\frac\pi4(\sum a_i x_i + 2\sum b_{ij}x_ix_j + 4\sum c_{ijk}x_ix_jx_k)$.
    • Mod 2 coefficients ${c_{ijk}}$ form a symmetric 3-tensor (signature tensor).
  2. Waring Decomposition

    • Find a minimal set ${u^{(r)}}$ such that
      $$\mathcal{T}=\sum_r u^{(r)}\otimes u^{(r)}\otimes u^{(r)}\pmod2.$$
    • Each $u^{(r)}$ ↔ one T-gate; factors grouping → gadget proposals.
  3. Reinforcement Learning

    • State: current residual tensor + action history.
    • Action: choose vector $u\in{0,1}^N$.
    • Reward: –1 per move; gadget completions yield positive bonuses.
    • Policy-Value Net + sample-based MCTS find optimal plays.

About

In NISQ era, quantum circuit depths are very crucial for quantum computational advantage. The most expensive gates in terms of T1 decoherence time are the Non-Clifford gates, especially the T-gate. This work is an attempt to optimize the quantum circuit depth by minimizing the number of T-gates in any circuit using Deep Reinforcement Learning.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published