HomeQuantum PhysicsQubit Routing 2D: SWAP Networks on a Coupling Graph

Qubit Routing 2D: SWAP Networks on a Coupling Graph

Interactive 2D quantum-compiler simulator: watch a compiler route two-qubit gates onto a limited hardware coupling graph — grid, ring, or line — inserting SWAP chains via breadth-first search to bring distant logical qubits adjacent before every interaction.

Quantum Physics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-qe-topic-56 ↗ Open standalone

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.

⚙ Under the hood

Interactive 2D quantum-compiler simulator: watch a compiler route two-qubit gates onto a limited hardware coupling graph — grid, ring, or line — inserting SWAP chains via breadth-first search to bring distant logical qubits adjacent before every interaction.

quantum computingqubit routingSWAP gatesquantum compilercoupling graph2D

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)