Skip to main content

量子编译器的自动化基准测试平台

项目描述

Arline 基准

Arline Benchmarks平台允许在预定义的硬件类型和目标电路类列表上对用于量子电路映射/压缩的各种算法进行基准测试。

演示(报告生成预览)

基准测试

基准测试

乳胶报告

报告

支持的编译框架列表

安装

$ pip3 install arline-benchmarks

或者,可以以可编辑模式在本地安装 Arline Benchmarks。将Arline Benchmarks 存储库克隆cd到源目录:

将存储库克隆cd到源目录:

$ git clone https://github.com/ArlineQ/arline_benchmarks.git
$ cd arline_benchmarks

我们建议在虚拟环境中安装 Arline Benchmarks 。

$ virtualenv venv
$ source venv/bin/activate

如果virtualenv您的机器上没有安装,请运行

$ pip3 install virtualenv

接下来为了安装 Arline Benchmarks 平台,执行:

$ pip3 install .

或者,可以在可编辑模式下安装 Arline Benchmarks:

$ pip3 install -e .

TeXLive 安装

自动生成 LaTeX 报告是 Arline Benchmarks 的重要组成部分。为了启用 Arline Benchmarks 的全部功能,您需要安装 TeXLive 发行版。

Ubuntu 或 Debian Linux:

要安装 TeXLive,只需在终端中运行:

$ sudo apt install texlive-latex-extra

视窗:

在 Windows 上,可以通过从官网下载源代码 并按照安装说明安装 TeXLive。

苹果系统:

在 MacOS 上,只需从官方网站安装 MacTex 发行版。

Linux/Windows/MacOS 的替代解决方案:

TeXLive 也可以通过从https://miktex.org下载和安装源代码作为 MikTex 包的一部分进行安装 。TeXworks 前端不是必需的,可以忽略。

入门

基准示例运行

为了运行您的第一个基准测试实验,请执行以下命令

$ cd arline_benchmarks/configs/compression/
$ bash run_and_plot.sh

Bash 脚本run_and_plot.sh执行

  1. scripts/arline-benchmarks-runner- 运行基准测试并将结果保存到results/output /gate_chain_report.csv
  2. arline_benhmarks/reports/plot_benchmarks.py- 使用基于results/output /gate_chain_report.csvto的指标生成图results/output/figure
  3. scripts/arline-latex-report-generator- 生成results/latex/benchmark_report.texresults/latex/benchmark_report.pdf报告具有基准测试结果的文件。

配置文件configs/compression/config.jsonnet包含基准测试实验的完整描述。

使用基准指标生成图

重新绘制绘图执行(从arline_benchmarks/configs/compression/

$ bash plot.sh

生成 LaTeX 报告

根据上次基准测试运行重新生成 LaTeX 报告(来自arline_benchmarks/configs/compression/

$ arline-latex-report-generator -i results -o results

如何创建自定义编译管道?

Arline Benchmarks 的关键元素是编译管道的概念。管道是一系列编译stages: [stage1, stage2, stage3, ..]

典型的管道由以下阶段组成:

  • 目标电路的生成
  • 逻辑量子位到物理量子位的映射
  • 特定硬件耦合拓扑的量子位路由
  • 通过应用电路标识进行电路压缩
  • 变基到最终的硬件门集

您可以通过堆叠各个阶段(可能对应于不同的编译器提供程序)轻松创建自定义编译管道。管道可以由以任意顺序组合的无限数量的编译阶段组成。唯一的例外是第一阶段target_analysis和最后阶段gateset rebase stage(可选)。

配置文件 .jsonnet

管道应在主配置文件 .jsonnet 中指定。配置文件的示例位于configs/compression/config.jsonnet.

  • 函数local pipelines_set(target, hardware, plot_group)定义了要进行基准测试的编译管道列表,[pipeline1, pipeline2, ...].

每个pipeline_i = {...}都表示为包含管道描述和编译阶段列表的字典。

  • 目标电路生成在 .jsonnet 函数local random_chain_cliford_t_target(...)和.jsonnet 函数中定义local random_chain_cx_u3_target(...)

  • 基准测试规范定义在字典中配置文件的末尾,带有键{pipelines: ..., plotter: ...}

API 文档

API 文档在这里是文档。要生成 HTML API 文档,请运行以下命令:

$ cd docs/
$ make html

运行测试

要运行单元测试并检查已安装的依赖项:

$ tox

文件夹结构

arline_benchmarks
│
├── arline_benchmarks            # platform classes
│   ├── config_parser            # parser of pipeline configuration
│   ├── engine                   # pipeline engine
│   ├── metrics                  # metrics for pipeline comparison
|   ├── pipeline                 # pipeline
│   ├── reports                  # LaTeX report generator
│   ├── strategies               # list of strategies for mapping/compression/rebase
│   └── targets                  # target generator
│
├── circuits                     # qasm circuits dataset
│
├── configs                      # configuration files
│   └── compression              # config .jsonnet file and .sh scripts
│
├── docs                         # documentation
│
├── scripts                      # run files
│
└── test                         # tests
    ├── qasm_files               # .qasm files for test
    └── targets                  # test for targets module

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

arline-benchmarks-0.1.8.tar.gz (148.3 kB 查看哈希

已上传 source

内置分布

arline_benchmarks-0.1.8-py3-none-any.whl (171.2 kB 查看哈希

已上传 py3