Near term quantum devices have the potential to outperform classical computing through the use of hybrid classical-quantum algorithms such as Variational Quantum Eigensolvers. These iterative algorithms use a classical optimiser to update a parameterised quantum circuit. Each iteration, the circuit is executed on a physical quantum processor or quantum computing simulator, and the average measurement result is passed back to the classical optimiser. When many iterations are required, the whole quantum program is also recompiled many times. We have implemented explicit parameters that prevent recompilation of the whole program in the quantum programming framework OpenQL, called OpenQLPC. These parameters improve the compilation and therefore total runtime for hybrid quantum-classical algorithms. We compare the time required for compilation and simulation of the MAXCUT algorithm in OpenQLpcto the same algorithm in both PyQuil and Qiskit. We show that efficient handling of parameterised circuits results in up to 70 % reduction in total compilation time for the MAXCUT benchmark, and leads to a reduced total execution time. When using OpenQLPC, compilation of hybrid algorithms is up to two times faster than when using PyQuil or Qiskit.
Near term quantum devices have the potential to outperform classical computing through the use of hybrid classical-quantum algorithms such as Variational Quantum Eigensolvers. These iterative algorithms use a classical optimiser to update a parameterised quantum circuit. Each iteration, the circuit is executed on a physical quantum processor or quantum computing simulator, and the average measurement result is passed back to the classical optimiser. When many iterations are required, the whole quantum program is also recompiled many times. We have implemented explicit parameters that prevent recompilation of the whole program in the quantum programming framework OpenQL, called OpenQLPC. These parameters improve the compilation and therefore total runtime for hybrid quantum-classical algorithms. We compare the time required for compilation and simulation of the MAXCUT algorithm in OpenQLpcto the same algorithm in both PyQuil and Qiskit. We show that efficient handling of parameterised circuits results in up to 70 % reduction in total compilation time for the MAXCUT benchmark, and leads to a reduced total execution time. When using OpenQLPC, compilation of hybrid algorithms is up to two times faster than when using PyQuil or Qiskit.
A large class of problems in the current era of quantum devices involve interfacing between the quantum and classical system. These include calibration procedures, charac-terization routines, and variational algorithms. The control in these routines iteratively switches between the classical and the quantum computer. This results in the repeated compilation of the program that runs on the quantum system, scaling directly with the number of circuits and iterations. The repeated compilation results in a significant overhead throughout the routine. In practice, the total runtime of the program (classical compilation plus quantum execution) has an additional cost proportional to the circuit count. At practical scales, this can dominate the round-trip CPU-QPU time, between 5% and 80%, depending on the proportion of quantum execution time. To avoid repeated device-level compilation, we identify that machine code can be parametrized corresponding to pulse/gate parameters which can be dynamically adjusted during execution. Therefore, we develop a device-level partial-compilation (DLPC) technique that reduces compilation overhead to nearly constant, by using cheap remote procedure calls (RPC) from the QPU control software to the CPU. We then demonstrate the performance speedup of this on optimal pulse calibration, system characterization using randomized benchmarking (RB), and variational algorithms. We execute this modified pipeline on real trapped-ion quantum computers and observe significant reductions in compilation time, as much as 2.7x speedup for small-scale VQE problems.
We explore a method for automatically recompiling a quantum circuit A into a target circuit B , with the goal that both circuits have the same action on a specific input i.e. B ∣ i n ⟩ = A ∣ i n ⟩ . This is of particular relevance to hybrid, NISQ-era algorithms for dynamical simulation or eigensolving. The user initially specifies B as a blank template: a layout of parameterised unitary gates configured to the identity. The compilation then proceeds using quantum hardware to perform an isomorphic energy-minimisation task, and an optional gate elimination phase to compress the circuit. If B is insufficient for perfect recompilation then the method will result in an approximate solution. We optimise using imaginary time evolution, and a recent extension of quantum natural gradient for noisy settings. We successfully recompile a 7 -qubit circuit involving 186 gates of multiple types into an alternative form with a different topology, far fewer two-qubit gates, and a smaller family of gate types. Moreover we verify that the process is r o b u s t , finding that per-gate noise of up to 1 % can still yield near-perfect recompilation. We test the scaling of our algorithm on up to 20 qubits, recompiling into circuits with up to 400 parameterized gates, and incorporate a custom adaptive timestep technique. We note that a classical simulation of the process can be useful to optimise circuits for today's prototypes, and more generally the method may enable `blind' compilation i.e. harnessing a device whose response to control parameters is deterministic but unknown.The code and resources used to generate our results are openly available online \cite{githubLink} \cite{mmaGithubLink}. A simple Mathematica demonstration of our algorithm can be found at questlink.qtechtheory.org.
<!--HTML-->Variational algorithms are among the most promising near-term applications of quantum computers. Their execution is particularly challenging for current quantum computing systems since they require a tight interaction between the host CPU and the quantum accelerator. Here we present Intel Quantum SDK, an LLVM-based C++ compiler toolchain to efficiently compile and execute variational algorithms. Using our extension to the C++ language, the user can write programs describing both the quantum and classical parts of the algorithm. The classical and quantum parts of the C++ source are then compiled by the LLVM framework and by a novel quantum device compiler component, respectively. The runtime is augmented with the capability of executing quantum circuits dynamically, meaning that the values of the circuit's parameters can be changed without triggering the recompilation of the quantum part. We briefly describe how to gain access to the Intel Quantum SDK and get started with hybrid quantum-classical workloads.
Variational algorithms are a representative class of quantum computing workloads that combine quantum and classical computing. This paper presents an LLVM-based C++ compiler toolchain to efficiently execute variational hybrid quantum-classical algorithms on a computational system in which the quantum device acts as an accelerator. We introduce a set of extensions to the C++ language for programming these algorithms. We define a novel Executable and Linking Format (ELF) for Quantum and create a quantum device compiler component in the LLVM framework to compile the quantum part of the C++ source and reuse the host compiler in the LLVM framework to compile the classical computing part of the C++ source. A variational algorithm runs a quantum circuit repeatedly, each time with different gate parameters. We add to the quantum runtime the capability to execute dynamically a quantum circuit with different parameters. Thus, programmers can call quantum routines the same way as classical routines. With these capabilities, a variational hybrid quantum-classical algorithm can be specified in a single-source code and only needs to be compiled once for all iterations. The single compilation significantly reduces the execution latency of variational algorithms. We evaluate the framework's performance by running quantum circuits that prepare Thermofield Double (TFD) states, a quantum-classical variational algorithm.
We describe a method for automatically recompiling a quantum circuit A into a target circuit B, with the goal that both circuits have the same action on a specific input i.e. A|in> = B|in>. This is of particular relevance to hybrid, NISQ-era algorithms for dynamical simulation or eigensolving. The user initially specifies B as a blank template: a layout of parameterised unitary gates configured to the identity. The compilation then proceeds using quantum hardware to perform an isomorphic energy-minimisation task, and optionally a gate elimination phase to compress the circuit. We use a recently introduced imaginary-time technique derived from McLachlan's variational principle. If the template for B is too shallow for perfect recompilation then the method will result in an approximate solution. As a demonstration we successfully recompile a 7-qubit circuit involving 186 gates of multiple types into an alternative form with a different topology, a far lower two-qubit gate count, and a smaller family of gate types. We test the scaling of our algorithm on up to 20 qubits, recompiling into circuits with up to 400 parameterized gates, and incorporate a novel adaptive timestep technique. We note that a classical simulation of the process can be useful to optimise circuits for today's prototypes, and more generally the method may enable `blind' compilation i.e. harnessing a device whose response to control parameters is deterministic but unknown.
Quantum computing promises computational speedups over classical approaches for certain problem classes; however, in near term quantum and classical hybrid workflows, the overall performance is often constrained by classical processing overhead. The time cost associated with circuit compilation, which includes gate decomposition, topology aware qubit mapping, and depth optimization, together with protocol level communication such as circuit transfer and measurement result exchange, frequently exceeds the actual quantum circuit execution time and has become a critical bottleneck to practical deployment. In this paper, we propose QPanda 3.0, a high performance quantum programming framework optimized to accelerate the classical compilation path that underpins NISQ era hybrid integration. Leveraging an optimized compilation pipeline, a custom binary instruction stream (OriginBIS), and hardware aware execution strategies, QPanda 3.0 achieves up to 86.9 × faster encoding and 35.6 × faster decoding than OpenQASM 2.0, as well as an average 10.7 × compilation speedup over Qiskit across the four evaluated connectivity topologies, with a peak speedup of 597 × for a 118-qubit W-state circuit on a square topology. These capabilities enable the development of scalable quantum algorithms across various domains, including finance, materials science, and combinatorial optimization, supporting both industrial deployment and cloud based execution in hybrid computing environments.