Read the report here.
Variational quantum algorithms (VQAs), which use classical algorithms to optimize parameterized quantum circuits, are seen as the best hope to achieve quantum advantage due to their wide range of applications and compatibility with near- term quantum computers. However, finding efficient classical optimization strategies for VQAs can be challenging. For example, the quantum approximate optimization algorithm (QAOA) has loss landscapes that are generally non-convex, and typical gradient descent optimization may get stuck at bad local optima and saddle points. In this work, we investigate the use of stochasticity to escape saddle points. We provide evidence that additional stochasticity can escape saddle points, but may also lead to worse solutions
- Navigate to
main/
. - Edit
vqa.py
, which contains classes for VQAs using Pennylane. The VQAs used in the report are already written, but you may change the optimizer, ansatz, and Hamiltonian however you choose. In the other files, call the correct VQA i.e.vqa = MVC(...)
. - Run
search.py
to search for initial starting points that lead to suboptimal solutions. - Run
main.py index
, where index is an integer representing which initial point inbad-points.pkl
to start from, to run the optimization over various noise levels (perturbation radii). - Run
plot-sol.py
to plot the probability distribution of the optimized ansatz. - Run
plot.py index
to plot loss vs. iterations, where index is an integer representing which initial point inbad-points.pkl
to start from.
Folders 1-4 work with the VQA in section 4.1 in the report, while folders 5-7 work with the VQA in section 4.2.
1/
finds initial points that lead to suboptimal solutions and stores them inbad_points.pkl
.2/
is the same as3/
. You can ignore this folder.3/
optimizes the VQA for various noise levels (perturbation radii). Initial point is chosen so that no noise leads to a suboptimal solution. Analytically solves the circuit.4/
is the same as3/
, except it uses a circuit with 1024 shots rather than an analytic solution of the circuit.5/
finds initial points that lead to suboptimal solutions and stores them inbad_points.pkl
. Conducts a grid search of the entire parameters space.6/
optimizes the VQA for various noise levels (perturbation radii). Initial point is chosen so that no noise leads to a global minimum. Analytically solves the circuit.7/
optimizes the VQA for various noise levels (perturbation radii). Initial points are chosen so that no noise leads to a saddle point. Analytically solves the circuit.