Skip to content

Commit

Permalink
Replace qiskit.algorithms with qiskit_algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
ElePT committed Jul 17, 2023
1 parent 466185c commit 40e3fb3
Show file tree
Hide file tree
Showing 104 changed files with 226 additions and 226 deletions.
8 changes: 4 additions & 4 deletions qiskit_algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@

"""
=====================================
Algorithms (:mod:`qiskit.algorithms`)
Algorithms (:mod:`qiskit_algorithms`)
=====================================
It contains a collection of quantum algorithms, for use with quantum computers, to
carry out research and investigate how to solve problems in different domains on
near-term quantum devices with short depth circuits.
Algorithms configuration includes the use of :mod:`~qiskit.algorithms.optimizers` which
Algorithms configuration includes the use of :mod:`~qiskit_algorithms.optimizers` which
were designed to be swappable sub-parts of an algorithm. Any component and may be exchanged for
a different implementation of the same component type in order to potentially alter the behavior
and outcome of the algorithm.
Quantum algorithms are run via a :class:`~qiskit.algorithms.QuantumInstance`
Quantum algorithms are run via a :class:`~qiskit_algorithms.QuantumInstance`
which must be set with the
desired backend where the algorithm's circuits will be executed and be configured with a number of
compile and runtime parameters controlling circuit compilation and execution. It ultimately uses
`Terra <https://www.qiskit.org/terra>`__ for the actual compilation and execution of the quantum
circuits created by the algorithm and its components.
.. currentmodule:: qiskit.algorithms
.. currentmodule:: qiskit_algorithms
Algorithms
==========
Expand Down
2 changes: 1 addition & 1 deletion qiskit_algorithms/amplitude_amplifiers/grover.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import numpy as np

from qiskit import ClassicalRegister, QuantumCircuit
from qiskit.algorithms.exceptions import AlgorithmError
from qiskit_algorithms.exceptions import AlgorithmError
from qiskit.primitives import BaseSampler
from qiskit.providers import Backend
from qiskit.quantum_info import partial_trace, Statevector
Expand Down
2 changes: 1 addition & 1 deletion qiskit_algorithms/amplitude_estimators/fae.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from qiskit.primitives import BaseSampler
from qiskit.utils import QuantumInstance
from qiskit.utils.deprecation import deprecate_arg, deprecate_func
from qiskit.algorithms.exceptions import AlgorithmError
from qiskit_algorithms.exceptions import AlgorithmError

from .amplitude_estimator import AmplitudeEstimator, AmplitudeEstimatorResult
from .estimation_problem import EstimationProblem
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/aux_ops_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@deprecate_func(
additional_msg=(
"Instead, use the function "
"``qiskit.algorithms.observables_evaluator.estimate_observables``. See "
"``qiskit_algorithms.observables_evaluator.estimate_observables``. See "
"https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand All @@ -53,7 +53,7 @@ def eval_observables(
can optionally provide a threshold value which filters mean values falling below the threshold.
This function has been superseded by the
:func:`qiskit.algorithms.observables_evaluator.eval_observables` function.
:func:`qiskit_algorithms.observables_evaluator.eval_observables` function.
It will be deprecated in a future release and subsequently
removed after that.
Expand Down
8 changes: 4 additions & 4 deletions qiskit_algorithms/eigen_solvers/eigen_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Eigensolver(ABC):
"""Deprecated: Eigensolver Interface.
The Eigensolver interface has been superseded by the
:class:`qiskit.algorithms.eigensolvers.Eigensolver` interface.
:class:`qiskit_algorithms.eigensolvers.Eigensolver` interface.
This interface will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -37,7 +37,7 @@ class Eigensolver(ABC):

