-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update Gradient Framework tutorial to use primitives #1390
Update Gradient Framework tutorial to use primitives #1390
Comments
1. Moving the Gradient Tutorial to Algorithms
2. Updating the Tutorial to Show Use of Primitives This tutorial would focus on explaining how primitives can be used within the gradient framework.
3. Adding a New Tutorial for Classically Efficient Gradients This tutorial would introduce the concept of classically efficient gradients and show how to use them.
|
I am trying to start with qiskit.algorithms.gradients using this tutorial: https://medium.com/qiskit/introducing-qiskit-algorithms-with-qiskit-runtime-primitives-d89703ecfca3 |
Hi @maxwell04-wq, #Qiskit/qiskit#9085 restructured the way the QFI class is instantiated. You can see an updated example in the gradients section of the opflow migration guide. |
Hi, thanks for your comment, but please note that this is not considered a contribution towards the Unitary Hack bounty. That being said, it also does not accurately reflect the content we want in this tutorial, but I agree that the explanation in the description was too short to properly convey this. I have noted this and added further explanation to the issue description, but I will also clarify here the 2 first points:
|
@maxwell04-wq this issue is a part of the UnitaryHack bounty, but the third item in the TO-DO list (adding a tutorial for classical gradients) is optional. |
@ElePT and @maxwell04-wq.
The result : |
**Summary** Fixes Qiskit#1390 **Details** Updates the gradients tutorial from `opflow.gradients` to `algorithms.gradients` - Use of BaseEstimator and BaseSampler classes from Primitives for gradient evaluation - Demonstration of different methods for gradient evaluation - Application example: VQE - Solved using Estimator, Sampler, and classical optimizer (scipy.minimize) *Comments* - More details on SPSA gradient and Qiskit Primitives can be added
@maxwell04-wq Great tutorial. |
<!--⚠️ If you do not respect this template, your pull request will be closed.⚠️ Your pull request title should be short detailed and understandable for all.⚠️ If your pull request fixes an open issue, please link to the issue. ✅ I have added the tests to cover my changes. ✅ I have updated the documentation accordingly. ✅ I have read the CONTRIBUTING document. --> ### Summary Fixes #1390, Unitary Hack contribution. ### Details and comments - Updates the gradients tutorial from `opflow.gradients` to `algorithms.gradients` - Use of `BaseEstimator` and `BaseSampler` classes from Primitives for gradient evaluation - Demonstration of different methods for gradient evaluation - Application example: VQE - Solved using Estimator, Sampler, and classical optimizer (scipy.minimize) - More details on SPSA gradient and Qiskit Primitives can be added --------- Co-authored-by: Elena Peña Tapia <[email protected]>
…) (Qiskit/qiskit-tutorials#1463) <!--⚠️ If you do not respect this template, your pull request will be closed.⚠️ Your pull request title should be short detailed and understandable for all.⚠️ If your pull request fixes an open issue, please link to the issue. ✅ I have added the tests to cover my changes. ✅ I have updated the documentation accordingly. ✅ I have read the CONTRIBUTING document. --> ### Summary Fixes Qiskit/qiskit-tutorials#1390, Unitary Hack contribution. ### Details and comments - Updates the gradients tutorial from `opflow.gradients` to `algorithms.gradients` - Use of `BaseEstimator` and `BaseSampler` classes from Primitives for gradient evaluation - Demonstration of different methods for gradient evaluation - Application example: VQE - Solved using Estimator, Sampler, and classical optimizer (scipy.minimize) - More details on SPSA gradient and Qiskit Primitives can be added --------- Co-authored-by: Elena Peña Tapia <[email protected]>
The current gradient framework tutorial has not been updated to show the implementation using primitives. Aside from the refactoring, new gradients (classically efficient) have been added, and the whole framework has been moved from
qiskit.opflow
toqiskit.algorithms
. I believe that the TO-DO list here is:qiskit-tutorials/tutorials/operators
toqiskit-tutorials/tutorials/algorithms
You can explore the new gradient classes by navigating the API reference in:
As well as getting an introduction to the module in the gradients section of the opflow migration guide: https://qiskit.org/documentation/migration_guides/opflow_migration.html#gradients
Style guidelines:
Here are some references of the style of tutorial we are looking for
Make sure to follow the Qiskit documentation tutorial guidelines: https://qiskit.github.io/qiskit_sphinx_theme/tutorials/tutorials_guidelines.html
More examples for further reference: https://qiskit.github.io/qiskit_sphinx_theme/tutorials/tutorials_examples.html
The text was updated successfully, but these errors were encountered: