Package: arline-benchmarks
Arline BenchmarksArline Benchmarksplatform allows to benchmark various algorithms for quantum circuit mapping/compression against
each other on a list of predefined hardware types and target circuit classes.Demo (report generation preview)Benchmarking runLaTeX reportList of supported compilation frameworksGoogle Cirq libraryIBM QiskitInstallation$pip3installarline-benchmarksAlternatively, Arline Benchmarks can be installed locally in the editable mode.
Clone Arline Benchmarks repository,cdto the source directory:Clone repository,cdto the source directory:$gitclonehttps://github.com/ArlineQ/arline_benchmarks.git$cdarline_benchmarksWe recommend to install Arline Benchmarks invirtual environment.$virtualenvvenv$sourcevenv/bin/activateIfvirtualenvis not installed on your machine, run$pip3installvirtualenvNext in order to install the Arline Benchmarks platform execute:$pip3install.Alternatively, Arline Benchmarks can be installed in the editable mode:$pip3install-e.TeXLive installationAutomated generation of LaTeX report is an essential part of Arline Benchmarks.
In order to enable full functionality of Arline Benchmarks, you will need to install TeXLive distribution.Ubuntu or Debian Linux:To install TeXLive simply run in terminal:$sudoaptinstalltexlive-latex-extraWindows:On Windows, TeXLive can be installed by downloading source code fromofficial websiteand following installation instructions.MacOS:On MacOS simply install MacTex distribution from theofficial website.Alternative solution for Linux/Windows/MacOS:TeXLive can be also installed as a part of the MikTex package by downloading and installing source code fromhttps://miktex.org. TeXworks frontend is not required and can be ignored.Getting startedBenchmark example runIn order to run your first benchmarking experiment execute following commands$cdarline_benchmarks/configs/compression/$bashrun_and_plot.shBash scriptrun_and_plot.shexecutesscripts/arline-benchmarks-runner- runs benchmarking experiment and saves result toresults/output /gate_chain_report.csvarline_benhmarks/reports/plot_benchmarks.py- generates plots with metrics based onresults/output /gate_chain_report.csvtoresults/output/figurescripts/arline-latex-report-generator- generatesresults/latex/benchmark_report.texandresults/latex/benchmark_report.pdfreport files with benchmarking results.Configuration fileconfigs/compression/config.jsonnetcontains full description of benchmarking experiments.Generate plots with benchmark metricsTo re-draw plots execute (fromarline_benchmarks/configs/compression/)$bashplot.shGenerate LaTeX reportTo re-generate LaTeX report based on the last benchmarking run (fromarline_benchmarks/configs/compression/)$arline-latex-report-generator-iresults-oresultsHow to create a custom compilation pipeline?The key element of Arline Benchmarks is the concept ofcompilation pipeline.
A pipeline is a sequence of compilationstages: [stage1, stage2, stage3, ..].A typical pipeline consists of the following stages:Generation of a target circuitMapping of logical qubits to physical qubitsQubit routing for a particular hardware coupling topologyCircuit compression by applying circuit identitiesRebase to the final hardware gate setYou can easily create a custom compilation pipeline by stacking individual stages (that might correspond to different
compiler providers). A pipeline can consist of an unlimited number of compilation stages combined in an arbitrary order.
The only exceptions are the first stagetarget_analysisand the lastgateset rebase stage(optional).Configuration file .jsonnetPipelines should be specified in the main configuration file .jsonnet.
An example of a configuration file is located inconfigs/compression/config.jsonnet.Functionlocal pipelines_set(target, hardware, plot_group)defines a list of compilation pipelines to be benchmarked,[pipeline1, pipeline2, ...].Eachpipeline_i = {...}is represented as a dictionary that contains a description of the pipeline and a list of
compilation stages.Target circuits generation is defined in .jsonnet functionslocal random_chain_cliford_t_target(...)andlocal random_chain_cx_u3_target(...).Benchmarking experiment specifications are defined at the end of the config file in the dictionary with keys{pipelines: ..., plotter: ...}API documentationAPI documentation is heredocumentation.
To generate HTML API documentation, run below command:$cddocs/$makehtmlRunning testsTo run unit-tests and check installed dependencies:$toxFolder structurearline_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