Quantum Approximate Optimization Algorithm (QAOA)#
Download the requirements.txt
Setup#
Requires Python 3.10 or newer (tested with Python 3.13 and 3.14).
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Then open the notebooks in Jupyter, e.g. with pip install jupyterlab && jupyter lab.
- Comparison of Different Optimizers for QAOA on a Max Cut instance
- 1. Import the python QAOA package
- 2. Create Barabási–Albert graph instance, more examples can be found here https://github.com/OpenQuantumComputing/data
- 3. Create a QAOA instance
- 4.1 draw the circuit for the initial state
- 4.2 draw the circuit for the problem
- 4.3 draw the circuit for the mixer
- 6. Below the approximation ratios are plotted for the different optimizers. From the figure we see that the different optimizers give roughly the same approximation ratio.