From 16f845ebdb91ba855d2817d8d09082c2b4829864 Mon Sep 17 00:00:00 2001 From: Hiroshi Horii Date: Thu, 22 Aug 2024 19:15:42 +0900 Subject: [PATCH] deprecate primitives V1 --- qiskit_aer/primitives/estimator.py | 4 ++++ qiskit_aer/primitives/sampler.py | 5 +++++ .../notes/deprecate_primitives_v1-97e89e7809c3ef9d.yaml | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/deprecate_primitives_v1-97e89e7809c3ef9d.yaml diff --git a/qiskit_aer/primitives/estimator.py b/qiskit_aer/primitives/estimator.py index 139ea17869..402dead492 100644 --- a/qiskit_aer/primitives/estimator.py +++ b/qiskit_aer/primitives/estimator.py @@ -75,6 +75,10 @@ class Estimator(BaseEstimator): normal distribution approximation. """ + @deprecate_func( + since="1.5", + additional_msg="Estimator(V1) has been deprecated in favor of EstimatorV2.", + ) def __init__( self, *, diff --git a/qiskit_aer/primitives/sampler.py b/qiskit_aer/primitives/sampler.py index 7a97a9c4c8..a89d0f0c5d 100644 --- a/qiskit_aer/primitives/sampler.py +++ b/qiskit_aer/primitives/sampler.py @@ -25,6 +25,7 @@ from qiskit.primitives import BaseSamplerV1, SamplerResult from qiskit.primitives.utils import final_measurement_mapping, init_circuit from qiskit.result import QuasiDistribution +from qiskit.utils.deprecation import deprecate_func from .. import AerSimulator @@ -51,6 +52,10 @@ class Sampler(BaseSamplerV1): 4. default. """ + @deprecate_func( + since="1.5", + additional_msg="Sampler(V1) has been deprecated in favor of SamplerV2.", + ) def __init__( self, *, diff --git a/releasenotes/notes/deprecate_primitives_v1-97e89e7809c3ef9d.yaml b/releasenotes/notes/deprecate_primitives_v1-97e89e7809c3ef9d.yaml new file mode 100644 index 0000000000..1bb530d012 --- /dev/null +++ b/releasenotes/notes/deprecate_primitives_v1-97e89e7809c3ef9d.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + Primitives V1 (``Sampler`` and ``Estimator`` in `qiskit_aer.primitives` + has been deprecated and ``SamplerV2`` and ``EstimatorV2`` are recommended + as their successors.