# Blueqat AutoQAOA

Blueqat introduces a new AutoQAOA GUI tool which helps in solving certain optimization problems without having to write the code. A readily available graphical version takes some inputs and gives a wide range of outputs like the matrix, graph diagram, the probability distribution of the states, the optimization steps, the backend python code and the circuit in return.

### Inputs :

The tool accepts three kinds of inputs.

The main input being the QUBO equation which is the Quantum Unconstrained Binary optimization equation. Generally in a QAOA problem we start with the ising formulation as that is closer to the Hamiltonian format but here we use the QUBO format as it is easy to understand for the Computer Scientists as they deal with bits 0s and 1s.

The second input is the number of steps which is the number of times the Unitary Operator corresponding to the Objective hamiltonian and the mixer hamiltonian are run alternatively. The more number of steps, the better the precision we have.

The third input is the optimizer being used which is the classical optimizer that works on the expectation values and tries to minimize the value. The above highlighted boxes represent the inputs we give.

After clicking on the run button we get some outputs which give us a great deal of understanding of the phases through which we get the final output for the optimization problem.

### Outputs :

We get a graphical representation of the nodes and edges given the initial QUBO formulation.

Next we get a matrix representation corresponding to the weights of the edges and the vertices. The matrix and the graph representation are just to understand the QUBO formulation better.

Now we have the next output which is the probability distribution in both graphical form and tabular form. This is the main output which represent the resultant state which solves the above optimization problem and the ones with the highest probabilities stand a great deal of chance to accepted as the solution.

The below diagram gives the above probability distribution in the highlighted boxes. The next output is the optimization steps which give us a graphical representation of the how the expectation value is being optimized or minimized.

We can also get a glimpse of the python code for the QAOA function in the blueqat library and the circuit representation for the quantum part of the algorithm.

Next we will see an example of how the above QAOA tool is solving a maxcut problem for 4 vertices graph.

Let's take the given graph. Seeing the graph we can come to the solution where the vertex 0 and 1 belongs to one set and vertices 1 and 3 belong to the other set for the maxcut problem. The MAXCUT problem is where we have to divide a graph into two sets where the number of edges between the groups is maximum.

So let us try to solve the above problem using the Blueqat's AutoQAOA GUI tool.

First we represent the objective hamiltonian for the above problem in QUBO format. The mixer hamiltonian is always taken as X in QAOA algorithm.

The QUBO is -0.5*(-4*q(0)*q(1)+2*q(0)+2*q(1)-4*q(1)*q(2)+2*q(1)+2*q(2)-4*q(2)*q(3)+2*q(2)+2*q(3)-4*q(0)*q(3)+2*q(0)+2*q(3)) for the above graph.

Now we just have to inout the above QUBO into the tool and we get all the outputs needed.  Here we see that when we keep the number of steps as 1 we get a decent enough output with the resultant state being 0101 or 1010 for the above maxcut problem. We can also see the probability distributions, the optimizer steps. The python is as neat as it could be and easily readable with the circuit being represented in tabular form where the first column is the initial states and the next columns being the gates.

Now we try to input the steps as 2 and see how the accuracy increases. Voila! The probability for the resultant state increases from 0.3 to 0.5 and that's some pretty good result we got here.

Similarly you can try to reframe many such problems into the corresponding QUBOs and try to input here and try to see the magic in just one click.