Skip to content

Commit

Permalink
another unnecessary catch from aer
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Jul 24, 2024
1 parent a761b2d commit 264f2af
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions qiskit/primitives/backend_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from __future__ import annotations

import warnings
from collections.abc import Sequence
from itertools import accumulate

Expand Down Expand Up @@ -68,17 +67,14 @@ def _run_circuits(
max_circuits = backend.max_circuits
else:
raise RuntimeError("Backend version not supported")
with warnings.catch_warnings():
# TODO remove this catch once Aer stops using QobjDictField
warnings.filterwarnings("ignore", category=DeprecationWarning, module="qiskit")
if max_circuits:
jobs = [
backend.run(circuits[pos : pos + max_circuits], **run_options)
for pos in range(0, len(circuits), max_circuits)
]
result = [x.result() for x in jobs]
else:
result = [backend.run(circuits, **run_options).result()]
if max_circuits:
jobs = [
backend.run(circuits[pos : pos + max_circuits], **run_options)
for pos in range(0, len(circuits), max_circuits)
]
result = [x.result() for x in jobs]
else:
result = [backend.run(circuits, **run_options).result()]
return result, metadata


Expand Down

0 comments on commit 264f2af

Please sign in to comment.