@deprecate_func(
additional_msg=(
"Instead, use the interface ``qiskit.algorithms.eigensolvers.Eigensolver``. See "
"Instead, use the interface ``qiskit_algorithms.eigensolvers.Eigensolver``. See "
"https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down Expand Up @@ -81,15 +81,15 @@ class EigensolverResult(AlgorithmResult):
"""Deprecated: Eigensolver Result.
The EigensolverResult class has been superseded by the
:class:`qiskit.algorithms.eigensolvers.EigensolverResult` class.
:class:`qiskit_algorithms.eigensolvers.EigensolverResult` class.
This class will be deprecated in a future release and subsequently
removed after that.
"""

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.eigensolvers.EigensolverResult``. "
"Instead, use the class ``qiskit_algorithms.eigensolvers.EigensolverResult``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/eigen_solvers/numpy_eigen_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NumPyEigensolver(Eigensolver):
Deprecated: NumPy Eigensolver algorithm.
The NumPyEigensolver class has been superseded by the
:class:`qiskit.algorithms.eigensolvers.NumPyEigensolver` class.
:class:`qiskit_algorithms.eigensolvers.NumPyEigensolver` class.
This class will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -50,7 +50,7 @@ class NumPyEigensolver(Eigensolver):

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.eigensolvers.NumPyEigensolver``. "
"Instead, use the class ``qiskit_algorithms.eigensolvers.NumPyEigensolver``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
10 changes: 5 additions & 5 deletions qiskit_algorithms/eigen_solvers/vqd.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class VQD(VariationalAlgorithm, Eigensolver):
r"""Deprecated: Variational Quantum Deflation algorithm.
The VQD class has been superseded by the
:class:`qiskit.algorithms.eigensolvers.VQD` class.
:class:`qiskit_algorithms.eigensolvers.VQD` class.
This class will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -73,7 +73,7 @@ class VQD(VariationalAlgorithm, Eigensolver):
An instance of VQD requires defining three algorithmic sub-components:
an integer k denoting the number of eigenstates to calculate, a trial
state (a.k.a. ansatz)which is a :class:`QuantumCircuit`,
and one of the classical :mod:`~qiskit.algorithms.optimizers`.
and one of the classical :mod:`~qiskit_algorithms.optimizers`.
The ansatz is varied, via its set of parameters, by the optimizer,
such that it works towards a state, as determined by the parameters
applied to the ansatz, that will result in the minimum expectation values
Expand All @@ -99,7 +99,7 @@ class VQD(VariationalAlgorithm, Eigensolver):

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.eigensolvers.VQD``."
"Instead, use the class ``qiskit_algorithms.eigensolvers.VQD``."
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down Expand Up @@ -765,15 +765,15 @@ class VQDResult(VariationalResult, EigensolverResult):
"""Deprecated: VQD Result.
The VQDResult class has been superseded by the
:class:`qiskit.algorithms.eigensolvers.VQDResult` class.
:class:`qiskit_algorithms.eigensolvers.VQDResult` class.
This class will be deprecated in a future release and subsequently
removed after that.
"""

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.eigensolvers.VQDResult``."
"Instead, use the class ``qiskit_algorithms.eigensolvers.VQDResult``."
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/eigensolvers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

"""
=====================================================================
Eigensolvers Package (:mod:`qiskit.algorithms.eigensolvers`)
Eigensolvers Package (:mod:`qiskit_algorithms.eigensolvers`)
=====================================================================
.. currentmodule:: qiskit.algorithms.eigensolvers
.. currentmodule:: qiskit_algorithms.eigensolvers
Eigensolvers
================
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/eigensolvers/vqd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import numpy as np

from qiskit.algorithms.state_fidelities import BaseStateFidelity
from qiskit_algorithms.state_fidelities import BaseStateFidelity
from qiskit.circuit import QuantumCircuit
from qiskit.opflow import PauliSumOp
from qiskit.primitives import BaseEstimator
Expand Down Expand Up @@ -61,7 +61,7 @@ class VQD(VariationalAlgorithm, Eigensolver):
An instance of VQD requires defining three algorithmic sub-components:
an integer k denoting the number of eigenstates to calculate, a trial
state (a.k.a. ansatz) which is a :class:`QuantumCircuit`,
and one instance (or list of) classical :mod:`~qiskit.algorithms.optimizers`.
and one instance (or list of) classical :mod:`~qiskit_algorithms.optimizers`.
The optimizer varies the circuit parameters
The trial state :math:`|\psi(\vec\theta)\rangle` is varied by the optimizer,
which modifies the set of ansatz parameters :math:`\vec\theta`
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/evolvers/evolution_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EvolutionProblem:
"""Deprecated: Evolution problem class.
The EvolutionProblem class has been superseded by the
:class:`qiskit.algorithms.time_evolvers.TimeEvolutionProblem` class.
:class:`qiskit_algorithms.time_evolvers.TimeEvolutionProblem` class.
This class will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -35,7 +35,7 @@ class EvolutionProblem:

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.time_evolvers.TimeEvolutionProblem``. "
"Instead, use the class ``qiskit_algorithms.time_evolvers.TimeEvolutionProblem``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
6 changes: 3 additions & 3 deletions qiskit_algorithms/evolvers/evolution_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import annotations

from qiskit import QuantumCircuit
from qiskit.algorithms.list_or_dict import ListOrDict
from qiskit_algorithms.list_or_dict import ListOrDict
from qiskit.opflow import StateFn, OperatorBase
from qiskit.utils.deprecation import deprecate_func
from ..algorithm_result import AlgorithmResult
Expand All @@ -25,15 +25,15 @@ class EvolutionResult(AlgorithmResult):
"""Deprecated: Class for holding evolution result.
The EvolutionResult class has been superseded by the
:class:`qiskit.algorithms.time_evolvers.TimeEvolutionResult` class.
:class:`qiskit_algorithms.time_evolvers.TimeEvolutionResult` class.
This class will be deprecated in a future release and subsequently
removed after that.
"""

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.time_evolvers.TimeEvolutionResult``. "
"Instead, use the class ``qiskit_algorithms.time_evolvers.TimeEvolutionResult``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/evolvers/imaginary_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class ImaginaryEvolver(ABC):
"""Deprecated: Interface for Quantum Imaginary Time Evolution.
The ImaginaryEvolver interface has been superseded by the
:class:`qiskit.algorithms.time_evolvers.ImaginaryTimeEvolver` interface.
:class:`qiskit_algorithms.time_evolvers.ImaginaryTimeEvolver` interface.
This interface will be deprecated in a future release and subsequently
removed after that.
"""

@deprecate_func(
additional_msg=(
"Instead, use the interface ``qiskit.algorithms.time_evolvers.ImaginaryTimeEvolver``. "
"Instead, use the interface ``qiskit_algorithms.time_evolvers.ImaginaryTimeEvolver``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/evolvers/real_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class RealEvolver(ABC):
"""Deprecated: Interface for Quantum Real Time Evolution.
The RealEvolver interface has been superseded by the
:class:`qiskit.algorithms.time_evolvers.RealTimeEvolver` interface.
:class:`qiskit_algorithms.time_evolvers.RealTimeEvolver` interface.
This interface will be deprecated in a future release and subsequently
removed after that.
"""

@deprecate_func(
additional_msg=(
"Instead, use the interface ``qiskit.algorithms.time_evolvers.RealTimeEvolver``. "
"Instead, use the interface ``qiskit_algorithms.time_evolvers.RealTimeEvolver``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
2 changes: 1 addition & 1 deletion qiskit_algorithms/evolvers/trotterization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:class:`qiskit.synthesis.evolution.ProductFormula` and
:class:`~qiskit.circuit.library.PauliEvolutionGate` implementations. """

from qiskit.algorithms.evolvers.trotterization.trotter_qrte import (
from qiskit_algorithms.evolvers.trotterization.trotter_qrte import (
TrotterQRTE,
)

Expand Down
12 changes: 6 additions & 6 deletions qiskit_algorithms/evolvers/trotterization/trotter_qrte.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import warnings

from qiskit import QuantumCircuit
from qiskit.algorithms.aux_ops_evaluator import eval_observables
from qiskit.algorithms.evolvers import EvolutionProblem, EvolutionResult
from qiskit.algorithms.evolvers.real_evolver import RealEvolver
from qiskit_algorithms.aux_ops_evaluator import eval_observables
from qiskit_algorithms.evolvers import EvolutionProblem, EvolutionResult
from qiskit_algorithms.evolvers.real_evolver import RealEvolver
from qiskit.opflow import (
SummedOp,
PauliOp,
Expand All @@ -41,7 +41,7 @@ class TrotterQRTE(RealEvolver):
"""Deprecated: Quantum Real Time Evolution using Trotterization.
The TrotterQRTE class has been superseded by the
:class:`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class.
:class:`qiskit_algorithms.time_evolvers.trotterization.TrotterQRTE` class.
This class will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -50,7 +50,7 @@ class TrotterQRTE(RealEvolver):
Examples::
from qiskit.opflow import X, Z, Zero
from qiskit.algorithms import EvolutionProblem, TrotterQRTE
from qiskit_algorithms import EvolutionProblem, TrotterQRTE
from qiskit import BasicAer
from qiskit.utils import QuantumInstance
Expand All @@ -67,7 +67,7 @@ class TrotterQRTE(RealEvolver):

@deprecate_func(
additional_msg=(
"Instead, use the class ``qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE``."
"Instead, use the class ``qiskit_algorithms.time_evolvers.trotterization.TrotterQRTE``."
" See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/gradients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

"""
==============================================
Gradients (:mod:`qiskit.algorithms.gradients`)
Gradients (:mod:`qiskit_algorithms.gradients`)
==============================================
.. currentmodule:: qiskit.algorithms.gradients
.. currentmodule:: qiskit_algorithms.gradients
Base Classes
============
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MinimumEigensolver(ABC):
"""Deprecated: Minimum Eigensolver Interface.
The Minimum Eigensolver interface has been superseded by the
:class:`qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver` interface.
:class:`qiskit_algorithms.minimum_eigensolvers.MinimumEigensolver` interface.
This interface will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -39,7 +39,7 @@ class MinimumEigensolver(ABC):
@deprecate_func(
additional_msg=(
"Instead, use the interface "
"``qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver``. "
"``qiskit_algorithms.minimum_eigensolvers.MinimumEigensolver``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down Expand Up @@ -87,7 +87,7 @@ class MinimumEigensolverResult(AlgorithmResult):
"""Deprecated: Minimum Eigensolver Result.
The MinimumEigensolverResult class has been superseded by the
:class:`qiskit.algorithms.minimum_eigensolvers.MinimumEigensolverResult` class.
:class:`qiskit_algorithms.minimum_eigensolvers.MinimumEigensolverResult` class.
This class will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -96,7 +96,7 @@ class MinimumEigensolverResult(AlgorithmResult):
@deprecate_func(
additional_msg=(
"Instead, use the class "
"``qiskit.algorithms.minimum_eigensolvers.MinimumEigensolverResult``. "
"``qiskit_algorithms.minimum_eigensolvers.MinimumEigensolverResult``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NumPyMinimumEigensolver(MinimumEigensolver):
Deprecated: Numpy Minimum Eigensolver algorithm.
The NumPyMinimumEigensolver class has been superseded by the
:class:`qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver` class.
:class:`qiskit_algorithms.minimum_eigensolvers.NumPyMinimumEigensolver` class.
This class will be deprecated in a future release and subsequently
removed after that.
Expand All @@ -42,7 +42,7 @@ class NumPyMinimumEigensolver(MinimumEigensolver):
@deprecate_func(
additional_msg=(
"Instead, use the class "
"``qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver``. "
"``qiskit_algorithms.minimum_eigensolvers.NumPyMinimumEigensolver``. "
"See https://qisk.it/algo_migration for a migration guide."
),
since="0.24.0",
Expand Down
Loading

0 comments on commit 40e3fb3

Please sign in to comment.