- 🚀 Project Overview
- ✨ Key Features
- 📖 Scientific Background
- 🛠️ Installation & Setup
- ⚙️ Quickstart & Examples
- 📐 System Architecture
- 🧪 Demos & Notebooks
- 📈 Benchmark Results
- 🧩 API & Module Reference
- 👥 Contributing Guidelines
- 🗂️ Roadmap
- 📜 License
- 🙏 Acknowledgements
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.
Figure 1. From Circuit → Signature Tensor → Waring Decomposition → Optimized Circuit
-
🔍 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
- Arithmetic circuits (adders, GF(
-
🔧 Extensible & Modular
- Plug in new gadgets, change metrics (T-depth, weighted gates), or adapt to NISQ devices.
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:
-
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).
- Any CNOT+T circuit defines
-
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.
- Find a minimal set
-
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.