|
10 | 10 | # copyright notice, and modified files need to carry a notice indicating |
11 | 11 | # that they have been altered from the originals. |
12 | 12 |
|
13 | | -r"""Base Estimator Classes""" |
| 13 | +"""Base Estimator Classes""" |
14 | 14 |
|
15 | 15 | from __future__ import annotations |
16 | 16 |
|
|
23 | 23 | from qiskit.providers import JobV1 as Job |
24 | 24 | from qiskit.quantum_info.operators import SparsePauliOp |
25 | 25 | from qiskit.quantum_info.operators.base_operator import BaseOperator |
| 26 | +from qiskit.utils.deprecation import deprecate_func |
26 | 27 |
|
27 | 28 | from ..containers import ( |
28 | 29 | DataBin, |
@@ -187,7 +188,26 @@ def _run( |
187 | 188 | raise NotImplementedError("The subclass of BaseEstimator must implement `_run` method.") |
188 | 189 |
|
189 | 190 |
|
190 | | -BaseEstimator = BaseEstimatorV1 |
| 191 | +class BaseEstimator(BaseEstimatorV1[T]): |
| 192 | + """DEPRECATED. Type alias of Estimator V1 base class. |
| 193 | +
|
| 194 | + See :class:`.BaseEstimatorV1` for details. |
| 195 | + """ |
| 196 | + |
| 197 | + @deprecate_func(since="1.2", additional_msg="Use BaseEstimatorV2 instead.") |
| 198 | + def __init__( |
| 199 | + self, |
| 200 | + *, |
| 201 | + options: dict | None = None, |
| 202 | + ): |
| 203 | + """ |
| 204 | + Creating an instance of an Estimator, or using one in a ``with`` context opens a session that |
| 205 | + holds resources until the instance is ``close()`` ed or the context is exited. |
| 206 | +
|
| 207 | + Args: |
| 208 | + options: Default options. |
| 209 | + """ |
| 210 | + super().__init__(options=options) |
191 | 211 |
|
192 | 212 |
|
193 | 213 | class BaseEstimatorV2(ABC): |
|
0 commit comments