You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2021. It is now read-only.
I would like to change the VQE callback to the below, to allow one to access an accurate picture of the evaluation steps, and to distinguish between single energy and gradient evaluations. Right now we call the callback once for each energy calculated, so a 16-energy gradient calculation is not distinguishable to the callback from a single-energy evaluation. The code below calls the callback with a list of parameters, energies, and stds for all of the evaluations in that call to _energy_evaluation. This has caused me trouble in the past and I've been asked several times now to group this information in this way. This is a breaking change, to any existing callback usage, unless we can think of a way otherwise.
if self._callback is not None:
self._callback(self._eval_count, parameter_sets, means, stds)
Right now we do:
for i, param_set in enumerate(parameter_sets):
self._eval_count += 1
self._callback(self._eval_count, param_set, means[i], stds[i])
The text was updated successfully, but these errors were encountered:
I am not sure how that solves the problem - the issue is the optimizer using the same callback to compute the next point on the curve via gradient or whatever. Normally only one parameter set (point) is passed in at once, and even when grouped (which is not default) they are done so in order to potentially allow more parallellization on a simulator and the groupings are most likely just part of a gradient too, i.e. a subset of the set of points of the gradient computation.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Uh oh!
There was an error while loading. Please reload this page.
I would like to change the VQE callback to the below, to allow one to access an accurate picture of the evaluation steps, and to distinguish between single energy and gradient evaluations. Right now we call the callback once for each energy calculated, so a 16-energy gradient calculation is not distinguishable to the callback from a single-energy evaluation. The code below calls the callback with a list of parameters, energies, and stds for all of the evaluations in that call to _energy_evaluation. This has caused me trouble in the past and I've been asked several times now to group this information in this way. This is a breaking change, to any existing callback usage, unless we can think of a way otherwise.
Right now we do:
The text was updated successfully, but these errors were encountered: