Skip to content

Commit

Permalink
Use generic backend for testing (#1344)
Browse files Browse the repository at this point in the history
Running notebooks with the `FakeKyoto` backend was occassionally taking
a very long time (see
#1307 (comment)).
We believe this is due to some notebooks taking advantage of the large
number of qubits it supports.

This PR switches to Qiskit's `GenericBackendV2`. This should be much
faster and gives us more fine-grained control over the test backend
properties.
  • Loading branch information
frankharkins authored May 10, 2024
1 parent 6cb5ae2 commit b0902fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/nb-tester/qiskit_docs_notebook_tester/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
MOCKING_CODE = """\
import warnings
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit_ibm_runtime.fake_provider import FakeKyoto
from qiskit.providers.fake_provider import GenericBackendV2
def patched_least_busy(self, *args, **kwarg):
return FakeKyoto()
return GenericBackendV2(num_qubits=5, control_flow=True)
QiskitRuntimeService.least_busy = patched_least_busy
Expand Down Expand Up @@ -164,7 +164,7 @@ async def execute_notebook(path: Path, args: argparse.Namespace, config: Config)
"""
is_patched = not args.submit_jobs and matches(path, config.notebooks_that_submit_jobs)
if is_patched:
print(f"▶️ Executing {path} (with least_busy patched to return FakeKyoto)")
print(f"▶️ Executing {path} (with least_busy patched to return fake backend)")
else:
print(f"▶️ Executing {path}")
possible_exceptions = (
Expand Down

0 comments on commit b0902fa

Please sign in to comment.