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

Deprecation of algorithm utils (algorithm_globals and validation) #10905

Merged
merged 9 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
16 changes: 4 additions & 12 deletions qiskit/utils/algorithm_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ def random_seed(self, seed: Optional[int]) -> None:
@property
@deprecate_func(
additional_msg=(
"This algorithm utility has been migrated to an independent package: "
"https://github.com/qiskit-community/qiskit-algorithms. You can run "
"``pip install qiskit_algorithms`` and import ``from qiskit_algorithms.utils`` instead. "
"This algorithm utility belongs to a legacy workflow and has no replacement."
),
since="0.45.0",
is_property=True,
Expand All @@ -96,9 +94,7 @@ def num_processes(self) -> int:
@num_processes.setter
@deprecate_func(
additional_msg=(
"This algorithm utility has been migrated to an independent package: "
"https://github.com/qiskit-community/qiskit-algorithms. You can run "
"``pip install qiskit_algorithms`` and import ``from qiskit_algorithms.utils`` instead. "
"This algorithm utility belongs to a legacy workflow and has no replacement."
),
since="0.45.0",
is_property=True,
Expand Down Expand Up @@ -148,9 +144,7 @@ def random(self) -> np.random.Generator:
@property
@deprecate_func(
additional_msg=(
"This algorithm utility has been migrated to an independent package: "
"https://github.com/qiskit-community/qiskit-algorithms. You can run "
"``pip install qiskit_algorithms`` and import ``from qiskit_algorithms.utils`` instead. "
"This algorithm utility belongs to a legacy workflow and has no replacement."
),
since="0.45.0",
is_property=True,
Expand All @@ -162,9 +156,7 @@ def massive(self) -> bool:
@massive.setter
@deprecate_func(
additional_msg=(
"This algorithm utility has been migrated to an independent package: "
"https://github.com/qiskit-community/qiskit-algorithms. You can run "
"``pip install qiskit_algorithms`` and import ``from qiskit_algorithms.utils`` instead. "
"This algorithm utility belongs to a legacy workflow and has no replacement."
),
since="0.45.0",
is_property=True,
Expand Down
15 changes: 10 additions & 5 deletions releasenotes/notes/deprecate-algorithm-utils-6cdc5856015a7e65.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
deprecations:
- |
The algorithm utils in ``qiskit.utils.validation`` and ``qiskit.utils.algorithm_globals``
are now deprecated and will be removed from the codebase in no less than 3 months from
the release date. These have been migrated to the ``qiskit_algorithms`` standalone
`library <https://github.com/qiskit-community/qiskit-algorithms>`_, and can instead be
imported from ``qiskit_algorithms.utils``.

are now deprecated and will be removed in no less than 3 months from the release date.
These utils were introduced with the ``qiskit.algorithms`` module to support
legacy and primitive-based algorithm workflows. Now that ``qiskit.algorithms`` is deprecated
and the primitive-based algorithms codebase has been migrated to a standalone
`library <https://github.com/qiskit-community/qiskit-algorithms>`_, these utils are no
longer used in the context of Qiskit. If your application allows it, we recommend that
you migrate your code to use ``qiskit_algorithms``, where you will be able to import
the relevant utilities in ``algorithm_globals`` and ``validation`` from
``qiskit_algorithms.utils``. Please note than legacy functionality has not been migrated
to the new package.