/Exploiting_Symmetry_Reduces_the_Cost_of_Training_QAOA

Code and data for the paper "Exploiting Symmetry Reduces the Cost of Training QAOA"

Primary LanguageJupyter Notebook

Code and data for the paper "Exploiting Symmetry Reduces the Cost of Training QAOA"

Dependencies

  • NetworkX
  • numpy
  • sympy 1.7.1
  • QTensor (tested as of commit 7a934d7)
  • dreadnaut (nauty 2.7, can be downloaded here)

Running

Computing the symmetries of a graph

To compute the symmetries of a graph, use compute_orbits.py. compute_orbits.py runs dreadnaut internally. Set environment variable $DREADNAUT_PATH to be the path to dreadnaut installation, e.g. export DREADNAUT_PATH=~/soft/nauty27r1/dreadnaut

Example:

python compute_orbits.py --graph graphs/small_search_tree/latin-30 --outpath data/test

Computing the QAOA energy in serial

python compute_energy_serial.py --graph graphs/large_search_tree/mz-aug2-22 --outpath data/test -p 1 --seed 1

Computing the QAOA energy faster by exploiting symmetry

Replies on precomputed orbits (produced by compute_orbits.py)

python compute_energy_accelerated.py --graph graphs/large_search_tree/mz-aug2-22 --outpath data/test -p 1

Reproducing the figures and tables from the paper

See jupyter/generate_tables.ipynb. Additional dependencies: pandas, seaborn