QPanda3 (Quantum Programming Architecture for NISQ Device Application v3) is an open-source quantum computing programming framework developed by Origin Quantum. This framework is developed in C++ and provides a Python interface, allowing developers to write quantum programs in Python while enjoying the high performance of C++.
QPanda3 is a quantum computing library designed to provide developers with tools and interfaces related to quantum computing.
Overview
- QPanda3 is versatile.
- It supports all types of quantum logic gates, including single-qubit gates, two-qubit gates, controlled gates, and Oracle gates.
- It 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.
- QPanda3 is fast.
- It supports fast quantum circuit transpilation, which is approximately 3~4x faster than Qiskit 1.3.0. For more details, see QPanda3 vs Qiskit 1.3.0.
- It supports high-performance simulation of quantum circuits, based on the technological foundation of QPanda2's underlying simulation computations.
- QPanda3 is elegant.
- The python API is extremely clear and expressive, without any knowledge of C++.
- Its interfaces come with extensive comments and documentation, enabling users to design quantum programs more elegantly and conveniently.
- QPanda3 is efficient.
- 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.
Benchmark
The figure below presents the performance comparison results quantum circuit transpilation of QPanda3 and Qiskit 1.3.0 on Benchpress, the QPanda3 transpilation process is approximately 3~4x faster than Qiskit 1.3.0.
The x-axis represents the runtime of QPanda3 (in seconds), and the y-axis represents the runtime of Qiskit 1.3.0. Different colored regions indicate various speedup ranges (such as 1-5x speedup, 5-20x speedup, etc.). The color intensity of the data points represents the number of qubits. The "Improvement" area in the bottom left corner and the "Regression" area in the bottom right corner indicate areas of improvement and regression, respectively, while the dashed line represents equal runtime. Overall, QPanda3 outperforms Qiskit 1.3.0 in most cases.
Detailed Analysis of Speedup Ratios:
- 1-5x Speedup (blue region): In this range, QPanda3 performs up to 5 times faster than Qiskit. The majority of data points fall within this range, indicating that QPanda3 generally provides moderate improvements.
- 5-20x Speedup (green region): A significant number of benchmarks show QPanda3 running 5 to 20 times faster, indicating strong optimization in certain cases.
- 20-80x Speedup (yellow region): This range shows a substantial performance leap, with QPanda3 significantly outperforming Qiskit.
- 80-320x Speedup (pink region): In rare cases, QPanda3 achieves extraordinary speedups, running up to 320 times faster than Qiskit, indicating potential optimizations for specific circuits or configurations.
How to use
Before using pyqpanda3, you need to install the corresponding Python-dependent library. pyqpanda3 supports installation via pip
, and its installation command is as follows:
- Note
- The Python versions required by pyqpanda3 range from 3.9 to 3.12.
After pyqpanda3 is installed, it can be used directly. Here is a simple usage example:
circuit = QCircuit(2)
circuit << H(0)
circuit << CNOT(0,1)
print("Circuit Size:", circuit.size())
print("Qubits:", circuit.qubits())
print("Circuit Depth:", circuit.depth(False))
The running result is as follows:
Circuit Size: 2
Qubits: [0, 1]
Circuit Depth: 2