Table of Contents
Fetching ...

QOPS: A Compiler Framework for Quantum Circuit Simulation Acceleration with Profile Guided Optimizations

Yu-Tsung Wu, Po-Hsuan Huang, Kai-Chieh Chang, Chia-Heng Tu, Shih-Hao Hung

TL;DR

Experimental results show the PGO can effectively shorten the simulation time on tested benchmark programs, and the simulator-specific PGO (virtual swap) can be applied to the benchmarks to accelerate the simulation speed by a factor of 1.19.

Abstract

Quantum circuit simulation is important in the evolution of quantum software and hardware. Novel algorithms can be developed and evaluated by performing quantum circuit simulations on classical computers before physical quantum computers are available. Unfortunately, compared with a physical quantum computer, a prolonged simulation time hampers the rapid development of quantum algorithms. Inspired by the feedback-directed optimization scheme used by classical compilers to improve the generated code, this work proposes a quantum compiler framework QOPS to enable profile-guided optimization (PGO) for quantum circuit simulation acceleration. The QOPS compiler instruments a quantum simulator to collect performance data during the circuit simulation and it then generates the optimized version of the quantum circuit based on the collected data. Experimental results show the PGO can effectively shorten the simulation time on our tested benchmark programs. Especially, the simulator-specific PGO (virtual swap) can be applied to the benchmarks to accelerate the simulation speed by a factor of 1.19. As for the hardware-independent PGO, compared with the brute force mechanism (turning on all available compilation flags), which achieves 21% performance improvement against the non-optimized version, the PGO can achieve 16% speedup with a factor of 63 less compilation time than the brute force approach.

QOPS: A Compiler Framework for Quantum Circuit Simulation Acceleration with Profile Guided Optimizations

TL;DR

Experimental results show the PGO can effectively shorten the simulation time on tested benchmark programs, and the simulator-specific PGO (virtual swap) can be applied to the benchmarks to accelerate the simulation speed by a factor of 1.19.

Abstract

Quantum circuit simulation is important in the evolution of quantum software and hardware. Novel algorithms can be developed and evaluated by performing quantum circuit simulations on classical computers before physical quantum computers are available. Unfortunately, compared with a physical quantum computer, a prolonged simulation time hampers the rapid development of quantum algorithms. Inspired by the feedback-directed optimization scheme used by classical compilers to improve the generated code, this work proposes a quantum compiler framework QOPS to enable profile-guided optimization (PGO) for quantum circuit simulation acceleration. The QOPS compiler instruments a quantum simulator to collect performance data during the circuit simulation and it then generates the optimized version of the quantum circuit based on the collected data. Experimental results show the PGO can effectively shorten the simulation time on our tested benchmark programs. Especially, the simulator-specific PGO (virtual swap) can be applied to the benchmarks to accelerate the simulation speed by a factor of 1.19. As for the hardware-independent PGO, compared with the brute force mechanism (turning on all available compilation flags), which achieves 21% performance improvement against the non-optimized version, the PGO can achieve 16% speedup with a factor of 63 less compilation time than the brute force approach.

Paper Structure

This paper contains 17 sections, 7 figures, 6 tables.

Figures (7)

  • Figure 1: The PGO concept in QOPS for switching on specific optimizations to generate an optimized quantum circuit, based on the profiling data collected in the profiling run.
  • Figure 2: The workflow for the QOPS framework, where it involves a profiling run to collect the performance statistics by the instrumented quantum simulator, and an optimization run to accelerate the quantum circuit simulation with the input circuit that is compiled with the optimizations guided by the profiling data of the profiling run.
  • Figure 3: A zoom-in view of the QOPS compiler using profiling guided optimization shown on the top-right corner of Fig. \ref{['fig:workflow']}.
  • Figure 4: Illustration of the virtual swap optimization for the single-qubit (between $q_0$ & $q_{2}$) and two-qubit gates (between $q_0$ & $q_{4}$). The execution time for quantum gates are different in distinct segments (file segment and chunk segment).
  • Figure 5: Quantum circuit visualization for performance debugging, converted by our developed tool from the context-based profiling data in Listing \ref{['lst:context_profile_data']}.
  • ...and 2 more figures