View on GitHub
Open this notebook in GitHub to run it yourself
- Pre-Requirments
- Define the Optimization Problem
- Create Your Ising Model
- Optimize Using to Quantum Optimization Algorithm
num_layers) and the number of iterations for the optimizer (maxiter).
get_qprog command and show it
Output:
Output:
optimize function:
Output:
Output:

- Present Quantum Results
sample method to get samples with the optimzied parameters. We hereby present the optimization results.
Since this is a quantum solution with probabilistic results, there is a defined probability for each result to be obtained by a measurement (presented by an histogram), where the solution is chosen to be the most probable one.
We remind that in the notation of the solution “0” indicate “-1” spin value, and “1” indicates “1” spin value.
We will also want to compare the optimized results to uniformly sampled results:

Output: