Skip to content

Adapt VQE- Paper Implementation Challenge #899

New issue

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

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

Already on GitHub? # to your account

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

Conversation

Dacastillo
Copy link

This pull request is related with this project: #798. Here it is the ideas we have:

  • We make and Adapt-VQE code using Qiskit-Nature, tested for H-H, H-Li, and H-F.
  • We look for changes to the original VQE code of Classiq, trying to understand what kind of changes must be done to make the Adapt-VQE (basically, add flexibility to the algorithm).
  • We study all the source code (to reach the quality standard you need) and the best idea we believe than we can implement is to make the code flexible following the idea of the flexible QPE example.

We require some time to complete the code combination and test at least with the 3 examples mentioned before. It will be made more changes in this request.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@TomerGoldfriend TomerGoldfriend self-requested a review April 1, 2025 07:57
@TomerGoldfriend
Copy link
Member

Hi @Dacastillo , it is unclear what this PR is for. You added two notebooks, that seem very similar to ones we already have. In addition, you added some qiskit-nature code. I do not see how this PR addresses issue for Adaptive VQE.

I am not sure how the approach of flexible_qpe is relevant here. Feel free to reach out to the community on Slack if you have questions.

We can extend the deadline, how much time do you think you need to complete your contribution?

@Dacastillo
Copy link
Author

Dacastillo commented Apr 1, 2025 via email

@Dacastillo
Copy link
Author

Adding a new version with new code. We are making checks and cleaning to give an adequate implementation result this Saturday.

@TaliCohn TaliCohn removed the request for review from TomerGoldfriend April 3, 2025 10:40
@TomerGoldfriend
Copy link
Member

Adding a new version with new code. We are making checks and cleaning to give an adequate implementation result this Saturday.

@Dacastillo is it ready for review?

@Dacastillo
Copy link
Author

Adding a new version with new code. We are making checks and cleaning to give an adequate implementation result this Saturday.

@Dacastillo is it ready for review?

Hi! The new version is ready, and I'm trying to test this folder to send it to testing. And it fails by timeouts.

adapt_vqe_for_energy_curve.zip

Sorry for the delay. We are trying the best and we still talking to make a more complete work. Greetings.

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

@TomerGoldfriend TomerGoldfriend Apr 7, 2025

Choose a reason for hiding this comment

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

Why is this considered an Adaptive VQE? As far as I remember, in adapt VQE you change the quantum model in each iteration, depending on the previous one. Here you are just changing the molecule itself.


Reply via ReviewNB

Copy link
Author

Choose a reason for hiding this comment

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

I will answer you using the reference that defines Adapt-VQE first (https://ar5iv.labs.arxiv.org/html/1812.11173).

The main goal of the Adapt-VQE works it to optimize the ansatz, determining a quasi-optimal one with the minimal number of operators for a desired level of accuracy. The result of their research was made, defining a pool of fermionic operators where there will be selected at any step of the process. They try to increase the number of operators until reach some accuracy level from a defined result.

Despite all our study, the main difficulty we have to make a similar circuit is to translate the algorithm to Classiq code. So, to reach the delivery deadline, we make a code with some aspects of the main goal considered. We were playing with the circuit depth and the maximum number of C-NOT operators the circuit can implement. Our system tries to use as example for accuracy finding the calculation of exact results in some point and the calculation of some threshold of distance between this exact results and the VQE results. Until the threshold was reached, the circuit will be increase its depth and maximum number of operators, at least as our design works (sorry if the threshold seems a trap, it is not something like this, and it can be removed). So, we try to change the quantum models.

We're still having interest in making the code working, even though we are learning in the process to struggle with the code testing. We know that following exactly than the Adapt-VQE literature suggest requires different code (for example: to define the operator pool and putting it in the circuit following the paper logic). So, keep assured that we are working on it.

Thank you for the interest.

Copy link
Member

Choose a reason for hiding this comment

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

@Dacastillo OK, thank you for the clarification.
Concerning your approach, it is not completely clear if it can give an analogous behavior (for the Adapt-VQE in the literature). This is because playing with the synthesis constraints only guarantees an upper bound.

We have just added a notebook that uses openfermion package to define VQE with UCC ansatz in Qmod. This is a very comprehensive notebook, that contains all the relevant functions you need, similar to what qiskit-nature has. I think that working with it will allow you to build an Adapt-VQE. One big part of this notebook concerns reducing the problem with Z2-symmetries, which makes the notebook quite complex. However, you can skip that part for your Adapt VQE example.

(Comment: in the near future we plan to add several classical functions from this notebook to our SDK package. But this will take time).

@TaliCohn TaliCohn added the Paper Implementation Project Implement a paper using Classiq label Apr 10, 2025
@TaliCohn
Copy link
Member

@Dacastillo Are you still working on this?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Paper Implementation Project Implement a paper using Classiq
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants