Table of Contents
Fetching ...

Optimizing Quantum Compilation via High-Level Quantum Instructions

Evandro C. R. Rosa, Jerusa Marchi, Eduardo I. Duzzioni, Rafael de Santiago

TL;DR

This work addresses the bottleneck of circuit-centric quantum programming by introducing a high-levelKet construct that exposes semantic structure to the compiler through the $U^\dagger V U$ pattern. The approach enables two key capabilities: safe, dynamic management of auxiliary qubits and the use of approximate gate decompositions to reduce resources, demonstrated via a V-chain decomposition that achieves up to a 50% reduction in CNOT gates for multi-controlled NOT gates. The proposed theorems show when and how to apply these optimizations without altering the final unitary, relying on structural properties like permutation and diagonal gates. The results indicate that high-level abstractions can unlock a new class of compiler optimizations, potentially enabling more efficient quantum computation and paving the way for advanced memory management and circuit-mapping strategies.

Abstract

Current quantum programming is dominated by low-level, circuit-centric approaches that limit the potential for compiler optimization. This work presents how a high-level programming construct provides compilers with the semantic information needed for advanced optimizations. We introduce a novel optimization that leverages a quantum-specific instruction to automatically substitute quantum gates with more efficient, approximate decompositions, a process that is transparent to the programmer and significantly reduces quantum resource requirements. Furthermore, we show how this instruction guarantees the correct uncomputation of auxiliary qubits, enabling safe, dynamic quantum memory management. We illustrate these concepts by implementing a V-chain decomposition of the multi-controlled NOT gate, showing that our high-level approach not only simplifies the code but also enables the compiler to generate a circuit with up to a 50% reduction in CNOT gates. Our results suggest that high-level abstractions are crucial for unlocking a new class of powerful compiler optimizations, paving the way for more efficient quantum computation.

Optimizing Quantum Compilation via High-Level Quantum Instructions

TL;DR

This work addresses the bottleneck of circuit-centric quantum programming by introducing a high-levelKet construct that exposes semantic structure to the compiler through the pattern. The approach enables two key capabilities: safe, dynamic management of auxiliary qubits and the use of approximate gate decompositions to reduce resources, demonstrated via a V-chain decomposition that achieves up to a 50% reduction in CNOT gates for multi-controlled NOT gates. The proposed theorems show when and how to apply these optimizations without altering the final unitary, relying on structural properties like permutation and diagonal gates. The results indicate that high-level abstractions can unlock a new class of compiler optimizations, potentially enabling more efficient quantum computation and paving the way for advanced memory management and circuit-mapping strategies.

Abstract

Current quantum programming is dominated by low-level, circuit-centric approaches that limit the potential for compiler optimization. This work presents how a high-level programming construct provides compilers with the semantic information needed for advanced optimizations. We introduce a novel optimization that leverages a quantum-specific instruction to automatically substitute quantum gates with more efficient, approximate decompositions, a process that is transparent to the programmer and significantly reduces quantum resource requirements. Furthermore, we show how this instruction guarantees the correct uncomputation of auxiliary qubits, enabling safe, dynamic quantum memory management. We illustrate these concepts by implementing a V-chain decomposition of the multi-controlled NOT gate, showing that our high-level approach not only simplifies the code but also enables the compiler to generate a circuit with up to a 50% reduction in CNOT gates. Our results suggest that high-level abstractions are crucial for unlocking a new class of powerful compiler optimizations, paving the way for more efficient quantum computation.

Paper Structure

This paper contains 9 sections, 3 theorems, 22 equations, 4 figures.

Key Result

theorem thmcountertheorem

Let $U$ be a unitary operation of the form $U = A^\dagger B A$, where $A$ and $B$ are also unitary. The n-controlled version of $U$, denoted $C^nU$, can be simplified as: Visually, this equivalence is:

Figures (4)

  • Figure 1: Equivalent CNOT gate implementations in Ket: Left via a with control block, Right via the ctrl() function.
  • Figure 2: Ket implementation of the $R_{XX}$ gate. Top Left: The rxx_xplct function implements the gate by explicitly calling the inverse of the U gate. Top Right: The rxx function uses the with around instruction, which automatically applies the inverse of the gate U at the end of the block. Bottom: Resulting quantum circuit with angle equal to $\pi$. Both codes generate the same quantum circuit.
  • Figure 3: Two implementations of the V-chain multi-controlled NOT decomposition. Left: A concise version using the with around construct and the @using_aux decorator for auxiliary qubit allocation. Right: An explicit implementation that manually manages the auxiliary qubits and gate calls.
  • Figure 4: Resulting quantum circuits for a 6-control NOT gate using the V-chain decomposition. Top: The circuit generated from the explicit v_chain_x implementation. Bottom: The more efficient circuit generated from the v_chain implementation, which leverages compiler optimizations enabled by with around to use approximate Toffoli.

Theorems & Definitions (6)

  • theorem thmcountertheorem
  • proof
  • theorem thmcountertheorem
  • proof
  • theorem thmcountertheorem
  • proof