Abstract
With the birth of Noisy Intermediate Scale Quantum (NISQ) devices and the verification of "quantum supremacy" in random number sampling and boson sampling, more and more fields hope to use quantum computers to solve specific problems, such as aerodynamic design, route allocation, financial option prediction, quantum chemical simulation to find new materials, and the challenge of quantum cryptography to automotive industry security. However, these fields still need to constantly explore quantum algorithms that adapt to the current NISQ machine, so a quantum programming framework that can face multi-scenarios and application needs is required. Therefore, this paper proposes QPanda, an application scenario-oriented quantum programming framework with high-performance simulation. Such as designing quantum chemical simulation algorithms based on it to explore new materials, building a quantum machine learning framework to serve finance, etc. This framework implements high-performance simulation of quantum circuits, a configuration of the fusion processing backend of quantum computers and supercomputers, and compilation and optimization methods of quantum programs for NISQ machines. Finally, the experiment shows that quantum jobs can be executed with high fidelity on the quantum processor using quantum circuit compile and optimized interface and have better simulation performance.
Introduction
We are currently in the "NISQ era" of quantum computing. While we have achieved "quantum supremacy" in specific niche tasks, applying quantum computers to industrial problems—like aerodynamic design, financial modeling, or drug discovery—remains a massive challenge. Existing hardware is limited by low qubit counts, high noise levels, and rigid physical topologies. Developers need a framework that doesn't just provide basic gates, but also offers high-performance classical simulation to verify algorithms, advanced optimization to shrink quantum circuits, and domain-specific tools that allow experts in finance or chemistry to utilize quantum power without deep expertise in quantum physics.
System Architecture
QPanda adopts a layered architecture designed to abstract the complexities of quantum hardware while providing robust tools for algorithm development. This structure allows for a seamless transition from high-level application logic down to physical hardware execution.
The architecture is divided into four primary layers:
- Algorithm Layer: Contains standard implementations like HHL, Grover, and QAOA.
- Utilities Layer: Provides essential services such as quantum state tomography (QST), qubit mapping, and fidelity measurement.
- Core Layer: Manages the fundamental building blocks of quantum programs, including circuits, gates, and measurement operations.
- Backend Layer: Supports a variety of simulators (full amplitude, noise-inclusive, etc.) and interfaces with classical computing devices like CPUs and GPUs.
Technical Innovations
Hybrid Backends and Simulation Optimization
QPanda introduces a "quantum-supercomputer fusion" model. This allows for circuit partitioning, where a massive quantum circuit is decomposed into smaller sub-circuits that can be handled by current NISQ devices or simulated on classical supercomputers. To maximize performance, QPanda utilizes OpenMP for multi-threading and GPU acceleration. It features "adaptive parallelism," which intelligently manages overhead by only triggering multi-threading when the circuit complexity justifies it, resulting in a 5x performance improvement in circuit simulation compared to unoptimized methods.
Multi-Level Compilation and Mapping
To ensure high fidelity on real chips, such as the superconducting "Wuyuan" or semiconductor "Wuben" chips, QPanda performs several optimization passes. These include removing redundant identity gates, merging consecutive rotation gates, and decomposing complex multi-control gates into hardware-compatible basis gates. Furthermore, it employs the opt-bmt algorithm to map virtual qubits to the specific physical layout of a quantum chip, minimizing the need for noise-inducing "swap" gates.
Programming Workflow and Usability
A key strength of QPanda is its accessibility for developers using familiar languages like C++ and Python. The framework introduces logical constructs like Qif and QWhile, allowing developers to use familiar classical control flow logic within quantum programs.
As shown in the workflow, users can initialize quantum states, allocate qubits and classical bits, and construct circuits that are then compiled and run across diverse computing machines, including personal computers, supercomputers, and QPUs.
Performance Evaluation
The paper evaluates QPanda using standard benchmarks, including random quantum circuits and the Quantum Approximate Optimization Algorithm (QAOA). Performance was benchmarked against industry standards including Qiskit (IBM), Cirq (Google), ProjectQ, and Qulacs.
- Competitive Edge: In head-to-head benchmarks for simulating random circuits, QPanda consistently outperformed Qiskit, Cirq, and ProjectQ in both single-threaded and multi-threaded CPU tests.
- Circuit Shrinkage: For a 16-qubit QAOA algorithm on a circle topology, QPanda's optimizer reduced the circuit depth from 2669 to 1977 and significantly reduced CNOT gate counts, directly improving the probability of successful execution on real hardware.
- GPU Efficiency: The GPU-accelerated backend showed massive performance gains over CPU-only methods, maintaining low simulation times even as qubit counts increased.
Conclusion
QPanda provides a versatile, high-performance bridge between abstract quantum algorithms and real-world NISQ hardware. By prioritizing optimization and developer experience, it enables researchers to execute high-fidelity quantum programs for critical industries. Future work will focus on integrating QPanda as a high-performance backend for other popular libraries like Cirq and PennyLane, broadening the reach of its optimization engine.
Summary updated