[NEW PASS] Global Phase Graph Optimizer #400
Closed
q-inho
started this conversation in
New Compiler Pass
Replies: 2 comments 6 replies
-
|
I'm curious to see the benchmark results- feel free to post them here when ready @q-inho . And in the meantime, the UCC team is here to answer questions as needed :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@q-inho How is development going for you? Do you need any support from the UCC team? :) |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1. How the technique works
The GPGO attempts two of the most expesnive resources, non-Clifford$T$ gates and two-qubit entangling gates in one sweep.
Alebebraic phase compression$T$ or controlled-phase gate is first recast as term in a phase-polynomial over bits. Optimizing that polynomial is mathematically the same as a minimum distance decoding problem in a Reed-Muller code. By solving this decoding task we remove redundant phase terms, cutting the $T$ -count and $T$ -depth often down to the provable minimum for Clifford $+$ T circuits. The idea follows the coding-theoretic from T-Count Optimization and Reed–Muller Codes and subsequent refinements Polynomial-Time T-Depth Optimization of Clifford+T Circuits Via Matroid Partitioning.
Every
Graphical CNOT/ZZ clean-up
In parallel, the circuit is converted to a ZX-diagram. Standard spider-fusion, pivoting and local-complementation rules, implemented in libraries like PyZx and recent reinforcement-learning engines, destroy chains of commuting CNOT/ZZ gates into the fewest possible entangling operations. The copleteness of the ZX guarantees the rewritten diagran is locally identical to the origin. Reinforcement Learning Based Quantum Circuit Optimization via ZX-Calculus
Re-synthesis$T$ gates and the simplifeid ZX graph dictates an entangling pattern with edge-coloring depth. Combinding the two yields a new DAG circuit that is functionally unchanged but globally smaler, shallower, and less error-prone.
The optimized phase-polynomial specifies the minimal set of
I am expecting it as high-level pseudocode
2. Performance expectations
a. Circuit families that see the largest wins
These circuits contain whole layers of commuting
Global ZX rewriting cancels redundant entanglers arising between succeessive Trotter steps, while the phase-polynomial solver fusese smaller
These are rich in linear-phase dependeices. So by decoding the associated Reed-Muller code the pass reduces
b. UCC benchmark metrics affected
Develop your compiler pass
Once the maintainers have given you the go-ahead, you can work on the next sections:
Create a fork of UCC to develop in: [link your fork here]
Hint: We recommending syncing your fork with the main branch of UCC to stay up to date with changes.
Implement and Validate a Prototype of the Pass:
A Jupyter notebook or a small script is sufficient for the prototype: [link prototype script/notebook here].
Important: Make sure your compiler pass works as you expect on the circuits you defined in step 2a.
Implement the New Pass in the UCC Codebase:
Documentation to guide you through this process is available in the user guide. For more detailed information and examples, refer to the Qiskit documentation.
Benchmark performance
UCC benchmarks live in the separate repo called ucc-bench. We have a suite of quantum circuits that we regularly benchmark UCC and other popular quantum compilers on. Several of the key metrics we track are:
Compiling alone:
Simulating compiled circuits:
Your new pass should improve one or more of these metrics on our existing benchmark suite.
When you are ready to run benchmarks...
Useful documentation
Contributing Guide
Setting up your Developer Environment
Writing a Custom Transpiler Pass
-We use "transpiler pass" to refer to transformations that act only on the Directed Acyclic Graph (DAG) representation of the quantum circuit. Higher or lower-level optimizations (e.g. algorithm-level or pulse-level, respectively), we call "compiler passes."
Beta Was this translation helpful? Give feedback.
All reactions