Skip to content
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

VQE documentation return value cost function change #22

Closed
L-git-tech opened this issue Jan 4, 2021 · 0 comments
Closed

VQE documentation return value cost function change #22

L-git-tech opened this issue Jan 4, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@L-git-tech
Copy link
Collaborator

In the documentation, subchapter "Define VQE cost function" (http://docs.qulacs.org/en/latest/apply/6.2_vqe.html#Define-VQE-cost-function) the return value of the cost function should be np.real(qulacs_hamiltonian.get_expectation_value(state))
instead of qulacs_hamiltonian.get_expectation_value(state).
This is because of the scipy.optimize.minimize function in http://docs.qulacs.org/en/latest/apply/6.2_vqe.html#Run-VQE, which expects a cost function returning a float number.

@L-git-tech L-git-tech added the documentation Improvements or additions to documentation label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant