Skip to content

Commit

Permalink
deprecate primitives V1
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorii committed Aug 22, 2024
1 parent c5a285b commit 16f845e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qiskit_aer/primitives/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
*,
Expand Down
5 changes: 5 additions & 0 deletions qiskit_aer/primitives/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
*,
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 16f845e

Please sign in to comment.