Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate PrimitivesV1 reference implementations and their utils #12575

Merged
merged 25 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
48e7182
Deprecate V1 Primitives and their utils
LeanderCS Jun 13, 2024
6f7d158
Fix tests
LeanderCS Jun 13, 2024
24c4609
Fix yaml error
LeanderCS Jun 13, 2024
3678783
Fix build
LeanderCS Jun 13, 2024
594b7d9
Merge branch 'main' into deprecate-primitives-v1
LeanderCS Jun 14, 2024
49e35bf
Merge branch 'main' into deprecate-primitives-v1
LeanderCS Jun 22, 2024
9e03a86
Fix error after mc
LeanderCS Jun 23, 2024
c349353
Fix error after mc
LeanderCS Jun 24, 2024
e81e86f
Apply comments
LeanderCS Jun 24, 2024
71ad3fb
Use correct deprecate version for warning message
LeanderCS Jun 25, 2024
620707e
Update deprecation messages
LeanderCS Jul 4, 2024
e3e0f54
Add missed ``
LeanderCS Jul 4, 2024
143960f
update releasenote
t-imamichi Jul 5, 2024
fbc65dd
Merge branch 'main' into deprecate-primitives-v1
t-imamichi Jul 5, 2024
c0103f7
Deprecate SamplerResult and EstimatorResult
LeanderCS Jul 8, 2024
e7094eb
fix deprecation warning for SamplerResult and EstimatorResult
t-imamichi Jul 9, 2024
94486dd
apply review comments
t-imamichi Jul 16, 2024
4ca4f77
Merge branch 'main' into deprecate-primitives-v1
t-imamichi Jul 17, 2024
696a196
Applying the agreement of deprecations.
t-imamichi Jul 24, 2024
0b66c6a
revert SamplerResult, EstimatorResult, and BasePrimitiveResult
t-imamichi Jul 24, 2024
17c34b4
fix test_backend_sampler
t-imamichi Jul 24, 2024
593e751
revert tox.ini
t-imamichi Jul 24, 2024
02a288f
revise deprecation warning for BaseSampler and BaseEstimator
t-imamichi Jul 25, 2024
4de78e2
update reno
t-imamichi Jul 25, 2024
3704f35
revert BaseSampler and BaseEstimator
t-imamichi Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qiskit/primitives/base/base_primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class BasePrimitive(ABC):
"""Primitive abstract base class."""

@deprecate_func(since="1.2", additional_msg="Use BasePrimitiveV2 instead.")
@deprecate_func(since="1.2", additional_msg="Use BaseSamplerV2 or BaseEstimatorV2 instead.")
def __init__(self, options: dict | None = None):
self._run_options = Options()
if options is not None:
Expand Down
2 changes: 1 addition & 1 deletion qiskit/primitives/base/base_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __post_init__(self) -> None:
warn(
"The class ``BasePrimitiveResult`` is deprecated as of qiskit 1.2. "
"It will be removed no earlier than 3 months after the release date. "
"Use PrimitiveResult class in `qiskit.primitives.containers` instead.",
"Use ``PrimitiveResult`` class in ``qiskit.primitives.containers` instead.",
DeprecationWarning,
)

Expand Down
15 changes: 12 additions & 3 deletions qiskit/primitives/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
from qiskit.utils.deprecation import deprecate_func


@deprecate_func(since="1.2", additional_msg="There is no replacement for this.")
@deprecate_func(
since="1.2",
additional_msg="There is no replacement for this. Please adjust your code accordingly and use the new utils.",
)
def init_circuit(state: QuantumCircuit | Statevector) -> QuantumCircuit:
"""Initialize state by converting the input to a quantum circuit.

Expand All @@ -47,7 +50,10 @@ def init_circuit(state: QuantumCircuit | Statevector) -> QuantumCircuit:
return qc


@deprecate_func(since="1.2", additional_msg="There is no replacement for this.")
@deprecate_func(
since="1.2",
additional_msg="There is no replacement for this. Please adjust your code accordingly and use the new utils.",
)
def init_observable(observable: BaseOperator | str) -> SparsePauliOp:
"""Initialize observable by converting the input to a :class:`~qiskit.quantum_info.SparsePauliOp`.

Expand All @@ -71,7 +77,10 @@ def init_observable(observable: BaseOperator | str) -> SparsePauliOp:
return SparsePauliOp(observable)


@deprecate_func(since="1.2", additional_msg="There is no replacement for this.")
@deprecate_func(
since="1.2",
additional_msg="There is no replacement for this. Please adjust your code accordingly and use the new utils.",
)
def final_measurement_mapping(circuit: QuantumCircuit) -> dict[int, int]:
"""Return the final measurement mapping for the circuit.

Expand Down
Loading