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 MaxCut #845

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

QAOA MaxCut #845

wants to merge 11 commits into from

Conversation

NadavClassiq
Copy link
Collaborator

PR Description

Some notes

  • Please make sure that you placed the files in an appropriate folder

  • And that the files have indicative names.

  • Please note that Classiq runs automatic code linting, which may minorly alter some files.

    • If you're familiar with pre-commit, you may run pre-commit install, and then at each commit, your files will be altered in a similar way

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

worth adding a figure \ drawing


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Consider add some drawing or circuit visualization of the circuit


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

1 - Why the mixing operation is Digital? and the Phase Analog?

2 - "toward a partition that maximizes the number of cut edges.":

*towards

*maybe minimizes the hamiltonian? instead of the cut. and put the f_obj in negative sign


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #1.    from classiq import *

I would put either all necessary imports in a single cell, or import each package in the first place where it is needed


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #14.    plt.title("Graph Visualization for Max-Cut")

This is not visualization of the Max-Cut, just the graph


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #4.        num_layers: CInt,

maybe you don't need this - use the gammas\betas size instead


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #6.        params: CArray[CReal, NUM_LAYERS * 2],

Maybe worth an explanation - this is an execution parameter, to be set by the sample method later on in the classical optimization loop


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #9.        allocate(v.size, v)

no need to provide v.size, because it was declared in the main signature


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #10.        hadamard_transform(v)  # here or aside?

remove the comment


Reply via ReviewNB

@@ -0,0 +1,786 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 5, 2025

Choose a reason for hiding this comment

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

Line #3.    NUM_SHOTS = 1000  # Per execution

maybe "per parameter set choice"


Reply via ReviewNB

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.

2 participants