diff --git a/qiskit/providers/aer/backends/aerbackend.py b/qiskit/providers/aer/backends/aerbackend.py index 215c84fa6f..0fd4652704 100644 --- a/qiskit/providers/aer/backends/aerbackend.py +++ b/qiskit/providers/aer/backends/aerbackend.py @@ -84,6 +84,7 @@ def __init__(self, """ # Init configuration and provider in BaseBackend configuration.simulator = True + configuration.local = True super().__init__(configuration, provider=provider) # Initialize backend properties and pulse defaults. diff --git a/releasenotes/notes/config-local-46d47ae08eeab339.yaml b/releasenotes/notes/config-local-46d47ae08eeab339.yaml new file mode 100644 index 0000000000..658dbfef56 --- /dev/null +++ b/releasenotes/notes/config-local-46d47ae08eeab339.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes bug where creating a simulator from a backend would set the + ``local`` attribute of the configuration to the backend value + (typically ``False``) rather than always being set to ``True``. diff --git a/test/terra/backends/test_config_pulse_simulator.py b/test/terra/backends/test_config_pulse_simulator.py index 171ff48c5a..ed8059233c 100644 --- a/test/terra/backends/test_config_pulse_simulator.py +++ b/test/terra/backends/test_config_pulse_simulator.py @@ -54,7 +54,9 @@ def test_from_backend(self): desc = 'A Pulse-based simulator configured from the backend: fake_athens' self.assertEqual(sim_dict[key], desc) elif key == 'simulator': - self.assertTrue(sim_dict[key], True) + self.assertTrue(sim_dict[key]) + elif key == 'local': + self.assertTrue(sim_dict[key]) else: self.assertEqual(sim_dict[key], backend_dict[key])