Skip to content

Commit

Permalink
minor: add a todo in estimator implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaoyilunnn committed Sep 16, 2023
1 parent 5ca8027 commit f4a4e8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quafu/algorithms/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def _run_real_machine(self, observables: Hamiltonian):
"""Submit to quafu service"""
if not isinstance(self._task, Task):
raise ValueError("task not set")
# TODO(zhaoyilun): replace old `submit` API in the future,
# investigate the best implementation for calculating
# expectation on real devices.
obs = observables.to_legacy_quafu_pauli_list()
_, obsexp = self._task.submit(self._circ, obs)
return sum(obsexp)
Expand Down

0 comments on commit f4a4e8e

Please sign in to comment.