Skip to content

Commit 195b41b

Browse files
author
Quleaf
committed
update to v2.3.0
1 parent ca62f24 commit 195b41b

File tree

1,430 files changed

+20910
-3689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,430 files changed

+20910
-3689
lines changed

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ English | [简体中文](README_CN.md)
3333
</a>
3434
<!-- PyPI -->
3535
<a href="https://pypi.org/project/paddle-quantum/">
36-
<img src="https://img.shields.io/badge/pypi-v2.2.2-orange.svg?style=flat-square&logo=pypi"/>
36+
<img src="https://img.shields.io/badge/pypi-v2.3.0-orange.svg?style=flat-square&logo=pypi"/>
3737
</a>
3838
<!-- Python -->
3939
<a href="https://www.python.org/">
@@ -90,22 +90,19 @@ pip install -e .
9090

9191
### Environment setup for Quantum Chemistry module
9292

93-
Our `qchem` module is based on `Psi4`, so before executing quantum chemistry, we have to install this Python package.
93+
Currently, our `qchem` module uses `PySCF` as its backend to compute molecular integrals, so before executing quantum chemistry, we have to install this Python package.
9494

95-
> It is recommended that `Psi4` is installed in a Python 3.8 environment.
95+
> It is recommended that `PySCF` is installed in a Python environment whose Python version >=3.6.
9696
97-
We highly recommend you to install `Psi4` via conda. **MacOS/Linux** user can use the command:
97+
We highly recommend you to install `PySCF` via conda. **MacOS/Linux** user can use the command:
9898

9999
```bash
100-
conda install psi4 -c psi4
100+
conda install -c pyscf pyscf
101101
```
102102

