Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Fix scheduler unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Feb 20, 2024
1 parent 4537952 commit ea45b1b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/unit/transpiler/passes/scheduling/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
from qiskit.transpiler.passmanager import PassManager
from qiskit.transpiler.exceptions import TranspilerError

try:
from qiskit.providers.fake_provider import Fake7QPulseV1
except ImportError:
from qiskit.providers.fake_provider import FakeJakarta as Fake7QPulseV1
from qiskit_ibm_runtime.fake_provider import FakeJakarta

from qiskit_ibm_provider.transpiler.passes.scheduling.pad_delay import PadDelay
from qiskit_ibm_provider.transpiler.passes.scheduling.scheduler import (
Expand Down Expand Up @@ -850,12 +847,12 @@ def test_c_if_plugin_conversion_with_transpile(self):
after transpilation with the plugin."""
# Patch the test backend with the plugin
with patch.object(
Fake7QPulseV1,
FakeJakarta,
"get_translation_stage_plugin",
return_value="ibm_dynamic_circuits",
create=True,
):
backend = Fake7QPulseV1()
backend = FakeJakarta()
# Temporary workaround for mock backends. For real backends this is not required.
backend.configuration().basis_gates.append("if_else")

Expand Down Expand Up @@ -1867,7 +1864,7 @@ def test_for_loop(self):

def test_transpile_mock_backend(self):
"""Test scheduling works with transpilation."""
backend = Fake7QPulseV1()
backend = FakeJakarta()
# Temporary workaround for mock backends. For real backends this is not required.
backend.configuration().basis_gates.append("if_else")
backend.configuration().basis_gates.append("while_loop")
Expand Down Expand Up @@ -1915,7 +1912,7 @@ def test_transpile_mock_backend(self):

def test_transpile_both_paths(self):
"""Test scheduling works with both fast- and standard path after transpiling."""
backend = Fake7QPulseV1()
backend = FakeJakarta()
# Temporary workaround for mock backends. For real backends this is not required.
backend.configuration().basis_gates.append("if_else")

Expand Down Expand Up @@ -1957,12 +1954,12 @@ def test_c_if_plugin_conversion_with_transpile(self):
transpilation with the plugin."""
# Patch the test backend with the plugin
with patch.object(
Fake7QPulseV1,
FakeJakarta,
"get_translation_stage_plugin",
return_value="ibm_dynamic_circuits",
create=True,
):
backend = Fake7QPulseV1()
backend = FakeJakarta()
# Temporary workaround for mock backends. For real backends this is not required.
backend.configuration().basis_gates.append("if_else")

Expand Down

0 comments on commit ea45b1b

Please sign in to comment.