Skip to content

Commit

Permalink
Ensure evaluate_energy/gradient match
Browse files Browse the repository at this point in the history
Co-authored-by: Max Rossmannek <max.rossmannek@uzh.ch>
  • Loading branch information
declanmillar and mrossinek committed Sep 16, 2022
1 parent 00e4f7b commit 0620e04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qiskit/algorithms/minimum_eigensolvers/vqe.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ def _get_evalute_gradient(
def evaluate_gradient(parameters):
# broadcasting not required for the estimator gradients
try:
result = self.gradient.run([ansatz], [operator], [parameters]).result()
gradients = result.gradients
job = self.gradient.run([ansatz], [operator], [parameters])
gradients = job.result().gradients
except Exception as exc:
raise AlgorithmError("The primitive job to evaluate the gradient failed!") from exc

Expand Down

0 comments on commit 0620e04

Please sign in to comment.