-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add VQE estimator tutorial #235
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I had trouble running the main experiement, but could be something I'm doing wrong either in the notebook or on cloud.ibm.com
. Otherwise, just found a couple of name errors.
The code does take awhile to run. I am open to suggestions to accelerate it (I am not super familiar with cloud interactions, so perhaps there are simple things to greatly accelerate it). If that is a problem I can make it not do PES and just one bond length. |
No idea about the cloud interactions, but if there's a way to trade off accuracy for speed, I would personally opt for that. Could also add print updates in |
Updating the optimizer I could get it down to ~20-30 minutes runtime with ok results. I also added an iteration logger. (and accidentally leaked my token whoops, had to regenerate that). |
Great job for figuring out how to use VQE with new estimator! It must be a lot of work to figure things out, I know it would be for me, because the code look so different from the old way. I haven't looked the the tutorials in details yet, but I think it might be better to simply it to only calculate one energy (at equilibrium bond distance?) instead of 26? I think that will make the code a lot easier to follow for beginners and it will also speed up the code a lot more. |
I was considering that as an option (I just started with a PES curve because they are so ubiquitous). That would certainly accelerate the code. I don't have a strong opinion one way or the other, so however you think is best I can change it. |
@frankharkins What do you think? |
I think either is fine, my worry was that the user would be waiting 30mins for any feedback so might not know if things are working or not. |
I have made the (major) change of converting it to be a single convergence curve, which should help accelerate things. I had to change optimizers because COBYLA doesn't allow callbacks (not sure why that is the case in scipy), but it still gives a nice convergence graph. |
Are the changes we were told about "Rename IBMRuntimeService -> QiskitRuntimeService |
Yes needs to be incorporated, that change will be released tomorrow or Friday. |
Ok, I made those changes (pretty simple, just updating those function/class names). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I added the Qiskit runtime version (0.4.0). I also added the VQE to the tutorial.rst file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lockwo! Could you please check this doc build failure https://github.com/Qiskit/qiskit-ibm-runtime/runs/5889707278?check_suite_focus=true#step:5:629 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a lot @lockwo!
Co-authored-by: ElePT <epenatap@gmail.com> Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk> Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Jim Garrison <garrison@ibm.com> Co-authored-by: Junye Huang <h.jun.ye@gmail.com> Co-authored-by: Kevin Tian <kt474@cornell.edu> Co-authored-by: Paul Nation <nonhermitian@gmail.com> Co-authored-by: Rathish Cholarajan <rathish.c@ibm.com> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: Sanket Panda <pandasa123@gmail.com> Co-authored-by: jspark971 <jspark971@gmail.com> Co-authored-by: kevin-tian <kevin.tian@ibm.com> Co-authored-by: lerongil <leron_1234@yahoo.com>
Originally created in Qiskit/qiskit-ibm-runtime#235 Co-authored-by: ElePT <epenatap@gmail.com> Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk> Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Jim Garrison <garrison@ibm.com> Co-authored-by: Junye Huang <h.jun.ye@gmail.com> Co-authored-by: Kevin Tian <kt474@cornell.edu> Co-authored-by: Paul Nation <nonhermitian@gmail.com> Co-authored-by: Rathish Cholarajan <rathish.c@ibm.com> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: Sanket Panda <pandasa123@gmail.com> Co-authored-by: jspark971 <jspark971@gmail.com> Co-authored-by: kevin-tian <kevin.tian@ibm.com> Co-authored-by: lerongil <leron_1234@yahoo.com>
Originally created in Qiskit/qiskit-ibm-runtime#235 Co-authored-by: ElePT <epenatap@gmail.com> Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk> Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Jim Garrison <garrison@ibm.com> Co-authored-by: Junye Huang <h.jun.ye@gmail.com> Co-authored-by: Kevin Tian <kt474@cornell.edu> Co-authored-by: Paul Nation <nonhermitian@gmail.com> Co-authored-by: Rathish Cholarajan <rathish.c@ibm.com> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: Sanket Panda <pandasa123@gmail.com> Co-authored-by: jspark971 <jspark971@gmail.com> Co-authored-by: kevin-tian <kevin.tian@ibm.com> Co-authored-by: lerongil <leron_1234@yahoo.com>
Originally created in Qiskit/qiskit-ibm-runtime#235 Co-authored-by: ElePT <epenatap@gmail.com> Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk> Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com> Co-authored-by: Jessie Yu <jessieyu@us.ibm.com> Co-authored-by: Jim Garrison <garrison@ibm.com> Co-authored-by: Junye Huang <h.jun.ye@gmail.com> Co-authored-by: Kevin Tian <kt474@cornell.edu> Co-authored-by: Paul Nation <nonhermitian@gmail.com> Co-authored-by: Rathish Cholarajan <rathish.c@ibm.com> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: Sanket Panda <pandasa123@gmail.com> Co-authored-by: jspark971 <jspark971@gmail.com> Co-authored-by: kevin-tian <kevin.tian@ibm.com> Co-authored-by: lerongil <leron_1234@yahoo.com>
Short tutorial showing integration with Qiskit (and Qiskit nature) for optimizing molecular hamiltonians. Feedback welcome, it is a first draft.