Skip to content

Commit 50fac49

Browse files
authored
Deprecate backend defaults (#2186)
* Deprecate backend defaults * Add release note * update deprecation msg
1 parent 7285a46 commit 50fac49

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

qiskit_ibm_runtime/fake_provider/fake_backend.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,22 @@ def properties(self, refresh: bool = False) -> BackendProperties:
168168
return BackendProperties.from_dict(self._props_dict)
169169

170170
def defaults(self, refresh: bool = False) -> PulseDefaults:
171-
"""Return the pulse defaults for the backend
171+
"""(DEPRECATED)Return the pulse defaults for the backend
172172
173173
Args:
174174
refresh: If ``True``, re-retrieve the backend defaults from the local file.
175175
176176
Returns:
177177
The backend pulse defaults or ``None`` if the backend does not support pulse.
178178
"""
179+
180+
issue_deprecation_msg(
181+
"The defaults method and the PulseDefaults class have been deprecated",
182+
"0.38.0",
183+
"IBM backends no longer support pulse gates and are no longer used to "
184+
"construct the backend target. ",
185+
)
186+
179187
if refresh or self._defs_dict is None:
180188
self._set_defs_dict_from_json()
181189
if self._defs_dict:

qiskit_ibm_runtime/ibm_backend.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def status(self) -> BackendStatus:
425425
) from ex
426426

427427
def defaults(self, refresh: bool = False) -> Optional[PulseDefaults]:
428-
"""Return the pulse defaults for the backend.
428+
"""(DEPRECATED) Return the pulse defaults for the backend.
429429
430430
The schema for default pulse configuration can be found in
431431
`Qiskit/ibm-quantum-schemas/default_pulse_configuration
@@ -438,6 +438,14 @@ def defaults(self, refresh: bool = False) -> Optional[PulseDefaults]:
438438
Returns:
439439
The backend pulse defaults or ``None`` if the backend does not support pulse.
440440
"""
441+
442+
issue_deprecation_msg(
443+
"The defaults method and the PulseDefaults class have been deprecated",
444+
"0.38.0",
445+
"IBM backends no longer support pulse gates and are no longer used to "
446+
"construct the backend target. ",
447+
)
448+
441449
if refresh or self._defaults is None:
442450
api_defaults = self._api_client.backend_pulse_defaults(self.name)
443451
if api_defaults:

qiskit_ibm_runtime/models/pulse_defaults.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ def from_dict(cls: Type[CommandT], data: Dict[str, Any]) -> CommandT:
158158

159159

160160
class PulseDefaults:
161-
"""Description of default settings for Pulse systems. These are instructions or settings that
162-
may be good starting points for the Pulse user. The user may modify these defaults for custom
163-
scheduling.
161+
"""(DEPRECATED) Description of default settings for Pulse systems.
162+
These are instructions or settings that may be good starting points for the Pulse user.
163+
The user may modify these defaults for custom scheduling.
164164
"""
165165

166166
_data: Dict[Any, Any] = {}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Since pulse gates are no longer supported, the :class:`IBMBackend` and :class:`FakeBackendV2` ``defaults()``
2+
method has been deprecated. Backend defaults are also no longer used to construct the backend target.

0 commit comments

Comments
 (0)