View on GitHub
Open this notebook in GitHub to run it yourself
- Define Problem Classically with Pyomo
- We have a limited number of antennas defined by .
- We have a set of potential locations: , where
- We limit certain locations with an overlap, not to use 2 antennas.
Mathematical Definition
Each location is a binary variable that is 1 if we put antenna there and 0 if we don’t put in that location. Each location is charachterized with certain consumption . Mathematically, it is translated into objective function which aims to maximized its coverage: Now, we add the constraints, such as the number of antennas: We can also add a constraint that prevent an ovelap between antennas. All sets of neighboring antenna sites will have only 1 anntenna on the ground:Defining Pyomo Model
Define QAOA Parameters and Synthesize
In order to solve the Pyomo model defined above, we use the Classiq combinatorial optimization engine via theCombinatorialProblem class.
For the quantum part of the QAOA algorithm, define the number of repetitions (num_layers) and the penalty_factor to get results that satisfy your constraints. Be careful! A large penalty can also bring you away from the optimized solution:
maxiter) — are provided later, when we call combi.optimize.
Lastly, we load the model, based on the problem and algorithm parameters, which we can use to solve the problem:
Output:
Output:
Executing the Hybrid Algorithm
We now solve the problem by running the hybrid optimization loop withcombi.optimize:
Output:
Output:

Analyze Results
We can also examine the statistics of the algorithm:Output:
