Skip to content

Commit

Permalink
update to v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Quleaf committed Jan 6, 2023
1 parent ca62f24 commit 195b41b
Show file tree
Hide file tree
Showing 1,430 changed files with 20,910 additions and 3,689 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ English | [简体中文](README_CN.md)
</a>
<!-- PyPI -->
<a href="https://pypi.org/project/paddle-quantum/">
<img src="https://img.shields.io/badge/pypi-v2.2.2-orange.svg?style=flat-square&logo=pypi"/>
<img src="https://img.shields.io/badge/pypi-v2.3.0-orange.svg?style=flat-square&logo=pypi"/>
</a>
<!-- Python -->
<a href="https://www.python.org/">
Expand Down Expand Up @@ -90,22 +90,19 @@ pip install -e .

### Environment setup for Quantum Chemistry module

Our `qchem` module is based on `Psi4`, so before executing quantum chemistry, we have to install this Python package.
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.

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

```bash
conda install psi4 -c psi4
conda install -c pyscf pyscf
```

For **Windows** user, the command is:
> 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.
```bash
conda install psi4 -c psi4 -c conda-forge
```
**Note:** Please refer to [Psi4](https://psicode.org/installs/v14/) for more download options.
**Note:** Please refer to [PySCF](https://pyscf.org/install.html) for more download options.

### Run example

Expand Down
20 changes: 8 additions & 12 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</a>
<!-- PyPI -->
<a href="https://pypi.org/project/paddle-quantum/">
<img src="https://img.shields.io/badge/pypi-v2.2.2-orange.svg?style=flat-square&logo=pypi"/>
<img src="https://img.shields.io/badge/pypi-v2.3.0-orange.svg?style=flat-square&logo=pypi"/>
</a>
<!-- Python -->
<a href="https://www.python.org/">
Expand Down Expand Up @@ -91,23 +91,19 @@ pip install -e .

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

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

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

```bash
conda install psi4 -c psi4
conda install -c pyscf pyscf
```

对于 **Windows** 用户,请使用
> 注:对于 **Windows** 用户,如果操作系统为 Windows10,可以在其应用商店提供的 Ubuntu 子系统中利用上述命令安装 `PySCF``PySCF` 并不支持直接在 Windows 下运行,我们正在努力开发更多的量子化学后端,在量桨的下一版本中将会有对 Windows 更好的支持。
```bash
conda install psi4 -c psi4 -c conda-forge
```

**注意:** 更多的下载方法请参考 [Psi4](https://psicode.org/installs/v14/)
**注意:** 更多的下载方法请参考 [PySCF](https://pyscf.org/install.html)

### 运行

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

## 交流与反馈

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

- 技术交流QQ群:1076223166

Expand Down
73 changes: 73 additions & 0 deletions applications/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Quantum Application Model Library

- [Features](#features)
- [Installation](#installation)
- [How to Use](#how-to-use)
- [Application List](#application-list)

**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:

- Artificial Intelligence
- Medicine and Pharmaceuticals
- Material Simulation
- Financial Technology
- Manufacturing
- Data Analysis

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.

## Features

- Industrialization: 10 models closely follow the 6 major industrial directions, covering hot topics such as artificial intelligence, chemical materials, manufacturing, finance, etc.
- End-to-end: Linking the whole process from application scenarios to quantum computing and solving the last mile of quantum applications.
- Out-of-box: No special configuration is required, the model is called directly by the Paddle Quantum, eliminating the tedious installation process.

## Installation

QAML depends on the `paddle-quantum` package. Users can install it by pip.

```shell
pip install paddle-quantum
```

For those who are using old versions of Paddle Quantum, simply run `pip install --upgrade paddle-quantum` to install the latest package.

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.

You can also use git to get the QAML source code.

```shell
git clone https://github.com/PaddlePaddle/Quantum.git
cd Quantum/applications
```

You can check your installation by going to the `handwritten_digits_classification` folder under `applications` and running

```shell
python vsql_classification.py --example.toml
```

The installation is successful once the program terminates without errors.

## How to Use

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.

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.

## Application List

*Continue update*

Below we list instructions for all applications available in QAML, newly developed applications will be continuously integrated into QAML.

1. [Handwritten digits classification](./handwritten_digits_classification/introduction_en.ipynb)
2. [Molecular ground state energy & dipole moment calculation](./lithium_ion_battery/introduction_en.ipynb)
3. [Text classification](./text_classification/introduction_en.ipynb)
4. [Protein folding](./protein_folding/introduction_en.ipynb)
5. [Medical image classification](./medical_image_classification/introduction_en.ipynb)
6. [Quality detection](./quality_detection/introduction_en.ipynb)
7. [Option pricing](./option_pricing/introduction_en.ipynb)
8. [Quantum portfolio optimization](./portfolio_optimization/introduction_en.ipynb)
9. [Regression](./regression/introduction_en.ipynb)
10. [Quantum linear equation solver](./linear_solver/introduction_en.ipynb)
73 changes: 73 additions & 0 deletions applications/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 量子应用模型库

- [特色](#特色)
- [安装](#安装)
- [如何使用](#如何使用)
- [应用列表](#应用列表)

量子应用模型库(**Q**uantum **A**pplication **M**odel **L**ibrary, QAML)是一个开箱即用的实用量子应用模型集合,它由[百度量子计算研究所](https://quantum.baidu.com/)研发,旨在成为企业用户的量子解决方案“超市”。目前,QAML 中的模型已经覆盖了以下领域:

- 人工智能
- 医学制药
- 材料模拟
- 金融科技
- 汽车制造
- 数据分析

QAML 基于量桨这一量子机器学习平台实现,关于量桨的内容可以参考 https://qml.baidu.comhttps://github.com/PaddlePaddle/Quantum

## 特色

- 产业化:10 大应用模型紧贴 6 大产业方向,涵盖人工智能、化工材料、汽车制造、金融套利等热点话题。
- 端到端:打通应用场景到量子算法的全流程,解决量子应用的最后一公里问题。
- 开箱即用:无需特殊配置,通过量桨直接完成模型调用,省去繁琐安装环节。

## 安装

QAML 依赖于量桨( `paddle-quantum` )软件包。用户可以通过 pip 来安装:

```shell
pip install paddle-quantum
```

对于那些使用旧版量桨的用户,只需运行 `pip install --upgrade paddle-quantum` 即可安装最新版量桨。

QAML 的内容在 Paddle Quantum 的 GitHub 仓库中,用户可以通过点击[此链接](https://github.com/PaddlePaddle/Quantum/archive/refs/heads/master.zip)下载包含 QAML 源代码的压缩包。QAML 的所有模型都在解压后的文件夹中的 `applications` 文件夹里。

用户也可以使用 git 来获取 QAML 的源码文件。

```shell
git clone https://github.com/PaddlePaddle/Quantum.git
cd Quantum/applications
```

用户可以进入到 `applications` 下的 `handwritten_digits_classification` 文件夹中,然后运行以下代码来检查安装是否成功。

```shell
python vsql_classification.py --example.toml
```

如果上面的程序没有报错、成功运行的话,则说明安装成功了。

## 如何使用

在每个应用模型中,我们都提供了可以直接运行的Python脚本和相应的配置文件。用户可以修改配置文件来实现对应的要求。

以手写数字识别为例,用户可以通过执行 `handwritten_digits_classification` 中的 `python vsql_classification.py --example.toml` 命令来快速使用。我们为每个应用模型提供了教程,方便用户快速理解和上手使用。

## 应用列表

*持续更新中*

我们列出了目前 QAML 的所有应用案例的教程,新开发的应用案例也会持续添加进来。

1. [手写数字识别](./handwritten_digits_classification/introduction_cn.ipynb)
2. [分子基态能量 & 偶极矩计算](./lithium_ion_battery/introduction_cn.ipynb)
3. [中文文本分类](./text_classification/introduction_cn.ipynb)
4. [蛋白质折叠](./protein_folding/introduction_cn.ipynb)
5. [医学影像判别](./medical_image_classification/introduction_cn.ipynb)
6. [材料表面质量检测](./quality_detection/introduction_cn.ipynb)
7. [量子期权定价](./option_pricing/introduction_cn.ipynb)
8. [投资组合优化](./portfolio_optimization/introduction_cn.ipynb)
9. [回归分析](./regression/introduction_cn.ipynb)
10. [线性方程组求解](./linear_solver/introduction_cn.ipynb)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions applications/handwritten_digits_classification/example.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

task = 'test'
image_path = 'data_0.png'
is_dir = false
model_path = 'vsql.pdparams'
num_qubits = 10
num_shadow = 2
depth = 1
classes = [0, 1]
Loading

0 comments on commit 195b41b

Please sign in to comment.