Three Swaps To Meet

A device's coupling map is a line: two-qubit gates are allowed only between neighbours.

Linear coupling map: qubit 0 to 1 to 2 to 3 to 4 012 34

The circuit is a single CX(q0, q4) and the layout stage has already mapped virtual qiq_i to physical ii. A SWAP compiles to 3 CX gates on this backend.

What does the routing stage produce?

A

No SWAPs; the transpiler relabels the qubits so the two ends become adjacent

B

3 SWAPs, giving 10 CX gates in total

C

1 SWAP, giving 4 CX gates in total

D

4 SWAPs, giving 12 CX gates in total