Qiskit / qiskit-tutorials

A collection of Jupyter notebooks showing how to use the Qiskit SDK
Apache License 2.0
2.31k stars 1.29k forks source link

grad_method fin_diff isn't computing the gradient #1340

Closed yvonnewu1324 closed 1 year ago

yvonnewu1324 commented 2 years ago

Informations

What is the current behavior?

I'm running 02_vqe_convergence.ipynb, and at the part of Using Gradient framework, it seems that the grad_method fin_diff isn't computing for the optimizer. I changed the grad_method to "param_shift" or "lin_comb" and it works fine.

截圖 2022-06-25 下午4 43 13 截圖 2022-06-25 下午4 43 35

Steps to reproduce the problem

run 02_vqe_convergence.ipynb.

What is the expected behavior?

grad_method fin_diff should compute the correct value as -1.85728.

ElePT commented 1 year ago

Hi thanks for your interest and apologies for the slow response! We are currently in the process of reorganising the Qiskit Tutorials, archiving this repo and moving the existing tutorials to the main qiskit repo or other appropriate projects.

In this case, the material mentioned in this issue has already been refactored and should not contain the mentioned bug, you can find it in its new project: https://github.com/qiskit-community/qiskit-algorithms/tree/main/docs/tutorials. Thanks anyway for your feedback and helping us make Qiskit better! 🚀