Skip to content

Added simple VQE sample #2073

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

Merged
merged 6 commits into from
Jan 15, 2025
Merged

Added simple VQE sample #2073

merged 6 commits into from
Jan 15, 2025

Conversation

DmitryVasilevsky
Copy link
Contributor

@DmitryVasilevsky DmitryVasilevsky commented Dec 19, 2024

This PR adds simple self-contained example of a Variational Quantum Eigensolver (VQE).

This example includes:

  1. Simple classical optimization to find minimum of a multi-variable function in order to find the approximation to the minimum eigenvalue of a Hamiltonian.
  2. Finding Hamiltonian expectation value as a weighted sum of terms.
  3. Finding one term expectation value by performing multiple shots of preparing ansatz state and measuring it.
  4. Ansatz state preparation similar to the circuit in the published paper "Ground-state energy estimation of the water molecule on a trapped ion quantum computer" (https://arxiv.org/abs/1902.10171)

To keep this sample simple and self-contained Hamiltonian is artificial (doesn't correspond to any actual chemistry problem). Also, this sample doesn't include any application of VQE, for example, finding a geometry of a molecule.

@DmitryVasilevsky DmitryVasilevsky changed the title Added simple VQE sample - quantum step of VQE Added simple VQE sample Jan 9, 2025
@DmitryVasilevsky DmitryVasilevsky marked this pull request as ready for review January 9, 2025 10:25
Copy link
Member

@msoeken msoeken left a comment

Choose a reason for hiding this comment

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

Looks good to me, left some comments.

Copy link
Collaborator

@swernli swernli left a comment

Choose a reason for hiding this comment

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

Looks good; I think it would be worth adding it to the samples.mjs that controls which samples show up in the editor!

@DmitryVasilevsky
Copy link
Contributor Author

DmitryVasilevsky commented Jan 15, 2025

... adding it to the samples.mjs that controls which samples show up in the editor!

Not sure if this is a good sample to have as a quick template. Not all samples are in that list, and this sample is a more specialized one.

@swernli
Copy link
Collaborator

swernli commented Jan 15, 2025

... adding it to the samples.mjs that controls which samples show up in the editor!

Not sure if this is a good sample to have as a quick template. Not all samples are in that list, and this sample is a more specialized one.

Ok, we can leave part for a later PR if we decide we want to include it.

@DmitryVasilevsky DmitryVasilevsky added this pull request to the merge queue Jan 15, 2025
Merged via the queue into main with commit ca1bc18 Jan 15, 2025
18 checks passed
@DmitryVasilevsky DmitryVasilevsky deleted the dmitryv/simplevqe branch January 15, 2025 23:45
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