Qubit Routing
Qubit routing maps the logical qubits of a circuit onto a chip with limited connectivity, inserting SWAP gates to move states between non-adjacent qubits at the smallest possible cost in time and errors.
What it means
A circuit is written as if every qubit could interact with every other, but real chips have limited connectivity — for example a square lattice where each qubit has only 4 neighbors.When a two-qubit gate targets a pair with no direct connection, the router inserts SWAP gates that walk the quantum state across intermediate qubits until the two states are adjacent.Each SWAP is expensive — it decomposes into 3 CNOTs — so it adds time and accumulates errors; good routing therefore searches for the shortest detour.Moreover, qubits are not interchangeable: coherence times and two-qubit gate fidelities differ per qubit and per connection, and they drift daily, so a calibration-aware router consults today's calibration data to route through the healthiest qubits.After execution, the measured results must be mapped back from physical qubits to the original logical qubits, which requires remembering the mapping.Routing quality directly moves overall fidelity: as of 2026, measurement-error-aware mapping and routing (MERA, 2025) reported average fidelity improvements of 25–52% over the baseline compiler without adding any extra SWAPs — evidence that mapping and routing remain an active research frontier, not a solved problem.Everyday analogy
Common misconceptions
- 'Logical qubit' has two different meanings — (a) a qubit in your circuit as you wrote it, which is the sense used in routing, and (b) an error-corrected qubit built from many physical qubits. Do not conflate them.
- Qubits are NOT interchangeable — coherence times and two-qubit gate fidelities differ per qubit and per connection, and they drift daily. Good routing is therefore calibration-aware, and results must be mapped back to your original logical qubits afterward.
Key takeaways
- One SWAP costs 3 CNOTs, so every inserted SWAP adds time and error — the router's job is to find the shortest detour.
- Routing quality directly moves fidelity: as of 2026, measurement-error-aware mapping/routing (MERA, 2025) improved fidelity by 25–52% on average over the baseline compiler without extra SWAPs.
- Connectivity maps bound what is routable — e.g., a square lattice gives each qubit only 4 neighbors.
Check your understanding
Your circuit applies cx(0,1), but on the chip, physical qubits Q0 and Q1 are not connected. What does the router do?
- A.It rejects the circuit as physically impossible
- B.It measures both qubits and re-prepares them next to each other
- C.It inserts SWAP gates to move the states across intermediate connected qubits until they are adjacent
- D.It replaces the CX with a single-qubit gate that needs no connectivity
Show the answer
Answer: C. It inserts SWAP gates to move the states across intermediate connected qubits until they are adjacent
Why: Routing inserts SWAP gates as stepping-stones, moving quantum states across connected intermediate qubits. Since each SWAP decomposes into 3 CNOTs, the router minimizes the number of SWAPs.
Why should a good router consult today's calibration data before choosing a path?
- A.Because calibration data determines the color coding of the circuit diagram
- B.Because qubit coherence and two-qubit gate fidelities differ per qubit and connection and drift daily, so the shortest path through unhealthy qubits may lose to a slightly longer path through healthy ones
- C.Because calibration data is required to define the SWAP gate matrix
- D.Because routing is only allowed during calibration windows
Show the answer
Answer: B. Because qubit coherence and two-qubit gate fidelities differ per qubit and connection and drift daily, so the shortest path through unhealthy qubits may lose to a slightly longer path through healthy ones
Why: Qubits are not interchangeable: their quality varies per qubit and per connection and changes daily. Calibration-aware routing weighs path length against today's qubit health.
Builds on
Routing under limited connectivity + SWAP insertion is established compilation literature; SWAP = 3 CNOT is elementary identity. Regraded timebound 2026-07-10: the text carries current-state claims (as-of-2026 framing; MERA 25-52% fidelity stats, arXiv:2511.10921) that will drift with compiler ecosystems, matching the transpilation precedent.
Learn it hands-on
This concept is part of a 46-level curriculum with an interactive simulator and Lumen, a tutor whose answers are verified before you see them. Levels 1–5 are free.
