Table of Contents
Fetching ...

Breaking Down Quantum Compilation: Profiling and Identifying Costly Passes

Felix Zilk, Alessandro Tundo, Vincenzo De Maio, Ivona Brandic

TL;DR

This work addresses the compilation-time overhead in quantum program execution by profiling Qiskit's built-in transpiler passes to identify bottlenecks for large circuits (QFT and GHZ on 100 qubits). It adopts a methodology based on Python cProfile to quantify per-pass runtime across Qiskit's preset pipelines (levels 0–3) and analyzes the top costly passes, revealing that higher optimization levels concentrate time in circuit optimization and gate synthesis, with mapping sometimes dominating GHZ compilation. The contributions include a first-pass-level profiling study, insights into which passes drive compilation time, and a publicly available dataset and codebase to aid precompilation strategies. The practical impact is to guide researchers in targeting bottlenecks for precompilation and optimization, potentially reducing runtime overhead in real quantum workloads.

Abstract

With the increasing capabilities of quantum systems, the efficient, practical execution of quantum programs is becoming more critical. Each execution includes compilation time, which accounts for substantial overhead of the overall program runtime. To address this challenge, proposals that leverage precompilation techniques have emerged, whereby entire circuits or select components are precompiled to mitigate the compilation time spent during execution. Considering the impact of compilation time on quantum program execution, identifying the contribution of each individual compilation task to the execution time is necessary in directing the community's research efforts towards the development of an efficient compilation and execution pipeline. In this work, we perform a preliminary analysis of the quantum circuit compilation process in Qiskit, examining the cumulative runtime of each individual compilation task and identifying the tasks that most strongly impact the overall compilation time. Our results indicate that, as the desired level of optimization increases, circuit optimization and gate synthesis passes become the dominant tasks in compiling a Quantum Fourier Transform, with individual passes consuming up to 87% of the total compilation time. Mapping passes require the most compilation time for a GHZ state preparation circuit, accounting for over 99% of total compilation time.

Breaking Down Quantum Compilation: Profiling and Identifying Costly Passes

TL;DR

This work addresses the compilation-time overhead in quantum program execution by profiling Qiskit's built-in transpiler passes to identify bottlenecks for large circuits (QFT and GHZ on 100 qubits). It adopts a methodology based on Python cProfile to quantify per-pass runtime across Qiskit's preset pipelines (levels 0–3) and analyzes the top costly passes, revealing that higher optimization levels concentrate time in circuit optimization and gate synthesis, with mapping sometimes dominating GHZ compilation. The contributions include a first-pass-level profiling study, insights into which passes drive compilation time, and a publicly available dataset and codebase to aid precompilation strategies. The practical impact is to guide researchers in targeting bottlenecks for precompilation and optimization, potentially reducing runtime overhead in real quantum workloads.

Abstract

With the increasing capabilities of quantum systems, the efficient, practical execution of quantum programs is becoming more critical. Each execution includes compilation time, which accounts for substantial overhead of the overall program runtime. To address this challenge, proposals that leverage precompilation techniques have emerged, whereby entire circuits or select components are precompiled to mitigate the compilation time spent during execution. Considering the impact of compilation time on quantum program execution, identifying the contribution of each individual compilation task to the execution time is necessary in directing the community's research efforts towards the development of an efficient compilation and execution pipeline. In this work, we perform a preliminary analysis of the quantum circuit compilation process in Qiskit, examining the cumulative runtime of each individual compilation task and identifying the tasks that most strongly impact the overall compilation time. Our results indicate that, as the desired level of optimization increases, circuit optimization and gate synthesis passes become the dominant tasks in compiling a Quantum Fourier Transform, with individual passes consuming up to 87% of the total compilation time. Mapping passes require the most compilation time for a GHZ state preparation circuit, accounting for over 99% of total compilation time.

Paper Structure

This paper contains 8 sections, 5 figures.

Figures (5)

  • Figure 1: The depicted workflow for quantum program execution is based on the model in Leymann2020 and adapted with a more nuanced view of quantum circuit compilation, as presented in Quetschlich2025MQTPred.
  • Figure 2: The workflow of our profiling methodology.
  • Figure 3: Compilation and QPU execution times of the QFT and GHZ circuits for different optimization levels.
  • Figure 4: Boxplots of the top 10 most expensive Qiskit preset compiler passes for the QFT circuit and optimization levels 0 (a), 1 (b), 2 (c), and 3 (d). Passes from the gate synthesis category are marked blue, qubit mapping passes are pink, and circuit optimization passes are orange. Scheduling passes are displayed in dark blue, while uncategorized passes remain white. Right-diagonal hatching (/) indicates passes that occur in two stages, and cross-hatching (x) indicates passes that occur in more than two stages.
  • Figure 5: Boxplots of the top 10 most expensive Qiskit preset compiler passes for the GHZ state preparation and optimization levels 0 (a), 1 (b), 2 (c), and 3 (d). Passes from the gate synthesis category are marked blue, qubit mapping passes are pink, and circuit optimization passes are orange. Scheduling passes are displayed in dark blue, while uncategorized passes remain white. Right-diagonal hatching (/) indicates passes that occur in two stages, and cross-hatching (x) indicates passes that occur in more than two stages.