Priority-Centrality Token-Swap (PCTS) Compilation #393
Replies: 4 comments 13 replies
-
|
Hi @vivek-kumar9696, thanks for your proposal! :) I'm one of the UCC maintainers, and this sounds like a great direction to develop. If I understand correctly, you'd want to implement a separate mapping pass which gets used in ucc to replace the current mapping passes. I believe @Misty-W has done some previous working defining a set of different layout topologies to use as test cases. You have our approval to go ahead with this pass. Let us know if you have any questions about defining benchmarks. |
Beta Was this translation helpful? Give feedback.
-
|
@vivek-kumar9696 Let us know if your have any questions or need any support on this compiler pass :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi @jordandsullivan, The results that I got using ucc-bench were very encouraging and showed significant reduction in gate counts compared to the currently used SABRE routing algorithm in UCCDefaults1. The result are as follows: The PCTS algorithm I was trying to implement did not yield good results, but I found out that the work done in Qubit Mapping Based on Subgraph Isomorphism and Filtered Depth-Limited Search may improve ucc's performance. The above results are for that algorithm and the reduction ratio closely resemble the reduction ratios achieved in the paper where they compared to SABRE swap algorithm. Can you please assist with the next steps for vetting the results and proceed for further development? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much @vivek-kumar9696 |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1. How the technique works
The PCTS pass is aimed at static, gate-model quantum circuits whose two-qubit gates must respect a sparse, fixed coupling map—the common scenario for today’s NISQ-era superconducting (e.g., IBM, Rigetti) and neutral-atom machines. PCTS combines a centrality-aware placement with a token-swap routing heuristic, aiming to reduce both two qubit gate counts and number of required passes to generate final circuit.
High-level design (two overarching steps)
We have the coupling graph of the hardware and DAG of the logical circuit.
Step 1 – Mapping (Placement)
Step 2 – Routing (Token-Swap)
When a scheduled two-qubit gate still involves distant qubits, I intend to insert Swap gates using a token-swap heuristic:
Status: the core idea for the Routing step is crystallised, but the exact heuristic (greedy vs look-ahead vs A* on token-swap cost) is still under ideation. Feedback from the community is welcome before locking the algorithm.
PS: Refer to PCTS repo for sample ipynb notebooks that explain this process. Please refer Manual_TokenSwap_Qubit_Routing.ipynb for detailed explanation about the workings of above proposal.
2. Performance expectations
a. What circuit types will this improve? (e.g., dynamic circuits, error correction)
Static, gate-model quantum circuits whose two-qubit gates must respect a sparse, fixed coupling map.
b. Which UCC metrics will it impact? (gate counts, errors, etc.)
This project was done with the aim of improving SABRE SWAP protocol Tackling the Qubit Mapping Problem for NISQ-Era Quantum Devices. It aims make some of its stochatic elements like the random initial map and the selection of a candidate swap, which is random if there are multiple candidates with identical minimum scores more deterministic. This stochasticity results in the original SABRE algorithm’s output quality being potentially very dependent on the random number generator, hence increasing required number of passes and trials.
Hence most of the metrics that I aim to improve are the ones mentioned in the paper. But I mainly wan't to eliminate the lookahead heuristic steps and the reverse traversal steps, thus reducing the time it takes for the compilation process to execute for larger, deeper circuits. How it will effect the gate count of final compiled circuit remains to be seen. When trying to solve manually for smaller coupling graphs I saw reduced gate count than SABRE compile pass, but the routing step did not follow the token swap algorithm process but rather manual solution.
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