Skip to content

Adapt vqe2#1407

Closed
roie-d-classiq wants to merge 19 commits intomainfrom
adapt_vqe2
Closed

Adapt vqe2#1407
roie-d-classiq wants to merge 19 commits intomainfrom
adapt_vqe2

Conversation

@roie-d-classiq
Copy link
Collaborator

@roie-d-classiq roie-d-classiq commented Dec 27, 2025

PR Description

Some notes

  • Please make sure that the notebook runs successfully with the latest Classiq version.

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

    • And that the file names are clear, descriptive, and match the notebook content.
      • Note that we require the file names of .ipynb and .qmod to be unique across this repository.
    • Plus, please make sure that all required files are included: .qmod, .synthesis_options.json, .metadata.json
    • And that images are embedded inside the notebook, not added as external files
  • If applicable, please include link to the paper on which the notebook is based, in the notebook itself.

  • Please use rebase on your branch (no merge commits)

  • Please link this PR to the relevant issue

  • Please make sure to run pre-commit when commiting changes

    • If you're using git in the terminal, make sure to install pre-commit via running pip install pre-commit followed by pre-commit install
    • Note that Classiq runs automatic code linting. Meaning that one of the tests verifies the output of pre-commit.
    • Also note that pre-commit may minorly alter some files. Make sure to git add the changes done by pre-commit

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link

github-actions bot commented Dec 27, 2025

🔥 New notebook just dropped!

@amir-naveh , @TomerGoldfriend — come check out this shiny new addition to our repo.

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

  • Output: Approximation of the ground state and energy of H.
  • ansats --> ansatze? (I think ansatz in plural is ansatze).
  • I would write somewhere here explicitly that ADAPT-VQE is still an approximated and heuristic algorithm (meaning, there is no guarantee it will converge).
  • Concerning Complexity: there are many ways to define a complexity... here this is a cost of what? maybe write explicitly that this is the number of observable estimations, and then add that the time/gate complexity of each estimation depends on the operator itself and the details of the ansatz?

Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed all the comments

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

Note that when multiple quantum computers are available, the preparation of the trial state and measurement of the commutation relations with the Hamiltonian can be performed in parallel, substantially reducing the runtime.

This is also true if I have enough qubits on a single quantum computer, right? I can run in parallel on different qubits?


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, definitely, added a comment.

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

What is p?


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, should be K (renamed the variables in the middle....)

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

Line #37.        # print("Computing operator gradients...")

You can remove this


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

Line #43.        execution_preferences = ExecutionPreferences(

Maybe put this outside of the loop. It is a parameter which is relevant for all iteration.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

definitely, done

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

Line #74.        # write_qmod(main, name="adapt_vqe", decimal_precision=15, symbolic_only=False)

Remove


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

It is unclear how the optimal differs from the standard ADAPT-VQE..


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

modified...

@@ -0,0 +1,1158 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Dec 28, 2025

Choose a reason for hiding this comment

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

VQE has smaller depth compared to ADAPT...


Reply via ReviewNB

Copy link
Collaborator Author

@roie-d-classiq roie-d-classiq Dec 29, 2025

Choose a reason for hiding this comment

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

Yes, because I fixed the ansatz state. But it gives a worth results (higher energy).

@classiqdor classiqdor deleted the adapt_vqe2 branch January 15, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants