Skip to content

Commit

Permalink
fix(estimator): backend needs to be configurable and running on real …
Browse files Browse the repository at this point in the history
…machine should be synchronously
  • Loading branch information
Zhaoyilunnn committed Aug 13, 2024
1 parent b3baa61 commit 5c78be3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions quafu/algorithms/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ def __init__(
self._task = task
else:
self._task = Task()
self._task.config(backend=self._backend)
self._task.config(**task_options)
self._task.config(backend=self._backend, **task_options)

def _run_real_machine(self, observables: Hamiltonian):
"""Submit to quafu service"""
Expand Down
5 changes: 2 additions & 3 deletions quafu/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import copy
import logging
from typing import Dict, List, Optional, Tuple
Expand Down Expand Up @@ -171,7 +170,7 @@ def run(self, qc: QuantumCircuit, measure_base: List = None) -> ExecResult:
measure_base (list[str, list[int]]): measure base and its positions.
"""
if measure_base is None:
res = self.send(qc)
res = self.send(qc, wait=True)
res.measure_base = ""

else:
Expand All @@ -181,7 +180,7 @@ def run(self, qc: QuantumCircuit, measure_base: List = None) -> ExecResult:
elif base == "Y":
qc.rx(pos, np.pi / 2)

res = self.send(qc)
res = self.send(qc, wait=True)
res.measure_base = measure_base

return res
Expand Down

0 comments on commit 5c78be3

Please sign in to comment.