103-
For **Windows** user, the command is:
103+
> NOTE: For **Windows** user, if your operating system is Windows10, you can install `PySCF` in Ubuntu subsystem provided by Windows 10's App Store. `PySCF` can't run directly in Windows, so we are working hard to develop more quantum chemistry backends. Our support for Windows will be improved in the coming release of Paddle Quantum.
104104
105-
```bash
106-
conda install psi4 -c psi4 -c conda-forge
107-
```
108-
**Note:** Please refer to [Psi4](https://psicode.org/installs/v14/) for more download options.
105+
**Note:** Please refer to [PySCF](https://pyscf.org/install.html) for more download options.
109106

110107
### Run example
111108

README_CN.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</a>
3535
<!-- PyPI -->
3636
<a href="https://pypi.org/project/paddle-quantum/">
37-
<img src="https://img.shields.io/badge/pypi-v2.2.2-orange.svg?style=flat-square&logo=pypi"/>
37+
<img src="https://img.shields.io/badge/pypi-v2.3.0-orange.svg?style=flat-square&logo=pypi"/>
3838
</a>
3939
<!-- Python -->
4040
<a href="https://www.python.org/">
@@ -91,23 +91,19 @@ pip install -e .
9191

9292
### 量子化学模块的环境设置
9393

94-
我们的量子化学模块是基于 `Psi4` 进行开发的,所以在运行量子化学模块之前需要先行安装该 Python 包。
94+
当前我们的量子化学模块在后端使用 `PySCF` 来计算各类分子积分,所以在运行量子化学模块之前需要先行安装该 Python 包。
9595

96-
> 推荐在 Python3.8 环境中安装。
96+
> 推荐在 Python>=3.6 环境中安装。
9797
98-
在安装 `psi4` 时,我们建议您使用 conda。对于 **MacOS/Linux** 的用户,可以使用如下指令。
98+
在安装 `PySCF` 时,我们建议您使用 conda。对于 **MacOS/Linux** 的用户,可以使用如下指令。
9999

100100
```bash
101-
conda install psi4 -c psi4
101+
conda install -c pyscf pyscf
102102
```
103103

104-
对于 **Windows** 用户,请使用
104+
> 注:对于 **Windows** 用户,如果操作系统为 Windows10,可以在其应用商店提供的 Ubuntu 子系统中利用上述命令安装 `PySCF``PySCF` 并不支持直接在 Windows 下运行,我们正在努力开发更多的量子化学后端,在量桨的下一版本中将会有对 Windows 更好的支持。
105105
106-
```bash
107-
conda install psi4 -c psi4 -c conda-forge
108-
```
109-
110-
**注意:** 更多的下载方法请参考 [Psi4](https://psicode.org/installs/v14/)
106+
**注意:** 更多的下载方法请参考 [PySCF](https://pyscf.org/install.html)
111107

112108
### 运行
113109

@@ -217,7 +213,7 @@ Paddle Quantum 使用 setuptools 的 develop 模式进行安装,相关代码
217213

218214
## 交流与反馈
219215

220-
- 我们非常欢迎您通过 [Github Issues](https://github.com/PaddlePaddle/Quantum/issues) 来提交问题、报告与建议。
216+
- 我们非常欢迎您通过 [GitHub Issues](https://github.com/PaddlePaddle/Quantum/issues) 来提交问题、报告与建议。
221217

222218
- 技术交流QQ群:1076223166
223219

applications/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Quantum Application Model Library
2+
3+
- [Features](#features)
4+
- [Installation](#installation)
5+
- [How to Use](#how-to-use)
6+
- [Application List](#application-list)
7+
8+
**Q**uantum **A**pplication **M**odel Library (QAML) is a collection of out-of-box practical quantum algorithms, it is developed by [Institute for Quantum Computing at Baidu](https://quantum.baidu.com/), and aims to be a "supermarket" of quantum solutions for industry users. Currently, models in QAML have covered popular areas listed below:
9+
10+
- Artificial Intelligence
11+
- Medicine and Pharmaceuticals
12+
- Material Simulation
13+
- Financial Technology
14+
- Manufacturing
15+
- Data Analysis
16+
17+
QAML is implemented on Paddle Quantum, a quantum machine learning platform, which can be found at https://qml.baidu.com and https://github.com/PaddlePaddle/Quantum.
18+
19+
## Features
20+
21+
- Industrialization: 10 models closely follow the 6 major industrial directions, covering hot topics such as artificial intelligence, chemical materials, manufacturing, finance, etc.
22+
- End-to-end: Linking the whole process from application scenarios to quantum computing and solving the last mile of quantum applications.
23+
- Out-of-box: No special configuration is required, the model is called directly by the Paddle Quantum, eliminating the tedious installation process.
24+
25+
## Installation
26+
27+
QAML depends on the `paddle-quantum` package. Users can install it by pip.
28+
29+
```shell
30+
pip install paddle-quantum
31+
```
32+
33+
For those who are using old versions of Paddle Quantum, simply run `pip install --upgrade paddle-quantum` to install the latest package.
34+
35+
QAML locates in Paddle Quantum's GitHub repository, you can download the zip file contains QAML source code by clicking [this link](https://github.com/PaddlePaddle/Quantum/archive/refs/heads/master.zip). After unzipping the package, you will find all the models in the `applications` folder in the extracted folder.
36+
37+
You can also use git to get the QAML source code.
38+
39+
```shell
40+
git clone https://github.com/PaddlePaddle/Quantum.git
41+
cd Quantum/applications
42+
```
43+
44+
You can check your installation by going to the `handwritten_digits_classification` folder under `applications` and running
45+
46+
```shell
47+
python vsql_classification.py --example.toml
48+
```
49+
50+
The installation is successful once the program terminates without errors.
51+
52+
## How to Use
53+
54+
In each application model, we provide Python scripts that can be run directly and the corresponding configuration files. The user can modify the configuration file to implement the corresponding requirements.
55+
56+
Take handwritten digit classification as an example, it can be used by executing `python vsql_classification.py --example.toml` in the `handwritten_digits_classification` folder. We provide tutorials for each application model, which allows users to quickly understand and use it.
57+
58+
## Application List
59+
60+
*Continue update*
61+
62+
Below we list instructions for all applications available in QAML, newly developed applications will be continuously integrated into QAML.
63+
64+
1. [Handwritten digits classification](./handwritten_digits_classification/introduction_en.ipynb)
65+
2. [Molecular ground state energy & dipole moment calculation](./lithium_ion_battery/introduction_en.ipynb)
66+
3. [Text classification](./text_classification/introduction_en.ipynb)
67+
4. [Protein folding](./protein_folding/introduction_en.ipynb)
68+
5. [Medical image classification](./medical_image_classification/introduction_en.ipynb)
69+
6. [Quality detection](./quality_detection/introduction_en.ipynb)
70+
7. [Option pricing](./option_pricing/introduction_en.ipynb)
71+
8. [Quantum portfolio optimization](./portfolio_optimization/introduction_en.ipynb)
72+
9. [Regression](./regression/introduction_en.ipynb)
73+
10. [Quantum linear equation solver](./linear_solver/introduction_en.ipynb)

applications/README_CN.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# 量子应用模型库
2+
3+
- [特色](#特色)
4+
- [安装](#安装)
5+
- [如何使用](#如何使用)
6+
- [应用列表](#应用列表)
7+
8+
量子应用模型库(**Q**uantum **A**pplication **M**odel **L**ibrary, QAML)是一个开箱即用的实用量子应用模型集合,它由[百度量子计算研究所](https://quantum.baidu.com/)研发,旨在成为企业用户的量子解决方案“超市”。目前,QAML 中的模型已经覆盖了以下领域:
9+
10+
- 人工智能
11+
- 医学制药
12+
- 材料模拟
13+
- 金融科技
14+
- 汽车制造
15+
- 数据分析
16+
17+
QAML 基于量桨这一量子机器学习平台实现,关于量桨的内容可以参考 https://qml.baidu.comhttps://github.com/PaddlePaddle/Quantum
18+
19+
## 特色
20+
21+
- 产业化:10 大应用模型紧贴 6 大产业方向,涵盖人工智能、化工材料、汽车制造、金融套利等热点话题。
22+
- 端到端:打通应用场景到量子算法的全流程,解决量子应用的最后一公里问题。
23+
- 开箱即用:无需特殊配置,通过量桨直接完成模型调用,省去繁琐安装环节。
24+
25+
## 安装
26+
27+
QAML 依赖于量桨( `paddle-quantum` )软件包。用户可以通过 pip 来安装:
28+
29+
```shell
30+
pip install paddle-quantum
31+
```
32+
33+
对于那些使用旧版量桨的用户,只需运行 `pip install --upgrade paddle-quantum` 即可安装最新版量桨。
34+
35+
QAML 的内容在 Paddle Quantum 的 GitHub 仓库中,用户可以通过点击[此链接](https://github.com/PaddlePaddle/Quantum/archive/refs/heads/master.zip)下载包含 QAML 源代码的压缩包。QAML 的所有模型都在解压后的文件夹中的 `applications` 文件夹里。
36+
37+
用户也可以使用 git 来获取 QAML 的源码文件。
38+
39+
```shell
40+
git clone https://github.com/PaddlePaddle/Quantum.git
41+
cd Quantum/applications
42+
```
43+
44+
用户可以进入到 `applications` 下的 `handwritten_digits_classification` 文件夹中,然后运行以下代码来检查安装是否成功。
45+
46+
```shell
47+
python vsql_classification.py --example.toml
48+
```
49+
50+
如果上面的程序没有报错、成功运行的话,则说明安装成功了。
51+
52+
## 如何使用
53+
54+
在每个应用模型中,我们都提供了可以直接运行的Python脚本和相应的配置文件。用户可以修改配置文件来实现对应的要求。
55+
56+
以手写数字识别为例,用户可以通过执行 `handwritten_digits_classification` 中的 `python vsql_classification.py --example.toml` 命令来快速使用。我们为每个应用模型提供了教程,方便用户快速理解和上手使用。
57+
58+
## 应用列表
59+
60+
*持续更新中*
61+
62+
我们列出了目前 QAML 的所有应用案例的教程,新开发的应用案例也会持续添加进来。
63+
64+
1. [手写数字识别](./handwritten_digits_classification/introduction_cn.ipynb)
65+
2. [分子基态能量 & 偶极矩计算](./lithium_ion_battery/introduction_cn.ipynb)
66+
3. [中文文本分类](./text_classification/introduction_cn.ipynb)
67+
4. [蛋白质折叠](./protein_folding/introduction_cn.ipynb)
68+
5. [医学影像判别](./medical_image_classification/introduction_cn.ipynb)
69+
6. [材料表面质量检测](./quality_detection/introduction_cn.ipynb)
70+
7. [量子期权定价](./option_pricing/introduction_cn.ipynb)
71+
8. [投资组合优化](./portfolio_optimization/introduction_cn.ipynb)
72+
9. [回归分析](./regression/introduction_cn.ipynb)
73+
10. [线性方程组求解](./linear_solver/introduction_cn.ipynb)
290 Bytes
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
task = 'test'
3+
image_path = 'data_0.png'
4+
is_dir = false
5+
model_path = 'vsql.pdparams'
6+
num_qubits = 10
7+
num_shadow = 2
8+
depth = 1
9+
classes = [0, 1]

0 commit comments

Comments
 (0)