QPanda3
Supported by OriginQ
Loading...
Searching...
No Matches
Welcome to QPanda3

中文 English

QPanda3 (Quantum Programming Architecture for NISQ Device Application v3) is a high-performance quantum programming framework that enhances quantum computing efficiency through optimized circuit compilation, an advanced instruction stream format (OriginBIS), and hardware-aware execution strategies. These engineering optimizations significantly improve both processing speed and system performance, addressing key challenges in the NISQ era. A core innovation, OriginBIS, accelerates encoding speeds by up to 86.9× compared to OpenQASM 2.0, while decoding is 35.6× faster, leading to more efficient data handling, reduced memory overhead, and improved communication efficiency. This directly enhances the execution of quantum circuits, making large-scale quantum simulations more feasible. Comprehensive benchmarking demonstrates QPanda3’s superior performance: quantum circuit construction is 20.7× faster, execution speeds improve by 3.4×, and transpilation efficiency increases by 14.97× over Qiskit. Notably, in compiling a 118-qubit W-state circuit on a 2D-grid topology, QPanda3 achieves an unprecedented 869.9× speedup, underscoring its ability to handle complex quantum workloads at scale. By combining high-speed quantum processing with a modular and extensible software architecture, QPanda3 provides a practical bridge between today’s NISQ devices and future fault-tolerant quantum computing. It facilitates real-world applications in financial modeling, materials science, and combinatorial optimization, while its robust and scalable design supports industrial adoption and cloud-based deployment.

QPanda3 is a quantum computing library designed to provide developers with tools and interfaces related to quantum computing.

Overview

  • Enhancing the computational capabilities of existing quantum devices
    • Through efficient compilation techniques, optimized qubit mapping strategies, and quantum gate compression algorithms, QPanda3 enables NISQ devices to execute target algorithms more efficiently, achieving superior computational performance for specific tasks.
    • It supports fast quantum circuit transpilation, which is faster than Qiskit 1.4.2. For more details, see QPanda3 vs Qiskit 1.4.2 .
    • It supports high-performance simulation of quantum circuits, based on the technological foundation of QPanda2's underlying simulation computations.
  • Optimizing software-hardware co-design in quantum computing
    • Unlike classical computing, quantum computing requires software to have deep awareness of hardware characteristics. QPanda3 employs adaptive qubit mapping and hardware-aware compilation strategies to ensure optimal execution across different quantum processors, thereby improving overall computational fidelity.
    • QPanda3 supports all types of quantum logic gates, including single-qubit gates, two-qubit gates, controlled gates, and Oracle gates.
    • QPanda3 supports all fundamental quantum simulators, including single-amplitude simulators, partial-amplitude simulators, full-amplitude simulators, noise simulators, density matrix simulators, and GPU simulators, providing a unified execution method.
    • It supports quantum circuit profiling, enabling the development of more efficient quantum programs and quantum algorithms.
    • It supports parameterized quantum logic gates as placeholders, making the construction and updating of large-scale variational quantum circuits more efficient.
  • Advancing quantum computational advantages
    • Although some NISQ devices have demonstrated computational superiority for certain problems, achieving large-scale quantum computing necessitates further engineering breakthroughs. QPanda3 adopts a modular architecture, allowing seamless integration with future fault-tolerant quantum computing systems, thereby reducing the transition cost from NISQ to next-generation quantum technologies.

Benchmark

Experiments on benchpress, in a fully connected topology, QPanda3's compilation speed is, on average, 9.46× faster than Qiskit, with peak acceleration reaching 77.76×. In a square topology, its average compilation speed surpasses Qiskit by 24.6×, with a peak of 869.9×. For heavy-hexagon topologies, QPanda3 achieves an average 15.1× speedup, with a peak of 332.0×. In linear topology, the average speedup is 10.71×, with peak acceleration reaching 868.7×. We have introduced more detailed experimental content in the literature QPanda3: A High-Performance Software-Hardware Collaborative Framework for Large-Scale Quantum-Classical Computing Integration. The webpage Benchmark has cited important experimental results from the article.

QPanda3 vs Qiskit 1.4.2

How to use

pyqpanda3 is hosted in C++ and has the following system environment requirements.

Windows

Software Version
Microsoft Visual C++ Redistributable x64 2015-2022
Python >= 3.9 && <= 3.12

Linux

Software Version
GCC >=8.0
Python >= 3.9 && <= 3.12

Mac

Software Version
clang >=15.0
Python >= 3.9 && <= 3.12

Before using pyqpanda3, you need to install the corresponding Python-dependent library. pyqpanda3 supports installation via pip, and its installation command is as follows:

pip install pyqpanda3

After pyqpanda3 is installed, it can be used directly. Here is a simple usage example:

from pyqpanda3.core import QCircuit, QProg, H, CNOT, measure, CPUQVM
# Create a quantum circuit
circuit = QCircuit()
# Construct GHZ state
circuit << H(0) # Apply Hadamard gate on qubit 0
circuit << CNOT(0,1) # Apply CNOT gate with control 0 and target 1
circuit << CNOT(1,2) # Apply CNOT gate with control 1 and target 2
# Create a quantum prog and compose the circuit
prog = QProg()
prog << circuit
# Add measure operation
prog << measure(0,0) << measure(1,1) << measure(2,2)
# Create a QVM
qvm = CPUQVM()
# Execute the prog and obtain the result
qvm.run(prog,1000)
result = qvm.result().get_counts()
# Print qprog and result
print(prog)
print(result)
Definition __init__.py:1

The running result is as follows:

┌─┐ ┌─┐
q_0: |0>─┤H├ ───*── ───────┤M├ ───────
└─┘ ┌──┴─┐ └╥┘ ┌─┐
q_1: |0>──── ┤CNOT├ ───*────╫─ ─┤M├───
└────┘ ┌──┴─┐ ║ └╥┘┌─┐
q_2: |0>──── ────── ┤CNOT├──╫─ ──╫─┤M├
└────┘ ║ ║ └╥┘
c : / ════════════════════╩════╩══╩═
0 1 2
{'111': 489, '000': 511}