From 1bcfa75d514f27c6d02f49df8c960c3e24d10b6a Mon Sep 17 00:00:00 2001 From: Samuele Ferracin Date: Thu, 8 Aug 2024 15:08:04 -0400 Subject: [PATCH] Adding deprecation warnings for new noise learner format (#1848) * json * warnings * revert * 0.27.0 * release --- .../utils/noise_learner_result.py | 28 +++++++++++++++++++ release-notes/unreleased/1844.feat.rst | 1 + 2 files changed, 29 insertions(+) create mode 100644 release-notes/unreleased/1844.feat.rst diff --git a/qiskit_ibm_runtime/utils/noise_learner_result.py b/qiskit_ibm_runtime/utils/noise_learner_result.py index fe7549071..18191e93f 100644 --- a/qiskit_ibm_runtime/utils/noise_learner_result.py +++ b/qiskit_ibm_runtime/utils/noise_learner_result.py @@ -21,6 +21,8 @@ from qiskit.circuit import QuantumCircuit from qiskit.quantum_info import PauliList +from ..utils.deprecation import issue_deprecation_msg + class PauliLindbladError: r"""A Pauli error channel generated by a Pauli Lindblad dissipators. @@ -136,6 +138,32 @@ def error(self) -> PauliLindbladError: """ return self._error + @property + def generators(self) -> PauliList: + r""" + (DEPRECATED) The Pauli Lindblad generators of the error channel in this :class:`.~LayerError`. + """ + issue_deprecation_msg( + "The ``generators`` property is deprecated", + "0.27.0", + "Instead, you can access the generators through the ``error`` property.", + 1, + ) + return self.error.generators + + @property + def rates(self) -> NDArray[np.float64]: + r""" + (DEPRECATED) The Lindblad generator rates of the error channel in this :class:`.~LayerError`. + """ + issue_deprecation_msg( + "The ``rates`` property is deprecated", + "0.27.0", + "Instead, you can access the rates through the ``error`` property.", + 1, + ) + return self.error.rates + @property def num_qubits(self) -> int: r""" diff --git a/release-notes/unreleased/1844.feat.rst b/release-notes/unreleased/1844.feat.rst new file mode 100644 index 000000000..42c027e6c --- /dev/null +++ b/release-notes/unreleased/1844.feat.rst @@ -0,0 +1 @@ +Added ``PauliLindbladError`` and ``LayerError`` classes to represent layers noise processes. \ No newline at end of file