Let be the device's connectivity graph and let be a circuit on logical qubits , , whose two-qubit gates act on pairs and are partially ordered by the circuit's dependency DAG. A layout is an injective map . A SWAP on an edge changes the layout by exchanging the logical qubits held at and .
A mapping and routing solution is an initial layout together with a sequence of gates, consisting of the gates of in an order compatible with the DAG interleaved with SWAPs, such that each two-qubit gate on is scheduled at a time when the current layout satisfies . The resulting circuit implements followed by the permutation of qubits given by the final layout, which is tracked classically rather than undone. The objective is to minimise the number of SWAPs (each typically three CNOTs, by the SWAP identity), the depth, or an estimated success probability built from per-edge error rates.
The problem was posed for cloud superconducting processors as qubit allocation by Siraichi et al.. Widely used heuristics include the bidirectional search SABRE of Li, Ding and Xie, the A*-based layer-by-layer method of Zulehner, Paler and Wille, and the architecture-agnostic routing of Cowtan et al..