Skip to content

Commit

Permalink
fix bugs in example of EstimatorV2 (Qiskit#12326)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorii authored May 2, 2024
1 parent 676a5ed commit cadc6f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qiskit/primitives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@
estimator = Estimator()
# calculate [ <psi1(theta1)|H1|psi1(theta1)> ]
job = estimator.run([(psi1, hamiltonian1, [theta1])])
job = estimator.run([(psi1, H1, [theta1])])
job_result = job.result() # It will block until the job finishes.
print(f"The primitive-job finished with result {job_result}"))
print(f"The primitive-job finished with result {job_result}")
# calculate [ [<psi1(theta1)|H1|psi1(theta1)>,
# <psi1(theta3)|H3|psi1(theta3)>],
# [<psi2(theta2)|H2|psi2(theta2)>] ]
job2 = estimator.run(
[
(psi1, [hamiltonian1, hamiltonian3], [theta1, theta3]),
(psi2, hamiltonian2, theta2)
(psi1, [H1, H3], [theta1, theta3]),
(psi2, H2, theta2)
],
precision=0.01
)
Expand Down

0 comments on commit cadc6f1

Please sign in to comment.