Coupling edge SWAP in progress Gate applied
drag to pan · scroll to zoom

Qubit Routing 2D: SWAP Networks on a Coupling Graph

Real quantum hardware only wires each qubit to a few physical neighbours, so a quantum-development platform's compiler has to route every two-qubit gate in a logical circuit onto that limited connectivity before it can run. This simulator renders a physical qubit lattice — switchable between a square grid, a ring, and a line — and replays a randomly generated circuit of CNOT gates, using breadth-first search to find the shortest path between the current physical locations of each gate's two logical qubits and inserting the minimal SWAP chain to bring them adjacent. Node colours track individual logical qubits as they drift across the physical layout, and live counters report gates executed, SWAPs inserted, and the resulting SWAP-per-gate overhead — the exact cost metric quantum compilers such as Qiskit's and Cirq's routing passes are built to minimise.