Skip to content

lfd/wihpqc2024-noisy-qaoa

Repository files navigation

Prerequisites

  • Python 3.9.16
  • QLM 1.9.1
  • Docker 24.0.5
  • Make
  • Git

Install

  1. Clone this repository
  2. Download the Qiskit repository (for search_backends.py) by running git submodule update --init --recursive or source clone_qiskit_repository.sh in case you only have the standalone version of this reproduction package (without Git).
  3. Create virtual environment
python3 -m venv .venv
  1. Install Python dependencies
make install

Usage

Run noisy QAOA benchmarks

Important: Benchmark are executed using the proprietary QLM library. We refer to this website for more details.

Raw noisy QAOA benchmark results are generated by *.bash in the results directory and stored as results/*.txt files with the same name as the corrsponding Bash script. Each benchmark result file can be created with make results/FILENAME.txt. Alternatively, you can run all benchmarks using make results.

The degree of parallelism used for the benchmarks can be selected with the environment variable N_THREADS. For instance, N_THREADS=10 make results runs all benchmarks using 10 threads. The default value is N_THREADS=1. Be aware that executing all benchmarks takes a very long time. We ran the benchmarks on a Qaptiva 800 with 192 threads, which took over a week.

Generate plot data

Plot data, which is generated from the benchmark results, is stored as CSV files in the csvs/ directory. The CSV files needed for the plots are already part of the repository. CSV file csvs/FILENAME.csv can be generated with make csvs/FILENAME.csv. Be aware that this automatically generates the benchmark results required for the plot if they do not already exist. Alternatively, one can create all csvs files with make csvs.

Generate plots

To generate the plots, run make plots. This creates two directories img-pdf and img-tikz and builds and runs a Docker container, which generates the plots, both as PDF and as Tikz graphics.

Project structure

Python scripts

  • run_benchmarks.py: Main script to run the noisy QAOA benchmarks
  • search_backends.py: Search noise parameters of the Qiskit fake backends

Other Python files

  • create_optimized_qaoa_circuit.py: Reduce problem Hamiltonian circuit depth using Misra-Gries edge coloring
  • filter_results.py: Filter benchmark results using a simple query language
  • generate_param_sets.py: generates multiple parameter sets from a JSON document using Cartesian product
  • parse_params.py: Specification of benchmark parameters
  • rqaoa.py: Implementation of Recursive QAOA for QLM
  • terms.py: QUBO/Ising conversion logic and variable substitution for Recursive QAOA
  • transpile_to_sx_rz.py: Circuit transpilation for QAOA circuits into the IMB-Q native gate set

Other

  • results/: Stores benchmark results and Bash scripts to run the respective benchmarks
  • csvs/: Stores plot data, obtained from the results/, as CSV files as well as Python scripts to create these files.
  • r/: R scripts to generate the plots from the csv/ files
  • qiskit-terra/: Qiskit submodule, which is searched by search_backends.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published