Beam search over SWAP sequences on the SABRE benchmark: 82% fewer added gates than SABRE and 29% fewer than the best published routings for IBM Q20 Tokyo, found by an autonomous agent
Harish Santhanalakshmi Ganesan
Abstract
Preprint with the routed circuits, verifier and search code. We revisit the qubit-routing benchmark of Li, Ding and Xie (SABRE, ASPLOS 2019): 26 circuits routed onto the 43-edge IBM Q20 Tokyo coupling graph, scored by the number of added gates (three per inserted SWAP). With the same circuits, graph and metric and an exact replay verifier, our routings need 12,087 added gates in total against SABRE's published 68,559 (82% fewer). On identical inputs, Qiskit 2.4.1 SABRE gives 64,137 (default) and 53,418 (heavy trials), and pytket 2.18.5 gives 35,685. On the 15 circuits reported in common by later routing papers on this device, the best published counts (HAIL, 2025) total 13,044 against our 9,312. Our count is lower on every circuit than every method we found (SAHS, MCTS, FiDLS, ILS, TWP, HAIL), with one tie. The routings come from a level-synchronous beam search over SWAP sequences, combined with SABRE-style forward-reverse passes to refine the initial mapping. The search code was written by a language-model agent inside an autonomous discovery loop (about three hours, about 21 USD of model usage). Beam search for routing is not new. The contribution is the measured gap on this widely cited suite, the exactly verifiable routed circuits, and an account of the discovery process. Caveats: far more compute per circuit than the baselines, a metric that ignores depth and fidelity, two regenerated QFT circuits, and the design graph rather than the physical device. Files: the preprint (PDF + LaTeX source, figures, bibliography); the 26 OpenQASM benchmark circuits with the QFT generator; qmap.py (QASM parser, coupling graph, exact replay verifier, SABRE reimplementation); routings/best_combined.json (initial mapping and full operation sequence per circuit) with a per-circuit source map; the baseline script and its output; every proposer run's router code, drivers and notes; SHA-256 sums. Reproduce: python qmap.py verify routings/best_combined.json (prints total_g_add 12087).