From 2a96ff075b77db2eee6c5d1952e367d326778103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 23 Oct 2023 13:48:52 +0200 Subject: [PATCH] Remove references from docs --- docs/apidoc/algorithms.rst | 6 ------ docs/apidoc/index.rst | 1 - docs/migration_guides/algorithms_migration.rst | 14 +++++++------- docs/migration_guides/opflow_migration.rst | 4 ++-- qiskit/primitives/backend_estimator.py | 3 +-- qiskit/primitives/backend_sampler.py | 3 +-- qiskit/providers/__init__.py | 6 +++--- qiskit/transpiler/synthesis/aqc/aqc.py | 2 +- qiskit/transpiler/synthesis/aqc/aqc_plugin.py | 2 +- qiskit/utils/__init__.py | 5 ++--- qiskit/utils/mitigation/__init__.py | 2 +- .../notes/0.17/prepare-0.17-2ab9429b69e1d25c.yaml | 4 ++-- .../requirements-updates-6059950dfde3cef6.yaml | 2 +- ...eadout-mitigation-classes-2ef175e232d791ae.yaml | 10 +++++----- .../0.20/fix-algorithms-7f1b969e5b2447f9.yaml | 2 +- .../notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml | 2 +- .../notes/0.22/prepare-0.22-118e15de86d36072.yaml | 2 +- ...oject-dynamics-primitives-6003336d0866ca19.yaml | 2 +- ...actorizers-linear-solvers-4631870129749624.yaml | 2 +- .../deprecate-algorithms-7149dee2da586549.yaml | 8 ++++---- test/python/transpiler/aqc/test_aqc.py | 3 ++- test/python/transpiler/aqc/test_aqc_plugin.py | 2 +- 22 files changed, 39 insertions(+), 48 deletions(-) delete mode 100644 docs/apidoc/algorithms.rst diff --git a/docs/apidoc/algorithms.rst b/docs/apidoc/algorithms.rst deleted file mode 100644 index 25d1bd4a412b..000000000000 --- a/docs/apidoc/algorithms.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. _qiskit-algorithms: - -.. automodule:: qiskit.algorithms - :no-members: - :no-inherited-members: - :no-special-members: diff --git a/docs/apidoc/index.rst b/docs/apidoc/index.rst index 60c30286fa8c..e957cabb12f3 100644 --- a/docs/apidoc/index.rst +++ b/docs/apidoc/index.rst @@ -57,5 +57,4 @@ Deprecated Modules .. toctree:: :maxdepth: 1 - algorithms opflow diff --git a/docs/migration_guides/algorithms_migration.rst b/docs/migration_guides/algorithms_migration.rst index b7b7ccb11380..eead3c500da7 100644 --- a/docs/migration_guides/algorithms_migration.rst +++ b/docs/migration_guides/algorithms_migration.rst @@ -5,7 +5,7 @@ Algorithms Migration Guide TL;DR ===== -The :mod:`qiskit.algorithms` module has been fully refactored to use the :mod:`~qiskit.primitives`, for circuit execution, instead of the :class:`~qiskit.utils.QuantumInstance`, which is now deprecated. +The ``qiskit.algorithms`` module has been fully refactored to use the :mod:`~qiskit.primitives`, for circuit execution, instead of the :class:`~qiskit.utils.QuantumInstance`, which is now deprecated. There have been **3 types of refactoring**: @@ -15,7 +15,7 @@ There have been **3 types of refactoring**: .. attention:: **Careful with import paths!!** The legacy algorithms are still importable directly from - :mod:`qiskit.algorithms`. Until the legacy imports are removed, this convenience import is not available + ``qiskit.algorithms``. Until the legacy imports are removed, this convenience import is not available for the refactored algorithms. Thus, to import the refactored algorithms you must always **specify the full import path** (e.g., ``from qiskit.algorithms.eigensolvers import VQD``) @@ -31,7 +31,7 @@ There have been **3 types of refactoring**: - `Phase Estimators`_ -3. Algorithms that were deprecated and are now removed entirely from :mod:`qiskit.algorithms`. These are algorithms that do not currently serve +3. Algorithms that were deprecated and are now removed entirely from ``qiskit.algorithms``. These are algorithms that do not currently serve as building blocks for applications. Their main value is educational, and as such, will be kept as tutorials in the qiskit textbook. You can consult the tutorials in the following links: @@ -40,18 +40,18 @@ There have been **3 types of refactoring**: The remainder of this migration guide will focus on the algorithms with migration alternatives within -:mod:`qiskit.algorithms`, that is, those under refactoring types 1 and 2. +``qiskit.algorithms``, that is, those under refactoring types 1 and 2. Background ========== *Back to* `TL;DR`_ -The :mod:`qiskit.algorithms` module was originally built on top of the :mod:`qiskit.opflow` library and the +The ``qiskit.algorithms`` module was originally built on top of the :mod:`qiskit.opflow` library and the :class:`~qiskit.utils.QuantumInstance` utility. The development of the :mod:`~qiskit.primitives` introduced a higher-level execution paradigm, with the ``Estimator`` for computation of expectation values for observables, and ``Sampler`` for executing circuits and returning probability -distributions. These tools allowed to refactor the :mod:`qiskit.algorithms` module, and deprecate both +distributions. These tools allowed to refactor the ``qiskit.algorithms`` module, and deprecate both :mod:`qiskit.opflow` and :class:`~qiskit.utils.QuantumInstance`. .. attention:: @@ -75,7 +75,7 @@ How to choose a primitive configuration for your algorithm *Back to* `TL;DR`_ The classes in -:mod:`qiskit.algorithms` are initialized with any implementation of :class:`qiskit.primitive.BaseSampler` or class:`qiskit.primitive.BaseEstimator`. +``qiskit.algorithms`` are initialized with any implementation of :class:`qiskit.primitive.BaseSampler` or class:`qiskit.primitive.BaseEstimator`. Once the kind of primitive is known, you can choose between the primitive implementations that better adjust to your case. For example: diff --git a/docs/migration_guides/opflow_migration.rst b/docs/migration_guides/opflow_migration.rst index 3d0f7fa67d22..020a172a5342 100644 --- a/docs/migration_guides/opflow_migration.rst +++ b/docs/migration_guides/opflow_migration.rst @@ -458,7 +458,7 @@ are used "under the hood" in the original code: - :class:`~qiskit.quantum_info.Operator` * - :class:`~qiskit.opflow.primitive_ops.PauliOp` - - :class:`~qiskit.quantum_info.Pauli`. For direct compatibility with classes in :mod:`qiskit.algorithms`, + - :class:`~qiskit.quantum_info.Pauli`. For direct compatibility with classes in ``qiskit.algorithms``, wrap in :class:`~qiskit.quantum_info.SparsePauliOp`. * - :class:`~qiskit.opflow.primitive_ops.PauliSumOp` @@ -1410,7 +1410,7 @@ Gradients The opflow :mod:`~qiskit.opflow.gradients` framework has been replaced by the new :mod:`qiskit.algorithms.gradients` module. The new gradients are **primitive-based subroutines** commonly used by algorithms and applications, which -can also be executed in a standalone manner. For this reason, they now reside under :mod:`qiskit.algorithms`. +can also be executed in a standalone manner. For this reason, they now reside under ``qiskit.algorithms``. The former gradient framework contained base classes, converters and derivatives. The "derivatives" followed a factory design pattern, where different methods could be provided via string identifiers diff --git a/qiskit/primitives/backend_estimator.py b/qiskit/primitives/backend_estimator.py index 2ffe5bb7a989..9e0303ac0b4e 100644 --- a/qiskit/primitives/backend_estimator.py +++ b/qiskit/primitives/backend_estimator.py @@ -98,8 +98,7 @@ class BackendEstimator(BaseEstimator[PrimitiveJob[EstimatorResult]]): (or :class:`~.BackendV1`) object in the :class:`~.BaseEstimator` API. It facilitates using backends that do not provide a native :class:`~.BaseEstimator` implementation in places that work with - :class:`~.BaseEstimator`, such as algorithms in :mod:`qiskit.algorithms` - including :class:`~.qiskit.algorithms.minimum_eigensolvers.VQE`. However, + :class:`~.BaseEstimator`. However, if you're using a provider that has a native implementation of :class:`~.BaseEstimator`, it is a better choice to leverage that native implementation as it will likely include additional optimizations and be diff --git a/qiskit/primitives/backend_sampler.py b/qiskit/primitives/backend_sampler.py index 6510b981b68a..145f3a21aaa2 100644 --- a/qiskit/primitives/backend_sampler.py +++ b/qiskit/primitives/backend_sampler.py @@ -38,8 +38,7 @@ class BackendSampler(BaseSampler[PrimitiveJob[SamplerResult]]): any measurement mitigation, it just computes the probability distribution from the counts. It facilitates using backends that do not provide a native :class:`~.BaseSampler` implementation in places that work with - :class:`~.BaseSampler`, such as algorithms in :mod:`qiskit.algorithms` - including :class:`~.qiskit.algorithms.minimum_eigensolvers.SamplingVQE`. + :class:`~.BaseSampler`. However, if you're using a provider that has a native implementation of :class:`~.BaseSampler`, it is a better choice to leverage that native implementation as it will likely include additional optimizations and be diff --git a/qiskit/providers/__init__.py b/qiskit/providers/__init__.py index d7ec4b21b9fe..dc63b6df705f 100644 --- a/qiskit/providers/__init__.py +++ b/qiskit/providers/__init__.py @@ -144,8 +144,8 @@ backend. It also provides the :meth:`~qiskit.providers.BackendV2.run` method which can run the :class:`~qiskit.circuit.QuantumCircuit` objects and/or :class:`~qiskit.pulse.Schedule` objects. This enables users and other Qiskit -APIs, such as :func:`~qiskit.execute_function.execute` and higher level algorithms in -:mod:`qiskit.algorithms`, to get results from executing circuits on devices in a standard +APIs, such as :func:`~qiskit.execute_function.execute` to get results from +executing circuits on devices in a standard fashion regardless of how the backend is implemented. At a high level the basic steps for writing a provider are: @@ -635,7 +635,7 @@ def status(self): provider-specific :class:`~.Sampler` implementation that leverages the ``M3Mitigation`` class internally to run the circuits and return quasi-probabilities directly from mthree in the result. Doing this would -enable algorithms from :mod:`qiskit.algorithms` to get the best results with +enable algorithms to get the best results with mitigation applied directly from your backends. You can refer to the documentation in :mod:`qiskit.primitives` on how to write custom implementations. Also the built-in implementations: :class:`~.Sampler`, diff --git a/qiskit/transpiler/synthesis/aqc/aqc.py b/qiskit/transpiler/synthesis/aqc/aqc.py index f934a04bd7e7..c0c7170f2624 100644 --- a/qiskit/transpiler/synthesis/aqc/aqc.py +++ b/qiskit/transpiler/synthesis/aqc/aqc.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2022. +# (C) Copyright IBM 2022, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory diff --git a/qiskit/transpiler/synthesis/aqc/aqc_plugin.py b/qiskit/transpiler/synthesis/aqc/aqc_plugin.py index c5984276969b..93403a64f81c 100644 --- a/qiskit/transpiler/synthesis/aqc/aqc_plugin.py +++ b/qiskit/transpiler/synthesis/aqc/aqc_plugin.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2021, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory diff --git a/qiskit/utils/__init__.py b/qiskit/utils/__init__.py index 789b8c0da9b0..45200413ba2a 100644 --- a/qiskit/utils/__init__.py +++ b/qiskit/utils/__init__.py @@ -48,9 +48,8 @@ A QuantumInstance holds the Qiskit `backend` as well as a number of compile and runtime parameters controlling circuit compilation and execution. Quantum -:mod:`algorithms ` -are run on a device or simulator by passing a QuantumInstance setup with the desired -backend etc. +algorithms are run on a device or simulator by passing a QuantumInstance setup +with the desired backend etc. Optional Dependency Checkers (:mod:`qiskit.utils.optionals`) diff --git a/qiskit/utils/mitigation/__init__.py b/qiskit/utils/mitigation/__init__.py index c79b107cdc0f..54251715424d 100644 --- a/qiskit/utils/mitigation/__init__.py +++ b/qiskit/utils/mitigation/__init__.py @@ -44,7 +44,7 @@ From these calibrations, it is possible to correct the average results of another experiment of interest. These tools are intended for use solely with the :class:`~qiskit.utils.QuantumInstance` class as part of -:mod:`qiskit.algorithms` and :mod:`qiskit.opflow`. +:mod:`qiskit.opflow`. .. autosummary:: :toctree: ../stubs/ diff --git a/releasenotes/notes/0.17/prepare-0.17-2ab9429b69e1d25c.yaml b/releasenotes/notes/0.17/prepare-0.17-2ab9429b69e1d25c.yaml index d4d24a5ae737..bbc724c80b69 100644 --- a/releasenotes/notes/0.17/prepare-0.17-2ab9429b69e1d25c.yaml +++ b/releasenotes/notes/0.17/prepare-0.17-2ab9429b69e1d25c.yaml @@ -2,11 +2,11 @@ prelude: | The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new feature for this release is the introduction of the - :mod:`qiskit.algorithms` and :mod:`qiskit.opflow` modules which were + ``qiskit.algorithms`` and :mod:`qiskit.opflow` modules which were migrated and adapted from the :mod:`qiskit.aqua` project. features: - | - A new module :mod:`qiskit.algorithms` has been introduced. This module + A new module ``qiskit.algorithms`` has been introduced. This module contains functionality equivalent to what has previously been provided by the :mod:`qiskit.aqua.algorithms` module (which is now deprecated) and provides the building blocks for constructing quantum diff --git a/releasenotes/notes/0.18/requirements-updates-6059950dfde3cef6.yaml b/releasenotes/notes/0.18/requirements-updates-6059950dfde3cef6.yaml index e795de505ebc..36d207f2825b 100644 --- a/releasenotes/notes/0.18/requirements-updates-6059950dfde3cef6.yaml +++ b/releasenotes/notes/0.18/requirements-updates-6059950dfde3cef6.yaml @@ -6,7 +6,7 @@ upgrade: was done because of the wide use of the :class:`~qiskit.circuit.library.PhaseOracle` (which depends on having tweedledum installed) with several algorithms - from :mod:`qiskit.algorithms`. + from ``qiskit.algorithms``. - | The optional extra ``full-featured-simulators`` which could previously used to install ``qiskit-aer`` with something like diff --git a/releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml b/releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml index 69d60ee1545f..459197257dbe 100644 --- a/releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml +++ b/releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @@ -8,7 +8,7 @@ features: on backends with measurement errors. Readout mitigator classes have two main methods: - + * :meth:`~.BaseReadoutMitigator.expectation_value` which computes an mitigated expectation value and standard error of a diagonal operator from a noisy :class:`~qiskit.result.Counts` object. @@ -17,7 +17,7 @@ features: mitigated :class:`~qiskit.result.QuasiDistribution`, including standard error, from a noisy counts object. - Note that currently the :mod:`qiskit.algorithms` module and the + Note that currently the ``qiskit.algorithms`` module and the :class:`~qiskit.utils.QuantumInstance` class still use the legacy mitigators migrated from Qiskit Ignis in :mod:`qiskit.utils.mitigation`. It is planned to upgrade the module to use the new mitigator classes and deprecate the legacy @@ -26,12 +26,12 @@ features: Added the :class:`~qiskit.result.LocalReadoutMitigator` class for performing measurement readout error mitigation of local measurement errors. Local measuerment errors are those that are described by a - tensor-product of single-qubit measurement errors. - + tensor-product of single-qubit measurement errors. + This class can be initialized with a list of :math:`N` single-qubit of measurement error assignment matrices or from a backend using the readout error information in the backend properties. - + Mitigation is implemented using local assignment-matrix inversion which has complexity of :math:`O(2^N)` for :math:`N`-qubit mitigation of :class:`~qiskit.result.QuasiDistribution` and expectation values. diff --git a/releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml b/releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml index 3178faff0e7c..06cd8bc15e07 100644 --- a/releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml +++ b/releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml @@ -13,7 +13,7 @@ upgrade: fixes: - | The :class:`~.AmplitudeAmplifier` is now correctly available from the root - :mod:`qiskit.algorithms` module directly. Previously it was not included + ``qiskit.algorithms`` module directly. Previously it was not included in the re-exported classes off the root module and was only accessible from ``qiskit.algorithms.amplitude_amplifiers``. Fixed `#7751 `__. diff --git a/releasenotes/notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml b/releasenotes/notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml index 4d685f006b33..8d36f57398c9 100644 --- a/releasenotes/notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml +++ b/releasenotes/notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml @@ -1,7 +1,7 @@ --- features: - | - Added a new algorithm class, :class:`~.AdaptVQE` to :mod:`qiskit.algorithms` + Added a new algorithm class, :class:`~.AdaptVQE` to ``qiskit.algorithms`` This algorithm uses a :class:`qiskit.algorithms.minimum_eigensolvers.VQE` in combination with a pool of operators from which to build out an :class:`qiskit.circuit.library.EvolvedOperatorAnsatz` adaptively. diff --git a/releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml b/releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml index deec31b207fe..8ca521853987 100644 --- a/releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml +++ b/releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml @@ -16,7 +16,7 @@ prelude: | Additionally, :class:`~.BackendV2` backends can now optionally set custom default plugins to use for the scheduling and translation stages. - * Updated algorithm implementations in :mod:`qiskit.algorithms` that leverage + * Updated algorithm implementations in ``qiskit.algorithms`` that leverage the :mod:`~.primitives` classes that implement the :class:`~.BaseSampler` and :class:`~.BaseEstimator`. diff --git a/releasenotes/notes/0.22/project-dynamics-primitives-6003336d0866ca19.yaml b/releasenotes/notes/0.22/project-dynamics-primitives-6003336d0866ca19.yaml index 6ead6d45db4f..8d0fe0780c4b 100644 --- a/releasenotes/notes/0.22/project-dynamics-primitives-6003336d0866ca19.yaml +++ b/releasenotes/notes/0.22/project-dynamics-primitives-6003336d0866ca19.yaml @@ -1,6 +1,6 @@ features: - | - Added the :class:`~.PVQD` class to the time evolution framework in :mod:`qiskit.algorithms`. + Added the :class:`~.PVQD` class to the time evolution framework in ``qiskit.algorithms``. This class implements the projected Variational Quantum Dynamics (p-VQD) algorithm `Barison et al. `_. diff --git a/releasenotes/notes/0.24/remove-deprecated-factorizers-linear-solvers-4631870129749624.yaml b/releasenotes/notes/0.24/remove-deprecated-factorizers-linear-solvers-4631870129749624.yaml index 330a99ef9f22..9f4447a412a3 100644 --- a/releasenotes/notes/0.24/remove-deprecated-factorizers-linear-solvers-4631870129749624.yaml +++ b/releasenotes/notes/0.24/remove-deprecated-factorizers-linear-solvers-4631870129749624.yaml @@ -3,7 +3,7 @@ upgrade: - | The deprecated modules ``factorizers`` and ``linear_solvers``, containing ``HHL`` and ``Shor`` have been removed from - :mod:`qiskit.algorithms`. These functionalities + ``qiskit.algorithms``. These functionalities were originally deprecated as part of the 0.22.0 release (released on October 13, 2022). You can access the code through the Qiskit Textbook instead: `Linear Solvers (HHL) `_ , diff --git a/releasenotes/notes/0.25/deprecate-algorithms-7149dee2da586549.yaml b/releasenotes/notes/0.25/deprecate-algorithms-7149dee2da586549.yaml index 4edaefe8bb7c..7b23c66a943b 100644 --- a/releasenotes/notes/0.25/deprecate-algorithms-7149dee2da586549.yaml +++ b/releasenotes/notes/0.25/deprecate-algorithms-7149dee2da586549.yaml @@ -1,23 +1,23 @@ --- deprecations: - | - The :mod:`qiskit.algorithms` module has been deprecated and will be removed + The ``qiskit.algorithms`` module has been deprecated and will be removed in a future release. It has been superseded by a new standalone library ``qiskit-algorithms`` which can be found on PyPi or on Github here: https://github.com/qiskit-community/qiskit-algorithms - The :mod:`qiskit.algorithms` will continue to work as before and bug fixes + The ``qiskit.algorithms`` module will continue to work as before and bug fixes will be made to module until its future removal, but active development of new features has moved to the new package. - If you're relying on :mod:`qiskit.algorithms` you should update your + If you're relying on ``qiskit.algorithms`` you should update your requirements to also include ``qiskit-algorithms`` and update the imports from ``qiskit.algorithms`` to ``qiskit_algorithms``. Please note that this new package does not include already deprecated algorithms code, including ``opflow`` and ``QuantumInstance``-based algorithms. If you have not yet migrated from ``QuantumInstance``-based to primitives-based algorithms, you should follow the migration guidelines in https://qisk.it/algo_migration. - The decision to migrate the :mod:`~.algorithms` module to a + The decision to migrate the ``qiskit.algorithms`` module to a separate package was made to clarify the purpose Qiskit and make a distinction between the tools and libraries built on top of it. diff --git a/test/python/transpiler/aqc/test_aqc.py b/test/python/transpiler/aqc/test_aqc.py index 4411471e6290..0c16c1216c35 100644 --- a/test/python/transpiler/aqc/test_aqc.py +++ b/test/python/transpiler/aqc/test_aqc.py @@ -15,10 +15,11 @@ from functools import partial import unittest +from test.python.transpiler.aqc.sample_data import ORIGINAL_CIRCUIT, INITIAL_THETAS + import numpy as np from scipy.optimize import minimize -from test.python.transpiler.aqc.sample_data import ORIGINAL_CIRCUIT, INITIAL_THETAS from qiskit.quantum_info import Operator from qiskit.test import QiskitTestCase from qiskit.transpiler.synthesis.aqc.aqc import AQC diff --git a/test/python/transpiler/aqc/test_aqc_plugin.py b/test/python/transpiler/aqc/test_aqc_plugin.py index 3649414c10e8..b5f3bf1858f4 100644 --- a/test/python/transpiler/aqc/test_aqc_plugin.py +++ b/test/python/transpiler/aqc/test_aqc_plugin.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2021, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory