Metadata-Version: 2.4
Name: pyqpanda3
Version: 0.5.0
Summary: pyqpanda3 is Python wrapper of QPanda3.
Author: OriginQ
License: Apache Licence
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: Cython
Requires-Dist: networkx
Requires-Dist: mypy>=1.14.0
Requires-Dist: setuptools
Requires-Dist: graphviz
Requires-Dist: scipy
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: requires-dist
Dynamic: summary

# pyqpanda3

[QPanda3](../README.md) 的 Python 接口——本源量子开发的开源量子计算编程框架。
框架内核采用 C++ 开发并经 pybind11 绑定到 Python：既可以用 Python 编写量子程序，
又能享有 C++ 的执行性能。

## 安装

```bash
pip install pyqpanda3
```

运行期依赖见 `requirements.txt`（numpy、matplotlib、networkx、graphviz、scipy 等）。

## 模块结构

| 模块 | 内容 |
| --- | --- |
| `pyqpanda3.core` | 核心虚拟机与量子程序构件：`QProg`/`QCircuit`、各类量子门与测量、`CPUQVM`、`GPUQVM`（CUDA 构建时）、`NoiseModel` 噪声模拟、MPS/密度矩阵/单振幅/部分振幅等后端、SIMD 精度控制 |
| `pyqpanda3.transpilation` | 线路编译/转译：布局映射（LightSABRE）、路由、基转换、优化 Pass、`pilot_transpile` |
| `pyqpanda3.hamiltonian` | 哈密顿量与泡利算符工具 |
| `pyqpanda3.vqcircuit` | 变分量子线路（VQC）与参数化演化 |
| `pyqpanda3.intermediate_compiler` | OriginIR / QASM 等中间表示的导入导出与转换 |
| `pyqpanda3.quantum_info` | 量子信息工具：态矢量、密度矩阵、信道（Kraus/Chi/PTM/SuperOp）等 |
| `pyqpanda3.utils` | 扩展工具集 |
| `pyqpanda3.visualization` | 线路绘制与指令调度可视化 |
| `pyqpanda3.profiling` | 性能剖析 |
| `pyqpanda3.pilot_os` / `pyqpanda3.pilot_service` | QPilot 服务对接（`USE_EXTENSION` 构建时） |
| `pyqpanda3.qcloud` | 量子云服务（`USE_CURL` 构建时） |

## 快速上手

```python
from pyqpanda3.core import QProg, H, CNOT, measure, CPUQVM

prog = QProg()
prog << H(0) << CNOT(0, 1) << measure(0, 0) << measure(1, 1)

qvm = CPUQVM()
qvm.run(prog, 1000)
print(qvm.result().get_counts())   # Bell 态: {'00': ~500, '11': ~500}
```

GPU 后端（需要 CUDA 构建且机器有可用 GPU）：

```python
from pyqpanda3.core import QProg, H, CNOT, GPUQVM

prog = QProg()
prog << H(0) << CNOT(0, 1)

qvm = GPUQVM()
qvm.run(prog, 1000)
print(qvm.result().get_state_vector())
```

## 更多文档

访问 https://qcloud.originqc.com.cn/document/pyqpanda3-docs/zh/ 即可
