Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QAOA and MAXCUT landscape plotting #212

Merged
merged 1 commit into from
Nov 21, 2019
Merged

QAOA and MAXCUT landscape plotting #212

merged 1 commit into from
Nov 21, 2019

Conversation

stylewarning
Copy link
Member

this adds a small example to run QAOA and also plot the cool landscape plots

@notmgsk
Copy link
Member

notmgsk commented Nov 12, 2019

I dare you https://github.com/bendudson/py4cl/

@stylewarning
Copy link
Member Author

From

QVM-EXAMPLES> (time (qaoa-dump (loop :for i :from 1 :below 13 :append
                                (loop :for j :below i
                                      :collect (list j i)))
                          "~/Scratch/qaoa.dat"))

qaoa13

Copy link
Contributor

@jmbr jmbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing obviously wrong jumps at me.

After FILE is created, one may plot the data with gnuplot. The following commands will plot (and live-update) the data:

set view map
splot \"FILE\" u 1:2:3 w pm3d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion #1: set size square
Suggestion #2: use a sequential colorbrewer palette such as https://github.com/aschn/gnuplot-colorbrewer/blob/master/sequential/Blues.plt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmmmm sequential blues 💙

;; Hamiltonian
(driver-ham (loop :for q :below n
:collect (cl-quil.clifford:embed cl-quil.clifford:+X+ n (list q))))
(isns (quil:with-inst ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with-inst is not external

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be in the latest cl-quil

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we bump the cl-quil dependency to 1.13.1 then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qvm-examples are low stakes, but prob reasonable

@stylewarning stylewarning merged commit 35350d2 into master Nov 21, 2019
@stylewarning stylewarning deleted the qaoa-bench branch November 21, 2019 23:11
@notmgsk notmgsk mentioned this pull request Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants