Skip to content

Latest commit

 

History

History
134 lines (101 loc) · 8.67 KB

File metadata and controls

134 lines (101 loc) · 8.67 KB

Origin Quantum pyqpanda-algorithm Quantum Algorithm Software Package

Introduction

pyqpanda-algorithm is a quantum algorithm software package developed by Origin Quantum, designed to provide quantum computing developers with a standardized, modular, and high-performance foundational algorithm library. This library integrates a variety of quantum algorithms widely used in finance, machine learning, combinatorial optimization, scientific computing, and other fields. It helps users quickly translate theories into code, improve development efficiency, and ensure algorithm portability across different quantum platforms.

Official Website: [https://qcloud.originqc.com.cn/zh/programming/pyqpanda-algorithm]


Core Features

  1. Modularity & High Reusability All algorithms are organized as independent modules for on-demand invocation. For example, QAOA, Grover's, and QSVM can be imported and used independently, supporting reuse across different projects.
  2. High-Performance Implementation Domain-specific algorithms are optimized and engineered for acceleration. Combined with QPanda3's underlying optimizations (e.g., OriginBIS instruction set, hardware-aware compilation), execution efficiency on simulators and real quantum hardware is significantly improved.
  3. Cross-Platform Compatibility Deeply integrated with the QPanda3 framework, it supports running on CPU simulators, quantum cloud services (e.g., Origin Wukong), and real quantum processors, enabling "write once, deploy anywhere".
  4. Comprehensive Documentation & Examples Detailed API docs, usage examples, and annotated code lower the learning barrier, making it ideal for beginners and researchers to quickly start with machine learning and combinatorial optimization tasks.
  5. Strong Ecosystem Integration Seamlessly integrates with other Origin Quantum toolchains (e.g., VQNet, Origin Wukong, Origin Liangyu), supporting the full workflow from algorithm design to actual execution.

Package Categories

1. Optimization & Search Algorithms

Suitable for combinatorial optimization and large-scale search problems (e.g., path planning, resource scheduling, portfolio optimization).

  • QUBO (Unconstrained Binary Optimization)
    Converts combinatorial optimization problems into quadratic unconstrained binary optimization problems (a universal modeling form for quantum annealing and variational quantum algorithms).
  • QAOA (Quantum Approximate Optimization Algorithm)
    A hybrid quantum-classical variational algorithm that approximates QUBO solutions by optimizing parameterized quantum circuits (Ansatz), applicable to Max-Cut, Max-SAT, etc.
  • Grover's Search Algorithm
    Achieves quadratic speedup for target item search in unstructured databases. Amplitude amplification reduces search complexity from $O(N)$ to $O(\sqrt{N})$.

2. Machine Learning & Data Mining Algorithms

Integrates quantum computing into classical machine learning to improve efficiency and accuracy of classification, clustering, regression, etc.

  • QSVM (Quantum Support Vector Machine)
    A classification model based on quantum kernel functions, enabling optimal classification boundaries in high-dimensional spaces.
  • QSVR (Quantum Support Vector Regression)
    A regression model for fitting continuous variables (e.g., time series prediction).
  • QKMeans (Quantum K-Means Clustering)
    Quantum-accelerated large-scale data clustering for high-dimensional data scenarios.
  • QPCA (Quantum Principal Component Analysis)
    Extracts data principal components via quantum circuits to accelerate dimensionality reduction.
  • QMRMR (Quantum Minimum Redundancy Maximum Relevance)
    Implements efficient feature selection to reduce redundant feature interference.
  • QARM (Quantum Association Rule Mining)
    Rapidly mines frequent itemsets and association rules (e.g., market basket analysis).

3. Scientific Computing & Numerical Solution Algorithms

Solves key problems in physical modeling and engineering simulation (e.g., eigenvalues, linear equations, matrix decomposition).

  • QSVD (Quantum Variational Singular Value Decomposition)
    Extracts matrix singular values/vectors under a variational framework (for dimensionality reduction and recommendation systems).

4. General Tools & Basic Components

Provides underlying tools for quantum computing workflows.

  • QAE (Quantum Amplitude Estimation)
    Precisely estimates target state amplitude/measurement probability with quadratic speedup (e.g., financial derivative pricing, risk assessment).
  • Comparator (Quantum Comparator)
    Implements numerical comparison or threshold judgment to build quantum decision logic.
  • SparseAmp (Sparse Amplitude Encoding)
    Efficiently encodes sparse vectors into quantum states, reducing quantum resource consumption (for data preprocessing).

Installation

pyqpanda_alg is an algorithm extension module based on pyqpanda3. Its installation and usage depend on pyqpanda3. Refer to pyqpanda3 for interface usage.

If Python and pip are installed, run the following command in the terminal/console:
pip install pyqpanda_alg

Note:

Add sudo if you encounter permission issues on Linux.


Environment Configuration

pyqpanda_alg is primarily developed in Python with the following system requirements:

Windows

Software Version
Microsoft Visual C++ Redistributable x64 2019
Python >= 3.11 && <= 3.13

Linux

Software Version
GCC >= 7.5
Python >= 3.11 && <= 3.13

Branch Explanation

This project follows a "stable branch + development branch" collaboration model, with different branches serving distinct purposes to help you choose the right one for your needs.

📌 main (Main Branch)

  • Core Purpose: The main branch is the project's stable release branch, containing fully tested, production-ready open-source quantum algorithm code.
  • Usage Scenario: If you want to study, learn the core implementation of quantum algorithms, or directly build upon mature code for secondary development, you can pull and use the content from the main branch.
  • Important Note: The main branch does not accept any direct commits or Pull Requests (PRs), ensuring the core code remains stable and bug-free.

🛠️ develop (Development Branch)

  • Core Purpose: The develop branch is the project's collaborative development branch, used for integrating community contributions, iterating new features, and fixing issues.
  • Submission Scenario: If you wish to contribute to the project, including but not limited to:Submitting bug fixes、Improving project documentation (e.g., README, code comments)、Adding example code for quantum algorithms、Proposing or implementing new feature suggestions、Optimizing the performance or readability of existing algorithms,please submit all Pull Requests (PRs) to the develop branch only.
  • Collaboration Note: We regularly review contributions on the develop branch. After testing and validation, approved changes will be merged into the main branch, so high-quality contributions are synced to the stable release.

Open Source License

Licensed under Apache License 2.0, free and friendly for commercial/non-commercial use by companies, teams, and individuals. Feel free to use and register.


Acknowledgements

Thanks to all contributors, testers, and community supporters. Special thanks to the Origin Quantum Research Institute for technical support in algorithm design and performance optimization.


Contact Us

本源量子云社区服务号

  • The official assistant:scan the QR code below to add the official assistant for quantum cloud support and event updates

本源量子官方小助手