Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions releasenotes/notes/fix-target-dt-4d306f1e9b07f819.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fixed an issue with test util :func:`~qiskit.test.mock.utils.convert_to_target`
in which ``dt`` was not being converted to seconds when reading from parameter
``conf_dict``.
Comment thread
kevinhartman marked this conversation as resolved.
Outdated
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