Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qiskit/test/mock/utils/backend_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def convert_to_target(conf_dict: dict, props_dict: dict = None, defs_dict: dict
# parse global configuration properties
dt = conf_dict.get("dt")
if dt:
target.dt = dt
target.dt = dt * 1e-9
if "timing_constraints" in conf_dict:
target.granularity = conf_dict["timing_constraints"].get("granularity")
target.min_length = conf_dict["timing_constraints"].get("min_length")
Expand Down
8 changes: 8 additions & 0 deletions releasenotes/notes/fix-target-dt-4d306f1e9b07f819.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixed an issue with :class:`~.BackendV2` based fake backend classes from the
``qiskit.providers.fake_provider`` module such as ``FakeMontrealV2`` where the
value for the :attr:`~.BackendV2.dt` attribute (and the :attr:`.Target.dt` attribute)
were not properly being converted to seconds. This would cause issues when
using these fake backends with scheduling.
6 changes: 6 additions & 0 deletions test/python/providers/test_fake_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ def test_to_dict_properties(self, backend):
else:
self.assertTrue(backend.configuration().simulator)

@data(*FAKE_PROVIDER_FOR_BACKEND_V2.backends())
def test_convert_to_target(self, backend):
target = backend.target
if target.dt is not None:
self.assertLess(target.dt, 1e-6)
Comment thread
kevinhartman marked this conversation as resolved.

@data(*FAKE_PROVIDER.backends())
def test_to_dict_configuration(self, backend):
configuration = backend.configuration()
Expand Down