arXiv:2610.29170quant-phOct 2026

Manuscript Offprint

arXiv:2610.29170

Turning Quantum Compiler Configuration Selection Upside Down: A Top-Down Paradigm

Ming Zhong, Xiangyu Ren, Kangyu Zheng, Zhi Zeng, Shenggen Zheng, Shaohua Li, Zhiding Liang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Ming Zhong

mzhong25@cse.cuhk.edu.hk

The Chinese University of Hong Kong

Hong Kong SAR, China

Zhi Zeng

zzeng26@cse.cuhk.edu.hk

The Chinese University of Hong Kong

Hong Kong SAR, China

Xiangyu Ren

xiyu.ren@outlook.com

The Chinese University of Hong Kong

Hong Kong SAR, China

Shenggen Zheng

zhengshenggen@gmail.com

Quantum Science Center of

Guangdong-Hong Kong-Macao

Greater Bay Area

Guangdong Province, China

Kangyu Zheng

kyzheng@cse.cuhk.edu.hk

The Chinese University of Hong Kong

Hong Kong SAR, China

Shaohua Li

shaohuali@cse.cuhk.edu.hk

The Chinese University of Hong Kong

Hong Kong SAR, China

Zhiding Liang ∗^{*}

zliang@cse.cuhk.edu.hk

The Chinese University of Hong Kong; State Key Laboratory of Quantum Information Technologies and Materials (CUHK)

Hong Kong SAR, China

Abstract

Selecting an effective quantum compiler configuration requires coordinated decisions over both hardware targets and compiler settings, with the ultimate goal of improving circuit execution fidelity. Existing state-of-the-art approaches such as MQT Predictor typically decompose this problem into two sequential stages: a device is chosen first, after which compiler options are tuned on that device through iterative reinforcement-learning-based search. This bottom-up strategy can be fundamentally limited by its initial device decision, since a poorly matched backend may constrain the best fidelity achievable regardless of how effectively later compiler options are optimized. In contrast to classical compiler tuning, where the search space is often prohibitively large, the configuration space of practical quantum compilation remains manageable enough to support exhaustive offline evaluation. This property opens up a different possibility: rather than repeatedly searching from candidate configurations, one can derive reusable configuration knowledge from offline oracle results and apply it directly to unseen circuits.

Based on this idea, in this paper, we introduce a top-down configuration-selection paradigm and build QuOptBench, an exhaustively characterized benchmark containing empirical oracle configurations for 268 quantum circuits. We first study whether LLMs can directly infer suitable configurations and evaluate ten representative models. The results reveal that vanilla LLMs often favor unnecessarily complex compiler settings and therefore remain far from the oracle. We then employ Claude-Opus-5 to examine oracle decisions from 68 sampled circuits and extract 13 transferable rules governing device and compiler-option selection. Using these rules together with lightweight predictors trained on the complete enumerated configuration data of the sampled circuits, we design QCompass, a compact rule-guided ML framework that performs fast configuration selection without iterative online search. Across our evaluation, the distilled rules consistently strengthen LLM-based selection, while QCompass provides the strongest overall balance between solution quality and selection latency among the compared methods. These results indicate that transferring knowledge from offline oracle characterization offers a promising alternative to conventional bottom-up quantum compiler tuning.

1 Introduction

Quantum computing has rapidly advanced with the development of both quantum hardware and software [5, 22, 32, 46]. Unlike compilation for classical programs, quantum compilation must account for noisy and error-prone quantum hardware. Therefore, the quality of a compiled circuit on a target device is commonly measured by execution fidelity [28], which reflects the combined effects of compilation and hardware characteristics, such as topology and gate errors.

As illustrated in Fig. 1a, quantum compilation involves two closely coupled decisions. The first is device selection. Since different quantum devices have distinct gate error rates and connectivity topology, selecting a suitable device for each circuit is critical to maximizing execution fidelity, analogous to routing requests to appropriate LLMs [16]. The second is option selection, which determines how the circuit is compiled for the selected device through stages including layout, routing, translation, etc. Importantly, first-stage device decision defines the hardware constraints and error characteristics for all subsequent compilation stages.

Taking the widely used IBM Qiskit compiler [26] as an example, users can configure optimization levels from O0O_{0} to O3O_{3}, as well as

∗^{*}Corresponding Author.

methods including layout, routing, etc. Although O3O_{3} applies the most complex optimization flow, neither O3O_{3} nor any method is universally optimal across circuits.

