From 90427d924bad2a1359a5966ffdf59263ec0c6c31 Mon Sep 17 00:00:00 2001 From: LT Date: Wed, 5 Jan 2022 10:22:33 +0800 Subject: [PATCH 1/2] Update the README_ZH file. --- README_ZH.md | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index b7fa53f..2974ee8 100755 --- a/README_ZH.md +++ b/README_ZH.md @@ -11,50 +11,43 @@ #### 安装运行时系统以及模拟器 -使用以下命令便可以一键安装青果运行时系统、PyQCAS模拟器以及PyQCISim模拟器。 +依次执行以下命令便可以安装青果运行时系统、PyQCAS模拟器以及PyQCISim模拟器。 ```sh -pip install quingo +git clone https://gitee.com/hpcl_quanta/quingo-runtime.git +cd /your/download/path/quingo-runtime/ +pip install -e . ``` -#### 青果编译器 - -由于青果运行时系统是一个集成和管理量子和经典计算资源的框架,因此默认情况下它是不包含量子编译器,故青果编译器需要单独下载。 +#### 安装青果编译器 目前的青果编译器有两个版本: -1. 基于`xtext`的青果编译器,通过下载[java二进制文件](https://github.com/Quingo/compiler_xtext/releases)即可获取。 -2. 基于`mlir`的青果编译器,通过下载[二进制文件](https://gitee.com/hpcl_quanta/quingo-runtime/releases)即可获取。 +1. 基于`mlir`的青果编译器,该编译器可以生成能够被PyQCISim模拟器模拟的QCIS指令。 +2. 基于`xtext`的青果编译器,该编译器可以生成能够被PyQCAS模拟器模拟的eQASM指令。 + +##### 基于`mlir`的青果编译器 + +目前,只要执行了[安装运行时系统以及模拟器](#安装运行时系统以及模拟器)步骤中的所有命令,基于`mlir`的青果编译器的二进制文件便会自动下载,因此用户可以直接使用,无需单独下载。 -基于`xtex`的青果编译器可以生成能够被PyQCAS模拟器模拟的eQASM指令,而基于`mlir`的青果编译器目前能够生成可以被PyQCISim模拟器模拟的 QCIS指令。 +##### 基于`xtext`的青果编译器 + +目前,基于`xtext`的青果编译器还未实现自动下载,故用户需要单独下载[java二进制文件](https://github.com/Quingo/compiler_xtext/releases)来获取青果编译器。 下载二进制文件后,需使用以下命令来指定编译器的路径: ```python import quingo # xtext编译器 quingo.quingo_interface.set_xtext_compiler_path() -# mlir编译器 -quingo.quingo_interface.set_mlir_compiler_path() ``` -对于mlir青果编译器,也可以将其二进制文件放在一个指定的目录,以便您的终端可以找到它,例如`/usr/loca/bin/`。在这种情况下,便不再需要调用 `set_mlir_compiler_path` 来指定编译器的路径。 - -### Linux系统下的注意事项 -由于编译器的可执行文件(`quinoc`)依赖于Linux系统中的许多库,如果你仅下载编译器的可执行二进制文件,`quinoc` 可能无法正常工作。为了解决在Linux系统下运行青果程序的困难,我们准备了一个docker镜像(大小大约在400MB左右),该镜像将所需的环境一并打包,无需额外安装便可以运行青果程序。使用以下命令可以快速安装: -```sh -docker pull xsu1989/quingo:beta -docker run -it xsu1989/quingo:beta -cd examples && python3 host.py -``` - - ## 使用 -一个简单的例子可以在目录`src/examples`中找到。您可以通过运行以下命令简单地运行`bell_state`示例: +一个简单的例子可以在目录`src/examples`中找到。您可以通过执行以下命令简单地运行`Bell_state`示例: ```sh cd src/examples/bell_state python host.py ``` -如果一切正常,将会有以下输出结果: +如果一切正常,将会输出如下结果: ```sh connecting pyqcisim_quantumsim... num_qubits: 2 @@ -81,5 +74,5 @@ The result of bell_state is: - 对于能够执行eQASM指令的后端,结果是对量子计算结果进行编码的二进制块。 - 对于能够执行QCIS指令的后端,结果的格式由PyQCISim进行定义。详情请参考`quingo.if_backend.non_arch_backend.pyqcisim_quantumsim.PyQCISim_quantumsim::execute()`中的文档描述。 -## 青果程序示例 -持续更新中... \ No newline at end of file +## 青果示例程序 +目前青果运行时系统中已经包含了`Bell_state`、`GHZ`、`VQE`等示例程序,详情可见[此处](https://gitee.com/hpcl_quanta/quingo-runtime/tree/master/src/examples)。 \ No newline at end of file -- Gitee From aa3c621e74555abd62113cd6b5b7d04f2b67c8a6 Mon Sep 17 00:00:00 2001 From: LT Date: Wed, 5 Jan 2022 23:46:20 +0800 Subject: [PATCH 2/2] Update the files of readme. --- README.md | 42 +++++++++++++++++------------------------- README_ZH.md | 14 +++++--------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 693d922..19d0d3f 100755 --- a/README.md +++ b/README.md @@ -4,48 +4,40 @@ Along with quingo compilers, the Quingo runtime system which provides users the ## Installation - -### Overview The Quingo installation comprises of two main steps: -#### Runtime system and simulator +### Install the Runtime system and simulator Install Quingo runtime system with required simulators using the following command: ```sh -pip install quingo +git clone https://gitee.com/hpcl_quanta/quingo-runtime.git +cd /your/download/path/quingo-runtime/ +pip install -e . ``` Upon success, it will automatically install the Quingo runtime system (this package), the PyQCAS simulator and the PyQCISim simulator. -#### The Quingo compiler -Since the Quingo runtime is a framework integrating and managing quantum and classical computational resources, it does not contain the quantum compiler by default. The Quingo compiler should be downloaded separately. +### Install the Quingo compiler Two versions of Quingo compiler has been developed: -1. the xtext-based compiler, which appears as a [java executable](https://github.com/Quingo/compiler_xtext/releases), and -2. the mlir-based compiler, which presents as a [binary executable](https://gitee.com/hpcl_quanta/quingo-runtime/releases). +1. the mlir-based compiler, it can generate QCIS instructions which can be simulated by PyQCISim. +2. the xtext-based compiler, it can generate eQASM instructions which can be simulated by PyQCAS + + +#### Install the Mlir-based Compiler + +At present, as long as all the commands in the step of [Install the Runtime system and simulator](#install-the-runtime-system-and-simulator) are executed, the binary file of the mlir-based compiler will be automatically downloaded. + +#### Install the Xtext-based Compiler -The xtext compiler can generate eQASM instructions which can be simulated by PyQCAS and the mlir compiler can generate QCIS instructions which can be simulated by PyQCISim. +At present, the java executable file of xtext-based compiler has not yet been automatically downloaded, so users need to download [java executable](https://github.com/Quingo/compiler_xtext/releases) separately to get the xtext-based compiler. After downloading the binary, you need to call specify the compiler path for once in python using the following command: ```python import quingo # for xtext compiler -quingo.quingo_interface.set_xtext_compiler_path() -# or for mlir compiler -quingo.quingo_interface.set_mlir_compiler_path() +quingo.set_xtext_compiler_path() ``` -For the mlir compiler, you could also put it in a directory so that your terminal can find it, like `/usr/loca/bin/`. In this case, you no longer need to call `set_mlir_compiler_path` to specify its path. - -### Special Care for Linux -Since the compiler executable `quingoc` depends on a number of libraries under linux, `quingoc` may not work well if you only download this executable binary. To cease the difficulty in running Quingo programs under linux, we have prepared a docker image (around 400MB) which prepares everything in ready. You can install it using the following command: -```sh -docker pull xsu1989/quingo:beta -docker run -it xsu1989/quingo:beta -cd examples && python3 host.py -``` - -In this case, you do not need to install anything else to run Quingo programs. - ## Usage A simple example can be found in the directory `src/examples`. You can simply run the bell_state example by running: ```sh @@ -80,4 +72,4 @@ The `Quingo_interface` class expose the following methods: - For QCIS-based backend, the result format is defined by PyQCISim. Please refer to the docstring of `quingo.if_backend.non_arch_backend.pyqcisim_quantumsim.PyQCISim_quantumsim::execute()` ## Quingo programming tutorial -Please refer to the [Quingo User Document](https://hpcl_quanta.gitee.io/quingo-language-documentation/). \ No newline at end of file +At present, Qingguo runtime system has included sample programs such as `Bell_state`, `GHZ`, `VQE`, etc. Details can be found [here](https://gitee.com/hpcl_quanta/quingo-runtime/tree/master/src/examples). \ No newline at end of file diff --git a/README_ZH.md b/README_ZH.md index 2974ee8..27afb41 100755 --- a/README_ZH.md +++ b/README_ZH.md @@ -4,12 +4,9 @@ ## 环境安装 - -### 概述 青果的安装主要包含以下两个步骤: - -#### 安装运行时系统以及模拟器 +### 安装运行时系统以及模拟器 依次执行以下命令便可以安装青果运行时系统、PyQCAS模拟器以及PyQCISim模拟器。 ```sh @@ -18,19 +15,18 @@ cd /your/download/path/quingo-runtime/ pip install -e . ``` - -#### 安装青果编译器 +### 安装青果编译器 目前的青果编译器有两个版本: 1. 基于`mlir`的青果编译器,该编译器可以生成能够被PyQCISim模拟器模拟的QCIS指令。 2. 基于`xtext`的青果编译器,该编译器可以生成能够被PyQCAS模拟器模拟的eQASM指令。 -##### 基于`mlir`的青果编译器 +#### 基于`mlir`的青果编译器 目前,只要执行了[安装运行时系统以及模拟器](#安装运行时系统以及模拟器)步骤中的所有命令,基于`mlir`的青果编译器的二进制文件便会自动下载,因此用户可以直接使用,无需单独下载。 -##### 基于`xtext`的青果编译器 +#### 基于`xtext`的青果编译器 目前,基于`xtext`的青果编译器还未实现自动下载,故用户需要单独下载[java二进制文件](https://github.com/Quingo/compiler_xtext/releases)来获取青果编译器。 @@ -38,7 +34,7 @@ pip install -e . ```python import quingo # xtext编译器 -quingo.quingo_interface.set_xtext_compiler_path() +quingo.set_xtext_compiler_path() ``` ## 使用 -- Gitee