From d01b07dd24ac21bbfba00fa34cdaf7a239b68ba0 Mon Sep 17 00:00:00 2001 From: Kevin Tian Date: Wed, 28 Aug 2024 08:44:15 -0400 Subject: [PATCH] Deprecate simulator `noise_model` option (#1892) * Deprecate simulator noise model option * Add release note --- qiskit_ibm_runtime/base_primitive.py | 10 ++++++++++ release-notes/unreleased/1892.deprecation.rst | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 release-notes/unreleased/1892.deprecation.rst diff --git a/qiskit_ibm_runtime/base_primitive.py b/qiskit_ibm_runtime/base_primitive.py index 1cf7da14f..fb90cc1ec 100644 --- a/qiskit_ibm_runtime/base_primitive.py +++ b/qiskit_ibm_runtime/base_primitive.py @@ -172,6 +172,16 @@ def _run(self, pubs: Union[list[EstimatorPub], list[SamplerPub]]) -> RuntimeJobV logger.info("Submitting job using options %s", primitive_options) + if not isinstance(self._service, QiskitRuntimeLocalService): + if primitive_options.get("options", {}).get("simulator", {}).get("noise_model"): + issue_deprecation_msg( + msg="The noise_model option is deprecated", + version="0.29.0", + remedy="Use the local testing mode instead.", + period="3 months", + stacklevel=3, + ) + # Batch or Session if self._mode: return self._mode.run( diff --git a/release-notes/unreleased/1892.deprecation.rst b/release-notes/unreleased/1892.deprecation.rst new file mode 100644 index 000000000..7ef717638 --- /dev/null +++ b/release-notes/unreleased/1892.deprecation.rst @@ -0,0 +1,2 @@ +The simulator option ``noise_model`` is now deprecated for jobs running on real devices. +``noise_model`` will still be an acceptable option when using the local testing mode. \ No newline at end of file