Ta strona nie została jeszcze przetłumaczona na język polski. Oglądasz oryginalną wersję angielską.
Transpilation Optimizations with SABRE
Usage estimate: under one minute on a Heron r2 processor (NOTE: This is an estimate only. Your runtime might vary.)
Background
Transpilation is a critical step in Qiskit that converts quantum circuits into forms compatible with specific quantum hardware. It involves two key stages: qubit layout (mapping logical qubits to physical qubits on the device) and gate routing (ensuring multi-qubit gates respect device connectivity by inserting SWAP gates as needed).
SABRE (SWAP-Based Bidirectional heuristic search algorithm) is a powerful optimization tool for both layout and routing. It is especially effective for large-scale circuits (100+ qubits) and devices with complex coupling maps, like the IBM® Heron, where the exponential growth in possible qubit mappings demands efficient solutions.
Why use SABRE?
SABRE minimizes the number of SWAP gates and reduces circuit depth, improving circuit performance on real hardware. Its heuristic-based approach makes it ideal for advanced hardware and large, complex circuits. Recent improvements introduced in the LightSABRE algorithm further optimize SABRE’s performance, offering faster runtimes and fewer SWAP gates. These enhancements make it even more effective for large-scale circuits.
What you’ll learn
This tutorial is divided into two parts:
- Learn to use SABRE with Qiskit patterns for advanced optimization of large circuits.
- Leverage qiskit_serverless to maximize SABRE’s potential for scalable and efficient transpilation.
You will:
- Optimize SABRE for circuits with 100+ qubits, surpassing default transpilation settings like
optimization_level=3. - Explore LightSABRE enhancements that improve runtime and reduce gate counts.
- Customize key SABRE parameters (
swap_trials,layout_trials,max_iterations,heuristic) to balance circuit quality and transpilation runtime.
Requirements
Before starting this tutorial, be sure you have the following installed:
- Qiskit SDK v1.0 or later, with visualization support
- Qiskit Runtime v0.28 or later (
pip install qiskit-ibm-runtime) - Serverless (
pip install qiskit-ibm-catalog qiskit_serverless)