Postulate is the best way to take and share notes for classes, research, and other learning.
The Quantum Maxcut Solver is a webapp that uses QAOA (the quantum approximate optimization algorithm, a quantum machine learning algo) to solve the maxcut problem. (Read part 1 to learn what maxcut is.) Anyone can use this webapp to run a quantum computer no-code.
But how do you use it? What do these input fields mean? Read this post or watch 10:15-11:05 of this video to find the answer to these questions.
Suppose we want to calculate the maximum cut of this graph.
To tell our code what the graph looks like, we convert it into an array. Like this:
How do we do that?
The graph has 4 nodes, so each node would be given an index from 0 to 3.
An edge is defined by its 2 vertices, in an array [vertex1, vertex2]
For unweighted maxcut problems, that's it. If you want to test out the full capability of this algorithm by adding the weight to the 3rd element of the array.
To define a graph, we only need to define its edges.
Now, when you enter your graph into the Quantum Maxcut Calculator, follow these guidelines:
When entering the graph, I recommend you sketch it out. This helps the vertices and edges mean more than just cold hard numbers. In the future, I may implement a graph visualization tool that prints out the graph you input, or even a graphic user interface for you to input the graph
You can also use the sample graph, which is the one we talked about above.
Now, sit back and wait as the quantum computer works its magic.
The webapp will tell you the answer in a series of bits. Each bit tells you information about one vertex.
In this case, the answer is 1010
. This means that vertices number 0 and 2 are on one side of the cut, while vertices 1 and 3 are on the other side.
That's it! You have successfully ran your first quantum machine learning algorithm 🎉
Thoughts? Want to rage at me over how the app keeps giving you erros? Send 'em my way.
Working notes from learning QC