Fig. 1b illustrates the impact of both device and option selection. Under a fixed O3O_3 configuration, the ising_n10 circuit achieves substantially different execution fidelities (measured by Hellinger fidelity [27]) across devices; on a fixed device, varying the optimization level from O0O_0 to O3O_3 also leads to clear differences, with O1O_1 achieving about 0.20 fidelity compared with only 0.12 for O3O_3. This shows that neither a fixed device nor the O3O_3 option is consistently optimal.

This observation is further supported by our later evaluation, where we exhaustively enumerate the considered devices and compiler options for 268 circuits. Under our compilation settings, 213 cases (79.5%) have at least one capacity-feasible device whose best achievable fidelity (measured by estimated fidelity [49, 50]) across all option combinations is still lower than the default O3O_{3} configuration fidelity on another feasible device. This result shows that an unfavorable device choice can impose a fidelity ceiling that subsequent option selection cannot overcome.

Therefore, we formulate the joint selection of suitable devices and compiler options for quantum circuits as quantum compiler configuration selection. In classical compilers, a similar problem is compiler auto-tuning, which has been addressed using heuristic search [6, 17, 24, 44, 64, 65], reinforcement learning (RL) [9, 12, 37, 45], and more recently LLMs [11, 43, 48]. Heuristic and RL-based methods typically start from candidate configurations and iteratively improve them using predefined rules or performance feedback, even though a trained RL agent can perform direct inference. We refer to this as a bottom-up search paradigm, whose selection knowledge is acquired by iteratively evaluating candidate configurations and learning from feedback. In contrast, LLMs can directly reason about suitable configurations, resembling a direct selection process.

Candidate Configurations → Evaluation → Better Configuration

Bottom-Up Search

Additionally, classical compiler auto-tuning typically assumes a fixed target platform and may involve extremely large flag or pass spaces, e.g., up to 126 flags ( 21262^{126} search space) in a recent GCC auto-tuning study [47]. Quantum compiler configuration differs in two important aspects. First, the target device is itself a selection dimension. The state-of-the-art (SOTA) method [50] adopts a two-stage workflow, using an ML model for device selection and an RL model for compiler option tuning. While this modular design facilitates new-device integration, a suboptimal device choice can impose a fidelity ceiling that subsequent option tuning cannot overcome.

Second, quantum compiler configuration has a bounded discrete search space in widely used compilers such as Qiskit [26]. In our setting, each circuit has only 960 device-option configurations, making exhaustive offline enumeration feasible for obtaining empirical oracles. This enables an oracle-guided top-down selection paradigm, where selection rules extracted from these oracle configurations directly guide configuration selection without bottom-up search.

Oracle Configurations → Rules → Direct Selection

Top-Down Selection

In this paper, we systematically investigate the proposed top-down selection paradigm using the Qiskit compiler. We first construct QuOptBench, the first oracle-guided benchmark for Qiskit compiler configuration selection, covering 268 circuits with empirical oracle configurations. We then evaluate ten LLMs as a natural realization of direct selection. Results show that vanilla LLMs remain substantially below the oracle, largely due to their preference for overly aggressive configurations, such as higher optimization levels and more complex layout and routing methods.

Motivated by this finding, we instead use a strong reasoning model, Claude-Opus-5 [8], to analyze oracle decisions on 68 carefully categorized and sampled circuits and distill 13 transferable device- and option-selection rules. Based on these rules, we develop QCompass, a lightweight rule-guided ML framework for selecting configurations for new circuits. Experimental results show that the distilled rules consistently improve LLM-based selection, while QCompass achieves higher fidelity with a favorable trade-off between configuration quality and inference overhead.

The main contributions of this work are summarized as follows:

  • We construct QuOptBench, the first exhaustive benchmark for the Qiskit quantum compiler configuration selection containing 268 circuits with empirical oracle configurations.

  • We investigate ten LLMs as a natural realization of direct quantum compiler configuration selection. Our empirical study shows that general-purpose LLM reasoning alone cannot reliably reproduce oracle-quality configurations.

  • We develop an oracle-guided rule-distillation workflow that contrasts O3O_{3} configurations with exhaustive-search oracles, explains their differences using circuit and device characteristics, and consolidates recurring patterns into transferable device- and option-selection rules.

  • We design QCompass, a lightweight rule-guided learning and inference approach that applies the distilled rules to new circuits, shifting quantum compiler optimization from repeated bottom-up search to efficient top-down selection.

  • We conduct comprehensive evaluations of QCompass, including comparisons with bottom-up search methods, nearest-neighbor retrieval, and direct LLM-based selection, as well as generalization to additional circuits and devices.

References (25)