From 40e3fb37f7043f2f16ba0e43f540b87ba708d47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 17 Jul 2023 17:08:42 +0200 Subject: [PATCH] Replace qiskit.algorithms with qiskit_algorithms --- qiskit_algorithms/__init__.py | 8 ++++---- qiskit_algorithms/amplitude_amplifiers/grover.py | 2 +- qiskit_algorithms/amplitude_estimators/fae.py | 2 +- qiskit_algorithms/aux_ops_evaluator.py | 4 ++-- qiskit_algorithms/eigen_solvers/eigen_solver.py | 8 ++++---- .../eigen_solvers/numpy_eigen_solver.py | 4 ++-- qiskit_algorithms/eigen_solvers/vqd.py | 10 +++++----- qiskit_algorithms/eigensolvers/__init__.py | 4 ++-- qiskit_algorithms/eigensolvers/vqd.py | 4 ++-- qiskit_algorithms/evolvers/evolution_problem.py | 4 ++-- qiskit_algorithms/evolvers/evolution_result.py | 6 +++--- qiskit_algorithms/evolvers/imaginary_evolver.py | 4 ++-- qiskit_algorithms/evolvers/real_evolver.py | 4 ++-- .../evolvers/trotterization/__init__.py | 2 +- .../evolvers/trotterization/trotter_qrte.py | 12 ++++++------ qiskit_algorithms/gradients/__init__.py | 4 ++-- .../minimum_eigen_solvers/minimum_eigen_solver.py | 8 ++++---- .../numpy_minimum_eigen_solver.py | 4 ++-- qiskit_algorithms/minimum_eigen_solvers/qaoa.py | 10 +++++----- qiskit_algorithms/minimum_eigen_solvers/vqe.py | 14 +++++++------- qiskit_algorithms/minimum_eigensolvers/__init__.py | 4 ++-- .../minimum_eigensolvers/adapt_vqe.py | 6 +++--- .../minimum_eigensolvers/diagonal_estimator.py | 2 +- qiskit_algorithms/minimum_eigensolvers/qaoa.py | 2 +- .../minimum_eigensolvers/sampling_vqe.py | 6 +++--- qiskit_algorithms/minimum_eigensolvers/vqe.py | 6 +++--- qiskit_algorithms/optimizers/__init__.py | 6 +++--- qiskit_algorithms/optimizers/gradient_descent.py | 6 +++--- qiskit_algorithms/optimizers/optimizer.py | 2 +- .../optimizers/optimizer_utils/__init__.py | 2 +- qiskit_algorithms/optimizers/qnspsa.py | 8 ++++---- qiskit_algorithms/optimizers/spsa.py | 4 ++-- .../optimizers/steppable_optimizer.py | 2 +- qiskit_algorithms/optimizers/umda.py | 4 ++-- .../hamiltonian_phase_estimation.py | 4 ++-- .../hamiltonian_phase_estimation_result.py | 2 +- qiskit_algorithms/phase_estimators/ipe.py | 2 +- .../phase_estimators/phase_estimation.py | 8 ++++---- .../phase_estimators/phase_estimator.py | 2 +- qiskit_algorithms/state_fidelities/__init__.py | 4 ++-- qiskit_algorithms/time_evolvers/pvqd/pvqd.py | 6 +++--- .../time_evolvers/time_evolution_result.py | 2 +- .../time_evolvers/trotterization/__init__.py | 2 +- .../time_evolvers/trotterization/trotter_qrte.py | 12 ++++++------ .../time_evolvers/variational/__init__.py | 12 ++++++------ .../time_evolvers/variational/solvers/__init__.py | 6 +++--- .../time_evolvers/variational/var_qite.py | 4 ++-- .../time_evolvers/variational/var_qrte.py | 4 ++-- qiskit_algorithms/utils/__init__.py | 2 +- qiskit_algorithms/utils/set_batching.py | 2 +- test/eigensolvers/test_numpy_eigensolver.py | 4 ++-- test/eigensolvers/test_vqd.py | 8 ++++---- test/evolvers/test_evolution_problem.py | 2 +- test/evolvers/test_evolution_result.py | 2 +- test/evolvers/trotterization/test_trotter_qrte.py | 4 ++-- test/gradients/test_estimator_gradient.py | 2 +- test/gradients/test_qfi.py | 2 +- test/gradients/test_qgt.py | 2 +- test/gradients/test_sampler_gradient.py | 2 +- test/minimum_eigensolvers/test_adapt_vqe.py | 6 +++--- .../test_numpy_minimum_eigensolver.py | 2 +- test/minimum_eigensolvers/test_qaoa.py | 4 ++-- test/minimum_eigensolvers/test_qaoa_opflow.py | 4 ++-- test/minimum_eigensolvers/test_sampling_vqe.py | 8 ++++---- test/minimum_eigensolvers/test_vqe.py | 10 +++++----- test/optimizers/test_gradient_descent.py | 4 ++-- test/optimizers/test_optimizer_aqgd.py | 4 ++-- test/optimizers/test_optimizer_nft.py | 4 ++-- test/optimizers/test_optimizers.py | 2 +- test/optimizers/test_optimizers_scikitquant.py | 4 ++-- test/optimizers/test_spsa.py | 2 +- test/optimizers/test_umda.py | 2 +- test/optimizers/utils/test_learning_rate.py | 2 +- test/state_fidelities/test_compute_uncompute.py | 2 +- test/test_amplitude_estimators.py | 2 +- test/test_aux_ops_evaluator.py | 4 ++-- test/test_backendv1.py | 4 ++-- test/test_backendv2.py | 4 ++-- test/test_grover.py | 2 +- test/test_measure_error_mitigation.py | 4 ++-- test/test_numpy_eigen_solver.py | 2 +- test/test_numpy_minimum_eigen_solver.py | 2 +- test/test_observables_evaluator.py | 4 ++-- test/test_phase_estimator.py | 4 ++-- test/test_qaoa.py | 4 ++-- test/test_vqd.py | 4 ++-- test/test_vqe.py | 4 ++-- .../test_scipy_imaginary_evolver.py | 4 ++-- .../classical_methods/test_scipy_real_evolver.py | 2 +- test/time_evolvers/test_pvqd.py | 8 ++++---- test/time_evolvers/test_time_evolution_problem.py | 2 +- test/time_evolvers/test_time_evolution_result.py | 2 +- test/time_evolvers/test_trotter_qrte.py | 2 +- .../solvers/ode/test_forward_euler_solver.py | 2 +- .../variational/solvers/ode/test_ode_function.py | 6 +++--- .../solvers/ode/test_var_qte_ode_solver.py | 10 +++++----- .../solvers/test_varqte_linear_solver.py | 4 ++-- test/time_evolvers/variational/test_var_qite.py | 6 +++--- test/time_evolvers/variational/test_var_qrte.py | 6 +++--- test/time_evolvers/variational/test_var_qte.py | 2 +- .../test_imaginary_mc_lachlan_principle.py | 4 ++-- .../real/test_real_mc_lachlan_principle.py | 4 ++-- test/utils/test_validate_bounds.py | 2 +- test/utils/test_validate_initial_point.py | 2 +- 104 files changed, 226 insertions(+), 226 deletions(-) diff --git a/qiskit_algorithms/__init__.py b/qiskit_algorithms/__init__.py index b9dc8b8a..a447ef32 100644 --- a/qiskit_algorithms/__init__.py +++ b/qiskit_algorithms/__init__.py @@ -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 `__ for the actual compilation and execution of the quantum circuits created by the algorithm and its components. -.. currentmodule:: qiskit.algorithms +.. currentmodule:: qiskit_algorithms Algorithms ========== diff --git a/qiskit_algorithms/amplitude_amplifiers/grover.py b/qiskit_algorithms/amplitude_amplifiers/grover.py index f8e85918..2402b183 100644 --- a/qiskit_algorithms/amplitude_amplifiers/grover.py +++ b/qiskit_algorithms/amplitude_amplifiers/grover.py @@ -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 diff --git a/qiskit_algorithms/amplitude_estimators/fae.py b/qiskit_algorithms/amplitude_estimators/fae.py index 08fedaff..76688545 100644 --- a/qiskit_algorithms/amplitude_estimators/fae.py +++ b/qiskit_algorithms/amplitude_estimators/fae.py @@ -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 diff --git a/qiskit_algorithms/aux_ops_evaluator.py b/qiskit_algorithms/aux_ops_evaluator.py index 788b66d6..50b1352b 100644 --- a/qiskit_algorithms/aux_ops_evaluator.py +++ b/qiskit_algorithms/aux_ops_evaluator.py @@ -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", @@ -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. diff --git a/qiskit_algorithms/eigen_solvers/eigen_solver.py b/qiskit_algorithms/eigen_solvers/eigen_solver.py index 5fd59b3e..564a54e9 100644 --- a/qiskit_algorithms/eigen_solvers/eigen_solver.py +++ b/qiskit_algorithms/eigen_solvers/eigen_solver.py @@ -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. @@ -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", @@ -81,7 +81,7 @@ 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. @@ -89,7 +89,7 @@ class EigensolverResult(AlgorithmResult): @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", diff --git a/qiskit_algorithms/eigen_solvers/numpy_eigen_solver.py b/qiskit_algorithms/eigen_solvers/numpy_eigen_solver.py index 6b053633..b3f62b23 100644 --- a/qiskit_algorithms/eigen_solvers/numpy_eigen_solver.py +++ b/qiskit_algorithms/eigen_solvers/numpy_eigen_solver.py @@ -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. @@ -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", diff --git a/qiskit_algorithms/eigen_solvers/vqd.py b/qiskit_algorithms/eigen_solvers/vqd.py index 72e3dd30..ac0f03f1 100644 --- a/qiskit_algorithms/eigen_solvers/vqd.py +++ b/qiskit_algorithms/eigen_solvers/vqd.py @@ -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. @@ -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 @@ -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", @@ -765,7 +765,7 @@ 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. @@ -773,7 +773,7 @@ class VQDResult(VariationalResult, EigensolverResult): @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", diff --git a/qiskit_algorithms/eigensolvers/__init__.py b/qiskit_algorithms/eigensolvers/__init__.py index 2934d6c2..ae3a8c4c 100644 --- a/qiskit_algorithms/eigensolvers/__init__.py +++ b/qiskit_algorithms/eigensolvers/__init__.py @@ -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 ================ diff --git a/qiskit_algorithms/eigensolvers/vqd.py b/qiskit_algorithms/eigensolvers/vqd.py index cbb4d56a..85c494dd 100644 --- a/qiskit_algorithms/eigensolvers/vqd.py +++ b/qiskit_algorithms/eigensolvers/vqd.py @@ -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 @@ -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` diff --git a/qiskit_algorithms/evolvers/evolution_problem.py b/qiskit_algorithms/evolvers/evolution_problem.py index 8d87dbd9..1e9ae18d 100644 --- a/qiskit_algorithms/evolvers/evolution_problem.py +++ b/qiskit_algorithms/evolvers/evolution_problem.py @@ -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. @@ -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", diff --git a/qiskit_algorithms/evolvers/evolution_result.py b/qiskit_algorithms/evolvers/evolution_result.py index 5dd9e103..2d2e552a 100644 --- a/qiskit_algorithms/evolvers/evolution_result.py +++ b/qiskit_algorithms/evolvers/evolution_result.py @@ -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 @@ -25,7 +25,7 @@ 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. @@ -33,7 +33,7 @@ class EvolutionResult(AlgorithmResult): @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", diff --git a/qiskit_algorithms/evolvers/imaginary_evolver.py b/qiskit_algorithms/evolvers/imaginary_evolver.py index 74b301d3..f375d12c 100644 --- a/qiskit_algorithms/evolvers/imaginary_evolver.py +++ b/qiskit_algorithms/evolvers/imaginary_evolver.py @@ -23,7 +23,7 @@ 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. @@ -31,7 +31,7 @@ class ImaginaryEvolver(ABC): @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", diff --git a/qiskit_algorithms/evolvers/real_evolver.py b/qiskit_algorithms/evolvers/real_evolver.py index 5024143b..6985f727 100644 --- a/qiskit_algorithms/evolvers/real_evolver.py +++ b/qiskit_algorithms/evolvers/real_evolver.py @@ -23,7 +23,7 @@ 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. @@ -31,7 +31,7 @@ class RealEvolver(ABC): @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", diff --git a/qiskit_algorithms/evolvers/trotterization/__init__.py b/qiskit_algorithms/evolvers/trotterization/__init__.py index fe1b8d8a..2891f27e 100644 --- a/qiskit_algorithms/evolvers/trotterization/__init__.py +++ b/qiskit_algorithms/evolvers/trotterization/__init__.py @@ -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, ) diff --git a/qiskit_algorithms/evolvers/trotterization/trotter_qrte.py b/qiskit_algorithms/evolvers/trotterization/trotter_qrte.py index 4c4af495..d9ba413c 100644 --- a/qiskit_algorithms/evolvers/trotterization/trotter_qrte.py +++ b/qiskit_algorithms/evolvers/trotterization/trotter_qrte.py @@ -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, @@ -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. @@ -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 @@ -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", diff --git a/qiskit_algorithms/gradients/__init__.py b/qiskit_algorithms/gradients/__init__.py index ff3a2fce..2f63514c 100644 --- a/qiskit_algorithms/gradients/__init__.py +++ b/qiskit_algorithms/gradients/__init__.py @@ -12,10 +12,10 @@ """ ============================================== -Gradients (:mod:`qiskit.algorithms.gradients`) +Gradients (:mod:`qiskit_algorithms.gradients`) ============================================== -.. currentmodule:: qiskit.algorithms.gradients +.. currentmodule:: qiskit_algorithms.gradients Base Classes ============ diff --git a/qiskit_algorithms/minimum_eigen_solvers/minimum_eigen_solver.py b/qiskit_algorithms/minimum_eigen_solvers/minimum_eigen_solver.py index 6625cf30..12dbb881 100644 --- a/qiskit_algorithms/minimum_eigen_solvers/minimum_eigen_solver.py +++ b/qiskit_algorithms/minimum_eigen_solvers/minimum_eigen_solver.py @@ -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. @@ -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", @@ -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. @@ -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", diff --git a/qiskit_algorithms/minimum_eigen_solvers/numpy_minimum_eigen_solver.py b/qiskit_algorithms/minimum_eigen_solvers/numpy_minimum_eigen_solver.py index 83623666..e55d5cfb 100644 --- a/qiskit_algorithms/minimum_eigen_solvers/numpy_minimum_eigen_solver.py +++ b/qiskit_algorithms/minimum_eigen_solvers/numpy_minimum_eigen_solver.py @@ -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. @@ -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", diff --git a/qiskit_algorithms/minimum_eigen_solvers/qaoa.py b/qiskit_algorithms/minimum_eigen_solvers/qaoa.py index fc18be86..7b7b868b 100644 --- a/qiskit_algorithms/minimum_eigen_solvers/qaoa.py +++ b/qiskit_algorithms/minimum_eigen_solvers/qaoa.py @@ -18,7 +18,7 @@ import numpy as np -from qiskit.algorithms.optimizers import Minimizer, Optimizer +from qiskit_algorithms.optimizers import Minimizer, Optimizer from qiskit.circuit import QuantumCircuit from qiskit.opflow import OperatorBase, ExpectationBase from qiskit.opflow.gradients import GradientBase @@ -27,7 +27,7 @@ from qiskit.utils.validation import validate_min from qiskit.utils.deprecation import deprecate_func from qiskit.circuit.library.n_local.qaoa_ansatz import QAOAAnsatz -from qiskit.algorithms.minimum_eigen_solvers.vqe import VQE +from qiskit_algorithms.minimum_eigen_solvers.vqe import VQE class QAOA(VQE): @@ -35,7 +35,7 @@ class QAOA(VQE): Deprecated: Quantum Approximate Optimization Algorithm. The QAOA class has been superseded by the - :class:`qiskit.algorithms.minimum_eigensolvers.QAOA` class. + :class:`qiskit_algorithms.minimum_eigensolvers.QAOA` class. This class will be deprecated in a future release and subsequently removed after that. @@ -63,7 +63,7 @@ class QAOA(VQE): @deprecate_func( additional_msg=( - "Instead, use the class ``qiskit.algorithms.minimum_eigensolvers.QAOA``. " + "Instead, use the class ``qiskit_algorithms.minimum_eigensolvers.QAOA``. " "See https://qisk.it/algo_migration for a migration guide." ), since="0.24.0", @@ -84,7 +84,7 @@ def __init__( ) -> None: """ Args: - optimizer: A classical optimizer, see also :class:`~qiskit.algorithms.VQE` for + optimizer: A classical optimizer, see also :class:`~qiskit_algorithms.VQE` for more details on the possible types. reps: the integer parameter :math:`p` as specified in https://arxiv.org/abs/1411.4028, Has a minimum valid value of 1. diff --git a/qiskit_algorithms/minimum_eigen_solvers/vqe.py b/qiskit_algorithms/minimum_eigen_solvers/vqe.py index bf9304e4..28d5dfd4 100644 --- a/qiskit_algorithms/minimum_eigen_solvers/vqe.py +++ b/qiskit_algorithms/minimum_eigen_solvers/vqe.py @@ -57,7 +57,7 @@ class VQE(VariationalAlgorithm, MinimumEigensolver): r"""Deprecated: Variational Quantum Eigensolver algorithm. The VQE class has been superseded by the - :class:`qiskit.algorithms.minimum_eigensolvers.VQE` class. + :class:`qiskit_algorithms.minimum_eigensolvers.VQE` class. This class will be deprecated in a future release and subsequently removed after that. @@ -67,7 +67,7 @@ class VQE(VariationalAlgorithm, MinimumEigensolver): An instance of VQE requires defining two algorithmic sub-components: a trial state (a.k.a. ansatz) which is a :class:`QuantumCircuit`, and one of the classical - :mod:`~qiskit.algorithms.optimizers`. The ansatz is varied, via its set of parameters, by the + :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 value being measured of the input operator (Hamiltonian). @@ -92,7 +92,7 @@ class VQE(VariationalAlgorithm, MinimumEigensolver): as the upper bound, the default value will be :math:`2\pi`. The optimizer can either be one of Qiskit's optimizers, such as - :class:`~qiskit.algorithms.optimizers.SPSA` or a callable with the following signature: + :class:`~qiskit_algorithms.optimizers.SPSA` or a callable with the following signature: .. note:: @@ -101,7 +101,7 @@ class VQE(VariationalAlgorithm, MinimumEigensolver): .. code-block:: python - from qiskit.algorithms.optimizers import OptimizerResult + from qiskit_algorithms.optimizers import OptimizerResult def my_minimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult: # Note that the callable *must* have these argument names! @@ -129,7 +129,7 @@ def my_minimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult: @deprecate_func( additional_msg=( - "Instead, use the class ``qiskit.algorithms.minimum_eigensolvers.VQE``. " + "Instead, use the class ``qiskit_algorithms.minimum_eigensolvers.VQE``. " "See https://qisk.it/algo_migration for a migration guide." ), since="0.24.0", @@ -662,7 +662,7 @@ class VQEResult(VariationalResult, MinimumEigensolverResult): """Deprecated: VQE Result. The VQEResult class has been superseded by the - :class:`qiskit.algorithms.minimum_eigensolvers.VQEResult` class. + :class:`qiskit_algorithms.minimum_eigensolvers.VQEResult` class. This class will be deprecated in a future release and subsequently removed after that. @@ -670,7 +670,7 @@ class VQEResult(VariationalResult, MinimumEigensolverResult): @deprecate_func( additional_msg=( - "Instead, use the class ``qiskit.algorithms.minimum_eigensolvers.VQEResult``. " + "Instead, use the class ``qiskit_algorithms.minimum_eigensolvers.VQEResult``. " "See https://qisk.it/algo_migration for a migration guide." ), since="0.24.0", diff --git a/qiskit_algorithms/minimum_eigensolvers/__init__.py b/qiskit_algorithms/minimum_eigensolvers/__init__.py index d7406c09..58d06e9c 100644 --- a/qiskit_algorithms/minimum_eigensolvers/__init__.py +++ b/qiskit_algorithms/minimum_eigensolvers/__init__.py @@ -12,10 +12,10 @@ """ ============================================================================ -Minimum Eigensolvers Package (:mod:`qiskit.algorithms.minimum_eigensolvers`) +Minimum Eigensolvers Package (:mod:`qiskit_algorithms.minimum_eigensolvers`) ============================================================================ -.. currentmodule:: qiskit.algorithms.minimum_eigensolvers +.. currentmodule:: qiskit_algorithms.minimum_eigensolvers Minimum Eigensolvers ==================== diff --git a/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py b/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py index e05f07cf..293da334 100644 --- a/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py +++ b/qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py @@ -23,7 +23,7 @@ import numpy as np from qiskit import QiskitError -from qiskit.algorithms.list_or_dict import ListOrDict +from qiskit_algorithms.list_or_dict import ListOrDict from qiskit.quantum_info.operators.base_operator import BaseOperator from qiskit.opflow import OperatorBase, PauliSumOp from qiskit.circuit.library import EvolvedOperatorAnsatz @@ -62,8 +62,8 @@ class AdaptVQE(VariationalAlgorithm, MinimumEigensolver): .. code-block:: python - from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE - from qiskit.algorithms.optimizers import SLSQP + from qiskit_algorithms.minimum_eigensolvers import AdaptVQE, VQE + from qiskit_algorithms.optimizers import SLSQP from qiskit.primitives import Estimator from qiskit.circuit.library import EvolvedOperatorAnsatz diff --git a/qiskit_algorithms/minimum_eigensolvers/diagonal_estimator.py b/qiskit_algorithms/minimum_eigensolvers/diagonal_estimator.py index 40354c88..2f9a9fb8 100644 --- a/qiskit_algorithms/minimum_eigensolvers/diagonal_estimator.py +++ b/qiskit_algorithms/minimum_eigensolvers/diagonal_estimator.py @@ -20,7 +20,7 @@ from dataclasses import dataclass import numpy as np -from qiskit.algorithms.algorithm_job import AlgorithmJob +from qiskit_algorithms.algorithm_job import AlgorithmJob from qiskit.circuit import QuantumCircuit from qiskit.primitives import BaseSampler, BaseEstimator, EstimatorResult from qiskit.primitives.utils import init_observable, _circuit_key diff --git a/qiskit_algorithms/minimum_eigensolvers/qaoa.py b/qiskit_algorithms/minimum_eigensolvers/qaoa.py index 46b8d6ba..3b838e0f 100644 --- a/qiskit_algorithms/minimum_eigensolvers/qaoa.py +++ b/qiskit_algorithms/minimum_eigensolvers/qaoa.py @@ -17,7 +17,7 @@ from typing import Callable, Any import numpy as np -from qiskit.algorithms.optimizers import Minimizer, Optimizer +from qiskit_algorithms.optimizers import Minimizer, Optimizer from qiskit.circuit import QuantumCircuit from qiskit.circuit.library.n_local.qaoa_ansatz import QAOAAnsatz from qiskit.quantum_info.operators.base_operator import BaseOperator diff --git a/qiskit_algorithms/minimum_eigensolvers/sampling_vqe.py b/qiskit_algorithms/minimum_eigensolvers/sampling_vqe.py index 2fb60355..dfe40d2d 100644 --- a/qiskit_algorithms/minimum_eigensolvers/sampling_vqe.py +++ b/qiskit_algorithms/minimum_eigensolvers/sampling_vqe.py @@ -52,7 +52,7 @@ class SamplingVQE(VariationalAlgorithm, SamplingMinimumEigensolver): VQE is a hybrid quantum-classical algorithm that uses a variational technique to find the minimum eigenvalue of a given diagonal Hamiltonian operator :math:`H_{\text{diag}}`. - In contrast to the :class:`~qiskit.algorithms.minimum_eigensolvers.VQE` class, the + In contrast to the :class:`~qiskit_algorithms.minimum_eigensolvers.VQE` class, the ``SamplingVQE`` algorithm is executed using a :attr:`sampler` primitive. An instance of ``SamplingVQE`` also requires an :attr:`ansatz`, a parameterized @@ -61,11 +61,11 @@ class SamplingVQE(VariationalAlgorithm, SamplingMinimumEigensolver): minimize the objective function, which depends on the chosen :attr:`aggregation`. The optimizer can either be one of Qiskit's optimizers, such as - :class:`~qiskit.algorithms.optimizers.SPSA` or a callable with the following signature: + :class:`~qiskit_algorithms.optimizers.SPSA` or a callable with the following signature: .. code-block:: python - from qiskit.algorithms.optimizers import OptimizerResult + from qiskit_algorithms.optimizers import OptimizerResult def my_minimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult: # Note that the callable *must* have these argument names! diff --git a/qiskit_algorithms/minimum_eigensolvers/vqe.py b/qiskit_algorithms/minimum_eigensolvers/vqe.py index f26d3687..184705ca 100644 --- a/qiskit_algorithms/minimum_eigensolvers/vqe.py +++ b/qiskit_algorithms/minimum_eigensolvers/vqe.py @@ -21,7 +21,7 @@ import numpy as np -from qiskit.algorithms.gradients import BaseEstimatorGradient +from qiskit_algorithms.gradients import BaseEstimatorGradient from qiskit.circuit import QuantumCircuit from qiskit.opflow import PauliSumOp from qiskit.primitives import BaseEstimator @@ -62,11 +62,11 @@ class VQE(VariationalAlgorithm, MinimumEigensolver): The :attr:`estimator` is used to compute this expectation value for every optimization step. The optimizer can either be one of Qiskit's optimizers, such as - :class:`~qiskit.algorithms.optimizers.SPSA` or a callable with the following signature: + :class:`~qiskit_algorithms.optimizers.SPSA` or a callable with the following signature: .. code-block:: python - from qiskit.algorithms.optimizers import OptimizerResult + from qiskit_algorithms.optimizers import OptimizerResult def my_minimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult: # Note that the callable *must* have these argument names! diff --git a/qiskit_algorithms/optimizers/__init__.py b/qiskit_algorithms/optimizers/__init__.py index 11bf73d1..f1046e50 100644 --- a/qiskit_algorithms/optimizers/__init__.py +++ b/qiskit_algorithms/optimizers/__init__.py @@ -11,10 +11,10 @@ # that they have been altered from the originals. """ -Optimizers (:mod:`qiskit.algorithms.optimizers`) +Optimizers (:mod:`qiskit_algorithms.optimizers`) ===================================================== It contains a variety of classical optimizers for use by quantum variational algorithms, -such as :class:`~qiskit.algorithms.VQE`. +such as :class:`~qiskit_algorithms.VQE`. Logically, these optimizers can be divided into two categories: `Local Optimizers`_ @@ -25,7 +25,7 @@ Given an optimization problem, a **global optimizer** is a function that attempts to find an optimal value among all possible solutions. -.. currentmodule:: qiskit.algorithms.optimizers +.. currentmodule:: qiskit_algorithms.optimizers Optimizer Base Class ==================== diff --git a/qiskit_algorithms/optimizers/gradient_descent.py b/qiskit_algorithms/optimizers/gradient_descent.py index 03911c21..0f744639 100644 --- a/qiskit_algorithms/optimizers/gradient_descent.py +++ b/qiskit_algorithms/optimizers/gradient_descent.py @@ -73,7 +73,7 @@ class GradientDescent(SteppableOptimizer): .. code-block:: python - from qiskit.algorithms.optimizers import GradientDescent + from qiskit_algorithms.optimizers import GradientDescent def f(x): return (np.linalg.norm(x) - 1) ** 2 @@ -93,7 +93,7 @@ def f(x): .. code-block:: python - from qiskit.algorithms.optimizers import GradientDescent + from qiskit_algorithms.optimizers import GradientDescent def learning_rate(): power = 0.6 @@ -129,7 +129,7 @@ def grad_f(x): import random import numpy as np - from qiskit.algorithms.optimizers import GradientDescent + from qiskit_algorithms.optimizers import GradientDescent def objective(x): if random.choice([True, False]): diff --git a/qiskit_algorithms/optimizers/optimizer.py b/qiskit_algorithms/optimizers/optimizer.py index e253167b..82e07f95 100644 --- a/qiskit_algorithms/optimizers/optimizer.py +++ b/qiskit_algorithms/optimizers/optimizer.py @@ -23,7 +23,7 @@ import numpy as np import scipy -from qiskit.algorithms.algorithm_result import AlgorithmResult +from qiskit_algorithms.algorithm_result import AlgorithmResult logger = logging.getLogger(__name__) diff --git a/qiskit_algorithms/optimizers/optimizer_utils/__init__.py b/qiskit_algorithms/optimizers/optimizer_utils/__init__.py index 33c5bc90..3e476318 100644 --- a/qiskit_algorithms/optimizers/optimizer_utils/__init__.py +++ b/qiskit_algorithms/optimizers/optimizer_utils/__init__.py @@ -11,7 +11,7 @@ # that they have been altered from the originals. """Utils for optimizers -Optimizer Utils (:mod:`qiskit.algorithms.optimizers.optimizer_utils`) +Optimizer Utils (:mod:`qiskit_algorithms.optimizers.optimizer_utils`) ===================================================================== .. autosummary:: diff --git a/qiskit_algorithms/optimizers/qnspsa.py b/qiskit_algorithms/optimizers/qnspsa.py index c9c19572..3e3a9838 100644 --- a/qiskit_algorithms/optimizers/qnspsa.py +++ b/qiskit_algorithms/optimizers/qnspsa.py @@ -25,7 +25,7 @@ from qiskit.utils.deprecation import deprecate_arg from qiskit.primitives import BaseSampler, Sampler -from qiskit.algorithms.state_fidelities import ComputeUncompute +from qiskit_algorithms.state_fidelities import ComputeUncompute from .spsa import SPSA, CALLBACK, TERMINATIONCHECKER, _batch_evaluate @@ -65,7 +65,7 @@ class QNSPSA(SPSA): .. code-block:: python import numpy as np - from qiskit.algorithms.optimizers import QNSPSA + from qiskit_algorithms.optimizers import QNSPSA from qiskit.circuit.library import PauliTwoDesign from qiskit.primitives import Estimator, Sampler from qiskit.quantum_info import Pauli @@ -96,7 +96,7 @@ def loss(x): .. code-block:: python import numpy as np - from qiskit.algorithms.optimizers import QNSPSA + from qiskit_algorithms.optimizers import QNSPSA from qiskit.circuit.library import PauliTwoDesign from qiskit.opflow import Z, StateFn @@ -358,7 +358,7 @@ class which implements the fidelity calculation in the same fashion as this meth F(\theta, \phi) = \big|\langle 0 | U^\dagger(\theta) U(\phi) |0\rangle \big|^2. The output of this function can be used as input for the ``fidelity`` to the - :class:~`qiskit.algorithms.optimizers.QNSPSA` optimizer. + :class:~`qiskit_algorithms.optimizers.QNSPSA` optimizer. Args: circuit: The circuit preparing the parameterized ansatz. diff --git a/qiskit_algorithms/optimizers/spsa.py b/qiskit_algorithms/optimizers/spsa.py index 0226f8a0..bf6c2b89 100644 --- a/qiskit_algorithms/optimizers/spsa.py +++ b/qiskit_algorithms/optimizers/spsa.py @@ -89,7 +89,7 @@ class SPSA(Optimizer): .. code-block:: python import numpy as np - from qiskit.algorithms.optimizers import SPSA + from qiskit_algorithms.optimizers import SPSA from qiskit.circuit.library import PauliTwoDesign from qiskit.opflow import Z, StateFn @@ -117,7 +117,7 @@ def loss(x): .. code-block:: python import numpy as np - from qiskit.algorithms.optimizers import SPSA + from qiskit_algorithms.optimizers import SPSA def objective(x): return np.linalg.norm(x) + .04*np.random.rand(1) diff --git a/qiskit_algorithms/optimizers/steppable_optimizer.py b/qiskit_algorithms/optimizers/steppable_optimizer.py index 0c2e73ce..6c6105af 100644 --- a/qiskit_algorithms/optimizers/steppable_optimizer.py +++ b/qiskit_algorithms/optimizers/steppable_optimizer.py @@ -102,7 +102,7 @@ class SteppableOptimizer(Optimizer): import random import numpy as np - from qiskit.algorithms.optimizers import GradientDescent + from qiskit_algorithms.optimizers import GradientDescent def objective(x): if random.choice([True, False]): diff --git a/qiskit_algorithms/optimizers/umda.py b/qiskit_algorithms/optimizers/umda.py index dd8739c2..4ed463f1 100644 --- a/qiskit_algorithms/optimizers/umda.py +++ b/qiskit_algorithms/optimizers/umda.py @@ -72,8 +72,8 @@ class UMDA(Optimizer): from qiskit.opflow import X, Z, I from qiskit import Aer - from qiskit.algorithms.optimizers import UMDA - from qiskit.algorithms import QAOA + from qiskit_algorithms.optimizers import UMDA + from qiskit_algorithms import QAOA from qiskit.utils import QuantumInstance diff --git a/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation.py b/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation.py index 87907c39..112e77e3 100644 --- a/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation.py +++ b/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation.py @@ -42,7 +42,7 @@ class HamiltonianPhaseEstimation: r"""Run the Quantum Phase Estimation algorithm to find the eigenvalues of a Hermitian operator. - This class is nearly the same as :class:`~qiskit.algorithms.PhaseEstimation`, differing only + This class is nearly the same as :class:`~qiskit_algorithms.PhaseEstimation`, differing only in that the input in that class is a unitary operator, whereas here the input is a Hermitian operator from which a unitary will be obtained by scaling and exponentiating. The scaling is performed in order to prevent the phases from wrapping around :math:`2\pi`. @@ -72,7 +72,7 @@ class HamiltonianPhaseEstimation: mapped to the same phase, :math:`\pi`, and so cannot be distinguished. In this case, you need to specify a larger bound as an argument to the method ``estimate``. - This class uses and works together with :class:`~qiskit.algorithms.PhaseEstimationScale` to + This class uses and works together with :class:`~qiskit_algorithms.PhaseEstimationScale` to manage scaling the Hamiltonian and the phases that are obtained by the QPE algorithm. This includes setting, or computing, a bound on the eigenvalues of the operator, using this bound to obtain a scale factor, scaling the operator, and shifting and scaling the measured diff --git a/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation_result.py b/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation_result.py index ce844427..28ebe320 100644 --- a/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation_result.py +++ b/qiskit_algorithms/phase_estimators/hamiltonian_phase_estimation_result.py @@ -16,7 +16,7 @@ from collections.abc import Mapping from typing import cast -from qiskit.algorithms.algorithm_result import AlgorithmResult +from qiskit_algorithms.algorithm_result import AlgorithmResult from .phase_estimation_result import PhaseEstimationResult from .phase_estimation_scale import PhaseEstimationScale diff --git a/qiskit_algorithms/phase_estimators/ipe.py b/qiskit_algorithms/phase_estimators/ipe.py index e8e58302..60a9310e 100644 --- a/qiskit_algorithms/phase_estimators/ipe.py +++ b/qiskit_algorithms/phase_estimators/ipe.py @@ -23,7 +23,7 @@ from qiskit.providers import Backend from qiskit.utils import QuantumInstance from qiskit.utils.deprecation import deprecate_arg -from qiskit.algorithms.exceptions import AlgorithmError +from qiskit_algorithms.exceptions import AlgorithmError from .phase_estimator import PhaseEstimator from .phase_estimator import PhaseEstimatorResult from ...primitives import BaseSampler diff --git a/qiskit_algorithms/phase_estimators/phase_estimation.py b/qiskit_algorithms/phase_estimators/phase_estimation.py index a3bc1d59..a2112a4a 100644 --- a/qiskit_algorithms/phase_estimators/phase_estimation.py +++ b/qiskit_algorithms/phase_estimators/phase_estimation.py @@ -25,7 +25,7 @@ from qiskit.utils import QuantumInstance from qiskit.utils.deprecation import deprecate_arg from qiskit.result import Result -from qiskit.algorithms.exceptions import AlgorithmError +from qiskit_algorithms.exceptions import AlgorithmError from .phase_estimation_result import PhaseEstimationResult, _sort_phases from .phase_estimator import PhaseEstimator from ...primitives import BaseSampler @@ -71,7 +71,7 @@ class PhaseEstimation(PhaseEstimator): In both estimation methods, the QPE circuit is run on a backend and the frequencies or counts of the phases represented by bitstrings are recorded. The results are returned as an instance of - :class:`~qiskit.algorithms.phase_estimator_result.PhaseEstimationResult`. + :class:`~qiskit_algorithms.phase_estimator_result.PhaseEstimationResult`. **Reference:** @@ -216,7 +216,7 @@ def estimate_from_pe_circuit( num_unitary_qubits: Must agree with the number of qubits in the unitary in `pe_circuit`. Returns: - An instance of qiskit.algorithms.phase_estimator_result.PhaseEstimationResult. + An instance of qiskit_algorithms.phase_estimator_result.PhaseEstimationResult. Raises: AlgorithmError: Primitive job failed. @@ -260,7 +260,7 @@ def estimate( computational basis. Returns: - An instance of qiskit.algorithms.phase_estimator_result.PhaseEstimationResult. + An instance of qiskit_algorithms.phase_estimator_result.PhaseEstimationResult. """ pe_circuit = self.construct_circuit(unitary, state_preparation) num_unitary_qubits = unitary.num_qubits diff --git a/qiskit_algorithms/phase_estimators/phase_estimator.py b/qiskit_algorithms/phase_estimators/phase_estimator.py index 09f8113e..884307fb 100644 --- a/qiskit_algorithms/phase_estimators/phase_estimator.py +++ b/qiskit_algorithms/phase_estimators/phase_estimator.py @@ -15,7 +15,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from qiskit.circuit import QuantumCircuit -from qiskit.algorithms.algorithm_result import AlgorithmResult +from qiskit_algorithms.algorithm_result import AlgorithmResult class PhaseEstimator(ABC): diff --git a/qiskit_algorithms/state_fidelities/__init__.py b/qiskit_algorithms/state_fidelities/__init__.py index ea8e4e03..df97b09b 100644 --- a/qiskit_algorithms/state_fidelities/__init__.py +++ b/qiskit_algorithms/state_fidelities/__init__.py @@ -11,10 +11,10 @@ # that they have been altered from the originals. """ ===================================================================== -State Fidelity Interfaces (:mod:`qiskit.algorithms.state_fidelities`) +State Fidelity Interfaces (:mod:`qiskit_algorithms.state_fidelities`) ===================================================================== -.. currentmodule:: qiskit.algorithms.state_fidelities +.. currentmodule:: qiskit_algorithms.state_fidelities State Fidelities ================ diff --git a/qiskit_algorithms/time_evolvers/pvqd/pvqd.py b/qiskit_algorithms/time_evolvers/pvqd/pvqd.py index ea3d82dc..89a0a3fa 100644 --- a/qiskit_algorithms/time_evolvers/pvqd/pvqd.py +++ b/qiskit_algorithms/time_evolvers/pvqd/pvqd.py @@ -73,12 +73,12 @@ class PVQD(RealTimeEvolver): import numpy as np - from qiskit.algorithms.state_fidelities import ComputeUncompute - from qiskit.algorithms.time_evolvers import TimeEvolutionProblem, PVQD + from qiskit_algorithms.state_fidelities import ComputeUncompute + from qiskit_algorithms.time_evolvers import TimeEvolutionProblem, PVQD from qiskit.primitives import Estimator, Sampler from qiskit.circuit.library import EfficientSU2 from qiskit.quantum_info import SparsePauliOp, Pauli - from qiskit.algorithms.optimizers import L_BFGS_B + from qiskit_algorithms.optimizers import L_BFGS_B sampler = Sampler() fidelity = ComputeUncompute(sampler) diff --git a/qiskit_algorithms/time_evolvers/time_evolution_result.py b/qiskit_algorithms/time_evolvers/time_evolution_result.py index 8741367f..ad142ddd 100644 --- a/qiskit_algorithms/time_evolvers/time_evolution_result.py +++ b/qiskit_algorithms/time_evolvers/time_evolution_result.py @@ -16,7 +16,7 @@ from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector -from qiskit.algorithms.list_or_dict import ListOrDict +from qiskit_algorithms.list_or_dict import ListOrDict from ..algorithm_result import AlgorithmResult diff --git a/qiskit_algorithms/time_evolvers/trotterization/__init__.py b/qiskit_algorithms/time_evolvers/trotterization/__init__.py index c5e7e128..1287ec37 100644 --- a/qiskit_algorithms/time_evolvers/trotterization/__init__.py +++ b/qiskit_algorithms/time_evolvers/trotterization/__init__.py @@ -24,6 +24,6 @@ TrotterQRTE """ -from qiskit.algorithms.time_evolvers.trotterization.trotter_qrte import TrotterQRTE +from qiskit_algorithms.time_evolvers.trotterization.trotter_qrte import TrotterQRTE __all__ = ["TrotterQRTE"] diff --git a/qiskit_algorithms/time_evolvers/trotterization/trotter_qrte.py b/qiskit_algorithms/time_evolvers/trotterization/trotter_qrte.py index cb43e297..d217f12b 100644 --- a/qiskit_algorithms/time_evolvers/trotterization/trotter_qrte.py +++ b/qiskit_algorithms/time_evolvers/trotterization/trotter_qrte.py @@ -15,10 +15,10 @@ from __future__ import annotations from qiskit import QuantumCircuit -from qiskit.algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem -from qiskit.algorithms.time_evolvers.time_evolution_result import TimeEvolutionResult -from qiskit.algorithms.time_evolvers.real_time_evolver import RealTimeEvolver -from qiskit.algorithms.observables_evaluator import estimate_observables +from qiskit_algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem +from qiskit_algorithms.time_evolvers.time_evolution_result import TimeEvolutionResult +from qiskit_algorithms.time_evolvers.real_time_evolver import RealTimeEvolver +from qiskit_algorithms.observables_evaluator import estimate_observables from qiskit.opflow import PauliSumOp from qiskit.circuit.library import PauliEvolutionGate from qiskit.circuit.parametertable import ParameterView @@ -38,8 +38,8 @@ class TrotterQRTE(RealTimeEvolver): from qiskit.opflow import PauliSumOp from qiskit.quantum_info import Pauli, SparsePauliOp from qiskit import QuantumCircuit - from qiskit.algorithms import TimeEvolutionProblem - from qiskit.algorithms.time_evolvers import TrotterQRTE + from qiskit_algorithms import TimeEvolutionProblem + from qiskit_algorithms.time_evolvers import TrotterQRTE from qiskit.primitives import Estimator operator = PauliSumOp(SparsePauliOp([Pauli("X"), Pauli("Z")])) diff --git a/qiskit_algorithms/time_evolvers/variational/__init__.py b/qiskit_algorithms/time_evolvers/variational/__init__.py index ae22bca5..67e7e528 100644 --- a/qiskit_algorithms/time_evolvers/variational/__init__.py +++ b/qiskit_algorithms/time_evolvers/variational/__init__.py @@ -10,14 +10,14 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. """ -Variational Quantum Time Evolutions (:mod:`qiskit.algorithms.time_evolvers.variational`) +Variational Quantum Time Evolutions (:mod:`qiskit_algorithms.time_evolvers.variational`) ======================================================================================== Algorithms for performing Variational Quantum Time Evolution of quantum states, which can be tailored to near-term devices. -:class:`~qiskit.algorithms.time_evolvers.variational.VarQTE` base class exposes an interface, compliant +:class:`~qiskit_algorithms.time_evolvers.variational.VarQTE` base class exposes an interface, compliant with the Quantum Time Evolution Framework in Qiskit Terra, that is implemented by -:class:`~qiskit.algorithms.VarQRTE` and :class:`~qiskit.algorithms.VarQITE` classes for real and +:class:`~qiskit_algorithms.VarQRTE` and :class:`~qiskit_algorithms.VarQITE` classes for real and imaginary time evolution respectively. The variational approach is taken according to a variational principle chosen by a user. @@ -27,8 +27,8 @@ import numpy as np - from qiskit.algorithms import TimeEvolutionProblem, VarQITE - from qiskit.algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple + from qiskit_algorithms import TimeEvolutionProblem, VarQITE + from qiskit_algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple from qiskit.circuit.library import EfficientSU2 from qiskit.quantum_info import SparsePauliOp @@ -53,7 +53,7 @@ var_qite = VarQITE(ansatz, var_principle, init_param_values) evolution_result = var_qite.evolve(evolution_problem) -.. currentmodule:: qiskit.algorithms.time_evolvers.variational +.. currentmodule:: qiskit_algorithms.time_evolvers.variational Variational Principles ---------------------- diff --git a/qiskit_algorithms/time_evolvers/variational/solvers/__init__.py b/qiskit_algorithms/time_evolvers/variational/solvers/__init__.py index b4537b41..13b92ac2 100644 --- a/qiskit_algorithms/time_evolvers/variational/solvers/__init__.py +++ b/qiskit_algorithms/time_evolvers/variational/solvers/__init__.py @@ -11,7 +11,7 @@ # that they have been altered from the originals. """ -Solvers (:mod:`qiskit.algorithms.time_evolvers.variational.solvers`) +Solvers (:mod:`qiskit_algorithms.time_evolvers.variational.solvers`) ==================================================================== This package contains the necessary classes to solve systems of equations arising in the @@ -38,10 +38,10 @@ VarQTEOdeSolver """ -from qiskit.algorithms.time_evolvers.variational.solvers.ode.var_qte_ode_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.ode.var_qte_ode_solver import ( VarQTEOdeSolver, ) -from qiskit.algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( VarQTELinearSolver, ) diff --git a/qiskit_algorithms/time_evolvers/variational/var_qite.py b/qiskit_algorithms/time_evolvers/variational/var_qite.py index 4200389c..af771429 100644 --- a/qiskit_algorithms/time_evolvers/variational/var_qite.py +++ b/qiskit_algorithms/time_evolvers/variational/var_qite.py @@ -38,8 +38,8 @@ class VarQITE(VarQTE, ImaginaryTimeEvolver): import numpy as np - from qiskit.algorithms import TimeEvolutionProblem, VarQITE - from qiskit.algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple + from qiskit_algorithms import TimeEvolutionProblem, VarQITE + from qiskit_algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple from qiskit.circuit.library import EfficientSU2 from qiskit.quantum_info import SparsePauliOp, Pauli from qiskit.primitives import Estimator diff --git a/qiskit_algorithms/time_evolvers/variational/var_qrte.py b/qiskit_algorithms/time_evolvers/variational/var_qrte.py index f8305f64..7454cf10 100644 --- a/qiskit_algorithms/time_evolvers/variational/var_qrte.py +++ b/qiskit_algorithms/time_evolvers/variational/var_qrte.py @@ -38,9 +38,9 @@ class VarQRTE(VarQTE, RealTimeEvolver): import numpy as np - from qiskit.algorithms import TimeEvolutionProblem, VarQRTE + from qiskit_algorithms import TimeEvolutionProblem, VarQRTE from qiskit.circuit.library import EfficientSU2 - from qiskit.algorithms.time_evolvers.variational import RealMcLachlanPrinciple + from qiskit_algorithms.time_evolvers.variational import RealMcLachlanPrinciple from qiskit.quantum_info import SparsePauliOp from qiskit.quantum_info import SparsePauliOp, Pauli from qiskit.primitives import Estimator diff --git a/qiskit_algorithms/utils/__init__.py b/qiskit_algorithms/utils/__init__.py index 2b493962..e44acec5 100644 --- a/qiskit_algorithms/utils/__init__.py +++ b/qiskit_algorithms/utils/__init__.py @@ -10,7 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Common Qiskit algorithms utility functions.""" +"""Common qiskit_algorithms utility functions.""" from .validate_initial_point import validate_initial_point from .validate_bounds import validate_bounds diff --git a/qiskit_algorithms/utils/set_batching.py b/qiskit_algorithms/utils/set_batching.py index 225f50a6..82b0da11 100644 --- a/qiskit_algorithms/utils/set_batching.py +++ b/qiskit_algorithms/utils/set_batching.py @@ -12,7 +12,7 @@ """Set default batch sizes for the optimizers.""" -from qiskit.algorithms.optimizers import Optimizer, SPSA +from qiskit_algorithms.optimizers import Optimizer, SPSA def _set_default_batchsize(optimizer: Optimizer) -> bool: diff --git a/test/eigensolvers/test_numpy_eigensolver.py b/test/eigensolvers/test_numpy_eigensolver.py index 13f2f9a6..217a1f4e 100644 --- a/test/eigensolvers/test_numpy_eigensolver.py +++ b/test/eigensolvers/test_numpy_eigensolver.py @@ -18,8 +18,8 @@ import numpy as np from ddt import data, ddt -from qiskit.algorithms.eigensolvers import NumPyEigensolver -from qiskit.algorithms import AlgorithmError +from qiskit_algorithms.eigensolvers import NumPyEigensolver +from qiskit_algorithms import AlgorithmError from qiskit.opflow import PauliSumOp from qiskit.quantum_info import Operator, SparsePauliOp, Pauli, ScalarOp diff --git a/test/eigensolvers/test_vqd.py b/test/eigensolvers/test_vqd.py index a2520fce..c1963d05 100644 --- a/test/eigensolvers/test_vqd.py +++ b/test/eigensolvers/test_vqd.py @@ -19,10 +19,10 @@ from ddt import data, ddt from qiskit import QuantumCircuit -from qiskit.algorithms.eigensolvers import VQD, VQDResult -from qiskit.algorithms import AlgorithmError -from qiskit.algorithms.optimizers import COBYLA, L_BFGS_B, SLSQP, SPSA -from qiskit.algorithms.state_fidelities import ComputeUncompute +from qiskit_algorithms.eigensolvers import VQD, VQDResult +from qiskit_algorithms import AlgorithmError +from qiskit_algorithms.optimizers import COBYLA, L_BFGS_B, SLSQP, SPSA +from qiskit_algorithms.state_fidelities import ComputeUncompute from qiskit.circuit.library import TwoLocal, RealAmplitudes from qiskit.opflow import PauliSumOp from qiskit.primitives import Sampler, Estimator diff --git a/test/evolvers/test_evolution_problem.py b/test/evolvers/test_evolution_problem.py index dc9d45f5..8220462e 100644 --- a/test/evolvers/test_evolution_problem.py +++ b/test/evolvers/test_evolution_problem.py @@ -16,7 +16,7 @@ from ddt import data, ddt, unpack from numpy.testing import assert_raises -from qiskit.algorithms.evolvers.evolution_problem import EvolutionProblem +from qiskit_algorithms.evolvers.evolution_problem import EvolutionProblem from qiskit.circuit import Parameter from qiskit.opflow import Y, Z, One, X, Zero diff --git a/test/evolvers/test_evolution_result.py b/test/evolvers/test_evolution_result.py index 2fe40d8c..ca81b644 100644 --- a/test/evolvers/test_evolution_result.py +++ b/test/evolvers/test_evolution_result.py @@ -13,7 +13,7 @@ import unittest from test.python.algorithms import QiskitAlgorithmsTestCase -from qiskit.algorithms.evolvers.evolution_result import EvolutionResult +from qiskit_algorithms.evolvers.evolution_result import EvolutionResult from qiskit.opflow import Zero diff --git a/test/evolvers/trotterization/test_trotter_qrte.py b/test/evolvers/trotterization/test_trotter_qrte.py index 077957d8..1ee2c924 100644 --- a/test/evolvers/trotterization/test_trotter_qrte.py +++ b/test/evolvers/trotterization/test_trotter_qrte.py @@ -19,8 +19,8 @@ from numpy.testing import assert_raises from qiskit import BasicAer, QuantumCircuit -from qiskit.algorithms import EvolutionProblem -from qiskit.algorithms.evolvers.trotterization import ( +from qiskit_algorithms import EvolutionProblem +from qiskit_algorithms.evolvers.trotterization import ( TrotterQRTE, ) from qiskit.circuit.library import ZGate diff --git a/test/gradients/test_estimator_gradient.py b/test/gradients/test_estimator_gradient.py index c8445031..62d19c1c 100644 --- a/test/gradients/test_estimator_gradient.py +++ b/test/gradients/test_estimator_gradient.py @@ -19,7 +19,7 @@ from ddt import ddt, data, unpack from qiskit import QuantumCircuit -from qiskit.algorithms.gradients import ( +from qiskit_algorithms.gradients import ( FiniteDiffEstimatorGradient, LinCombEstimatorGradient, ParamShiftEstimatorGradient, diff --git a/test/gradients/test_qfi.py b/test/gradients/test_qfi.py index b0d05ac7..deaf4cc3 100644 --- a/test/gradients/test_qfi.py +++ b/test/gradients/test_qfi.py @@ -19,7 +19,7 @@ import numpy as np from qiskit import QuantumCircuit -from qiskit.algorithms.gradients import LinCombQGT, ReverseQGT, QFI, DerivativeType +from qiskit_algorithms.gradients import LinCombQGT, ReverseQGT, QFI, DerivativeType from qiskit.circuit import Parameter from qiskit.circuit.parametervector import ParameterVector from qiskit.primitives import Estimator diff --git a/test/gradients/test_qgt.py b/test/gradients/test_qgt.py index 74f22d46..1f3c33d8 100644 --- a/test/gradients/test_qgt.py +++ b/test/gradients/test_qgt.py @@ -19,7 +19,7 @@ import numpy as np from qiskit import QuantumCircuit -from qiskit.algorithms.gradients import DerivativeType, LinCombQGT, ReverseQGT +from qiskit_algorithms.gradients import DerivativeType, LinCombQGT, ReverseQGT from qiskit.circuit import Parameter from qiskit.circuit.library import RealAmplitudes from qiskit.primitives import Estimator diff --git a/test/gradients/test_sampler_gradient.py b/test/gradients/test_sampler_gradient.py index b4caac07..f221b631 100644 --- a/test/gradients/test_sampler_gradient.py +++ b/test/gradients/test_sampler_gradient.py @@ -20,7 +20,7 @@ from ddt import ddt, data from qiskit import QuantumCircuit -from qiskit.algorithms.gradients import ( +from qiskit_algorithms.gradients import ( FiniteDiffSamplerGradient, LinCombSamplerGradient, ParamShiftSamplerGradient, diff --git a/test/minimum_eigensolvers/test_adapt_vqe.py b/test/minimum_eigensolvers/test_adapt_vqe.py index ea019825..2092d2de 100644 --- a/test/minimum_eigensolvers/test_adapt_vqe.py +++ b/test/minimum_eigensolvers/test_adapt_vqe.py @@ -19,9 +19,9 @@ import numpy as np -from qiskit.algorithms.minimum_eigensolvers import VQE -from qiskit.algorithms.minimum_eigensolvers.adapt_vqe import AdaptVQE, TerminationCriterion -from qiskit.algorithms.optimizers import SLSQP +from qiskit_algorithms.minimum_eigensolvers import VQE +from qiskit_algorithms.minimum_eigensolvers.adapt_vqe import AdaptVQE, TerminationCriterion +from qiskit_algorithms.optimizers import SLSQP from qiskit.circuit import QuantumCircuit, QuantumRegister from qiskit.circuit.library import EvolvedOperatorAnsatz from qiskit.opflow import PauliSumOp diff --git a/test/minimum_eigensolvers/test_numpy_minimum_eigensolver.py b/test/minimum_eigensolvers/test_numpy_minimum_eigensolver.py index f5724f77..8e06251c 100644 --- a/test/minimum_eigensolvers/test_numpy_minimum_eigensolver.py +++ b/test/minimum_eigensolvers/test_numpy_minimum_eigensolver.py @@ -18,7 +18,7 @@ import numpy as np from ddt import ddt, data -from qiskit.algorithms.minimum_eigensolvers import NumPyMinimumEigensolver +from qiskit_algorithms.minimum_eigensolvers import NumPyMinimumEigensolver from qiskit.opflow import PauliSumOp from qiskit.quantum_info import Operator, SparsePauliOp diff --git a/test/minimum_eigensolvers/test_qaoa.py b/test/minimum_eigensolvers/test_qaoa.py index 87f67128..d9551342 100644 --- a/test/minimum_eigensolvers/test_qaoa.py +++ b/test/minimum_eigensolvers/test_qaoa.py @@ -22,8 +22,8 @@ from scipy.optimize import minimize as scipy_minimize from qiskit import QuantumCircuit -from qiskit.algorithms.minimum_eigensolvers import QAOA -from qiskit.algorithms.optimizers import COBYLA, NELDER_MEAD +from qiskit_algorithms.minimum_eigensolvers import QAOA +from qiskit_algorithms.optimizers import COBYLA, NELDER_MEAD from qiskit.circuit import Parameter from qiskit.primitives import Sampler from qiskit.quantum_info import Pauli, SparsePauliOp diff --git a/test/minimum_eigensolvers/test_qaoa_opflow.py b/test/minimum_eigensolvers/test_qaoa_opflow.py index fece9e19..714b8c47 100644 --- a/test/minimum_eigensolvers/test_qaoa_opflow.py +++ b/test/minimum_eigensolvers/test_qaoa_opflow.py @@ -24,8 +24,8 @@ import rustworkx as rx from qiskit import QuantumCircuit -from qiskit.algorithms.minimum_eigensolvers import QAOA -from qiskit.algorithms.optimizers import COBYLA, NELDER_MEAD +from qiskit_algorithms.minimum_eigensolvers import QAOA +from qiskit_algorithms.optimizers import COBYLA, NELDER_MEAD from qiskit.circuit import Parameter from qiskit.opflow import PauliSumOp from qiskit.quantum_info import Pauli diff --git a/test/minimum_eigensolvers/test_sampling_vqe.py b/test/minimum_eigensolvers/test_sampling_vqe.py index 8e364e38..38a49942 100644 --- a/test/minimum_eigensolvers/test_sampling_vqe.py +++ b/test/minimum_eigensolvers/test_sampling_vqe.py @@ -21,10 +21,10 @@ from ddt import data, ddt from scipy.optimize import minimize as scipy_minimize -from qiskit.algorithms import AlgorithmError -from qiskit.algorithms.minimum_eigensolvers import SamplingVQE -from qiskit.algorithms.optimizers import L_BFGS_B, QNSPSA, SLSQP, OptimizerResult -from qiskit.algorithms.state_fidelities import ComputeUncompute +from qiskit_algorithms import AlgorithmError +from qiskit_algorithms.minimum_eigensolvers import SamplingVQE +from qiskit_algorithms.optimizers import L_BFGS_B, QNSPSA, SLSQP, OptimizerResult +from qiskit_algorithms.state_fidelities import ComputeUncompute from qiskit.circuit import ParameterVector, QuantumCircuit from qiskit.circuit.library import RealAmplitudes, TwoLocal from qiskit.opflow import PauliSumOp diff --git a/test/minimum_eigensolvers/test_vqe.py b/test/minimum_eigensolvers/test_vqe.py index 4e61aa89..d3263f73 100644 --- a/test/minimum_eigensolvers/test_vqe.py +++ b/test/minimum_eigensolvers/test_vqe.py @@ -21,10 +21,10 @@ from ddt import data, ddt from qiskit import QuantumCircuit -from qiskit.algorithms import AlgorithmError -from qiskit.algorithms.gradients import ParamShiftEstimatorGradient -from qiskit.algorithms.minimum_eigensolvers import VQE -from qiskit.algorithms.optimizers import ( +from qiskit_algorithms import AlgorithmError +from qiskit_algorithms.gradients import ParamShiftEstimatorGradient +from qiskit_algorithms.minimum_eigensolvers import VQE +from qiskit_algorithms.optimizers import ( CG, COBYLA, GradientDescent, @@ -36,7 +36,7 @@ SPSA, TNC, ) -from qiskit.algorithms.state_fidelities import ComputeUncompute +from qiskit_algorithms.state_fidelities import ComputeUncompute from qiskit.circuit.library import RealAmplitudes, TwoLocal from qiskit.opflow import PauliSumOp, TwoQubitReduction from qiskit.quantum_info import SparsePauliOp, Operator, Pauli diff --git a/test/optimizers/test_gradient_descent.py b/test/optimizers/test_gradient_descent.py index 8d239665..6e901373 100644 --- a/test/optimizers/test_gradient_descent.py +++ b/test/optimizers/test_gradient_descent.py @@ -14,8 +14,8 @@ from test.python.algorithms import QiskitAlgorithmsTestCase import numpy as np -from qiskit.algorithms.optimizers import GradientDescent, GradientDescentState -from qiskit.algorithms.optimizers.steppable_optimizer import TellData, AskData +from qiskit_algorithms.optimizers import GradientDescent, GradientDescentState +from qiskit_algorithms.optimizers.steppable_optimizer import TellData, AskData from qiskit.circuit.library import PauliTwoDesign from qiskit.opflow import I, Z, StateFn diff --git a/test/optimizers/test_optimizer_aqgd.py b/test/optimizers/test_optimizer_aqgd.py index 7eebf6bc..655d6606 100644 --- a/test/optimizers/test_optimizer_aqgd.py +++ b/test/optimizers/test_optimizer_aqgd.py @@ -17,8 +17,8 @@ from qiskit.circuit.library import RealAmplitudes from qiskit.utils import QuantumInstance, algorithm_globals, optionals from qiskit.opflow import PauliSumOp -from qiskit.algorithms.optimizers import AQGD -from qiskit.algorithms import VQE, AlgorithmError +from qiskit_algorithms.optimizers import AQGD +from qiskit_algorithms import VQE, AlgorithmError from qiskit.opflow.gradients import Gradient from qiskit.test import slow_test diff --git a/test/optimizers/test_optimizer_nft.py b/test/optimizers/test_optimizer_nft.py index 31a29f4a..aa79dd5c 100644 --- a/test/optimizers/test_optimizer_nft.py +++ b/test/optimizers/test_optimizer_nft.py @@ -18,8 +18,8 @@ from qiskit.circuit.library import RealAmplitudes from qiskit.utils import QuantumInstance, algorithm_globals from qiskit.opflow import PauliSumOp -from qiskit.algorithms.optimizers import NFT -from qiskit.algorithms import VQE +from qiskit_algorithms.optimizers import NFT +from qiskit_algorithms import VQE class TestOptimizerNFT(QiskitAlgorithmsTestCase): diff --git a/test/optimizers/test_optimizers.py b/test/optimizers/test_optimizers.py index c8b65db0..6573c401 100644 --- a/test/optimizers/test_optimizers.py +++ b/test/optimizers/test_optimizers.py @@ -20,7 +20,7 @@ import numpy as np from scipy.optimize import rosen, rosen_der -from qiskit.algorithms.optimizers import ( +from qiskit_algorithms.optimizers import ( ADAM, AQGD, BOBYQA, diff --git a/test/optimizers/test_optimizers_scikitquant.py b/test/optimizers/test_optimizers_scikitquant.py index a980b046..63e9c4f6 100644 --- a/test/optimizers/test_optimizers_scikitquant.py +++ b/test/optimizers/test_optimizers_scikitquant.py @@ -23,8 +23,8 @@ from qiskit.utils import QuantumInstance, algorithm_globals from qiskit.exceptions import MissingOptionalLibraryError from qiskit.opflow import PauliSumOp -from qiskit.algorithms import VQE -from qiskit.algorithms.optimizers import BOBYQA, SNOBFIT, IMFIL +from qiskit_algorithms import VQE +from qiskit_algorithms.optimizers import BOBYQA, SNOBFIT, IMFIL @ddt diff --git a/test/optimizers/test_spsa.py b/test/optimizers/test_spsa.py index 7204a25e..23b0a53c 100644 --- a/test/optimizers/test_spsa.py +++ b/test/optimizers/test_spsa.py @@ -17,7 +17,7 @@ import numpy as np -from qiskit.algorithms.optimizers import SPSA, QNSPSA +from qiskit_algorithms.optimizers import SPSA, QNSPSA from qiskit.circuit.library import PauliTwoDesign from qiskit.primitives import Estimator, Sampler from qiskit.providers.basicaer import StatevectorSimulatorPy diff --git a/test/optimizers/test_umda.py b/test/optimizers/test_umda.py index e33e11bd..608e6607 100644 --- a/test/optimizers/test_umda.py +++ b/test/optimizers/test_umda.py @@ -17,7 +17,7 @@ import numpy as np from scipy.optimize import rosen -from qiskit.algorithms.optimizers.umda import UMDA +from qiskit_algorithms.optimizers.umda import UMDA from qiskit.utils import algorithm_globals diff --git a/test/optimizers/utils/test_learning_rate.py b/test/optimizers/utils/test_learning_rate.py index 52acdbf9..ceaeee85 100644 --- a/test/optimizers/utils/test_learning_rate.py +++ b/test/optimizers/utils/test_learning_rate.py @@ -14,7 +14,7 @@ from test.python.algorithms import QiskitAlgorithmsTestCase import numpy as np -from qiskit.algorithms.optimizers.optimizer_utils import LearningRate +from qiskit_algorithms.optimizers.optimizer_utils import LearningRate class TestLearningRate(QiskitAlgorithmsTestCase): diff --git a/test/state_fidelities/test_compute_uncompute.py b/test/state_fidelities/test_compute_uncompute.py index f3b106d9..c7346caa 100644 --- a/test/state_fidelities/test_compute_uncompute.py +++ b/test/state_fidelities/test_compute_uncompute.py @@ -19,7 +19,7 @@ from qiskit.circuit import QuantumCircuit, ParameterVector from qiskit.circuit.library import RealAmplitudes from qiskit.primitives import Sampler -from qiskit.algorithms.state_fidelities import ComputeUncompute +from qiskit_algorithms.state_fidelities import ComputeUncompute from qiskit.test import QiskitTestCase diff --git a/test/test_amplitude_estimators.py b/test/test_amplitude_estimators.py index ea0a1af0..1824ead6 100644 --- a/test/test_amplitude_estimators.py +++ b/test/test_amplitude_estimators.py @@ -19,7 +19,7 @@ from qiskit import QuantumRegister, QuantumCircuit, BasicAer from qiskit.circuit.library import QFT, GroverOperator from qiskit.utils import QuantumInstance -from qiskit.algorithms import ( +from qiskit_algorithms import ( AmplitudeEstimation, MaximumLikelihoodAmplitudeEstimation, IterativeAmplitudeEstimation, diff --git a/test/test_aux_ops_evaluator.py b/test/test_aux_ops_evaluator.py index 11e4c8e7..3c140168 100644 --- a/test/test_aux_ops_evaluator.py +++ b/test/test_aux_ops_evaluator.py @@ -18,10 +18,10 @@ import numpy as np from ddt import ddt, data -from qiskit.algorithms.list_or_dict import ListOrDict +from qiskit_algorithms.list_or_dict import ListOrDict from qiskit.providers import Backend from qiskit.quantum_info import Statevector -from qiskit.algorithms import eval_observables +from qiskit_algorithms import eval_observables from qiskit import BasicAer, QuantumCircuit from qiskit.circuit.library import EfficientSU2 from qiskit.opflow import ( diff --git a/test/test_backendv1.py b/test/test_backendv1.py index 2dd8ca33..dce4cd5c 100644 --- a/test/test_backendv1.py +++ b/test/test_backendv1.py @@ -17,9 +17,9 @@ from qiskit import QuantumCircuit from qiskit.providers.fake_provider import FakeProvider from qiskit.utils import QuantumInstance, algorithm_globals -from qiskit.algorithms import VQE, Grover, AmplificationProblem +from qiskit_algorithms import VQE, Grover, AmplificationProblem from qiskit.opflow import X, Z, I -from qiskit.algorithms.optimizers import SPSA +from qiskit_algorithms.optimizers import SPSA from qiskit.circuit.library import TwoLocal, EfficientSU2 from qiskit.utils.mitigation import CompleteMeasFitter diff --git a/test/test_backendv2.py b/test/test_backendv2.py index 0987a631..5e809e49 100644 --- a/test/test_backendv2.py +++ b/test/test_backendv2.py @@ -18,9 +18,9 @@ from qiskit.providers.fake_provider import FakeProvider from qiskit.providers.fake_provider.fake_backend_v2 import FakeBackendSimple from qiskit.utils import QuantumInstance -from qiskit.algorithms import VQE, Grover, AmplificationProblem +from qiskit_algorithms import VQE, Grover, AmplificationProblem from qiskit.opflow import X, Z, I -from qiskit.algorithms.optimizers import SPSA +from qiskit_algorithms.optimizers import SPSA from qiskit.circuit.library import TwoLocal diff --git a/test/test_grover.py b/test/test_grover.py index 8fdeb12a..58815973 100644 --- a/test/test_grover.py +++ b/test/test_grover.py @@ -20,7 +20,7 @@ from ddt import data, ddt, idata, unpack from qiskit import BasicAer, QuantumCircuit -from qiskit.algorithms import AmplificationProblem, Grover +from qiskit_algorithms import AmplificationProblem, Grover from qiskit.circuit.library import GroverOperator, PhaseOracle from qiskit.primitives import Sampler from qiskit.quantum_info import Operator, Statevector diff --git a/test/test_measure_error_mitigation.py b/test/test_measure_error_mitigation.py index a252ab08..849ad78f 100644 --- a/test/test_measure_error_mitigation.py +++ b/test/test_measure_error_mitigation.py @@ -21,9 +21,9 @@ from qiskit.quantum_info import Pauli from qiskit.exceptions import QiskitError from qiskit.utils import QuantumInstance, algorithm_globals -from qiskit.algorithms import VQE, QAOA +from qiskit_algorithms import VQE, QAOA from qiskit.opflow import I, X, Z, PauliSumOp -from qiskit.algorithms.optimizers import SPSA, COBYLA +from qiskit_algorithms.optimizers import SPSA, COBYLA from qiskit.circuit.library import EfficientSU2 from qiskit.utils.mitigation import CompleteMeasFitter, TensoredMeasFitter from qiskit.utils.measurement_error_mitigation import build_measurement_error_mitigation_circuits diff --git a/test/test_numpy_eigen_solver.py b/test/test_numpy_eigen_solver.py index 36d2b661..e1db842e 100644 --- a/test/test_numpy_eigen_solver.py +++ b/test/test_numpy_eigen_solver.py @@ -18,7 +18,7 @@ import numpy as np from ddt import data, ddt -from qiskit.algorithms import NumPyEigensolver +from qiskit_algorithms import NumPyEigensolver from qiskit.opflow import PauliSumOp, X, Y, Z diff --git a/test/test_numpy_minimum_eigen_solver.py b/test/test_numpy_minimum_eigen_solver.py index 8f50d573..66b1e9a1 100644 --- a/test/test_numpy_minimum_eigen_solver.py +++ b/test/test_numpy_minimum_eigen_solver.py @@ -18,7 +18,7 @@ import numpy as np from ddt import ddt, data -from qiskit.algorithms import NumPyMinimumEigensolver +from qiskit_algorithms import NumPyMinimumEigensolver from qiskit.opflow import PauliSumOp, X, Y, Z diff --git a/test/test_observables_evaluator.py b/test/test_observables_evaluator.py index f4df4ba4..00c47408 100644 --- a/test/test_observables_evaluator.py +++ b/test/test_observables_evaluator.py @@ -20,9 +20,9 @@ import numpy as np from ddt import ddt, data -from qiskit.algorithms.list_or_dict import ListOrDict +from qiskit_algorithms.list_or_dict import ListOrDict from qiskit.quantum_info.operators.base_operator import BaseOperator -from qiskit.algorithms import estimate_observables +from qiskit_algorithms import estimate_observables from qiskit.primitives import Estimator from qiskit.quantum_info import Statevector, SparsePauliOp from qiskit import QuantumCircuit diff --git a/test/test_phase_estimator.py b/test/test_phase_estimator.py index 9040bc1d..07e27a0a 100644 --- a/test/test_phase_estimator.py +++ b/test/test_phase_estimator.py @@ -20,8 +20,8 @@ from qiskit.quantum_info import Pauli, SparsePauliOp, Statevector, Operator from qiskit.synthesis import MatrixExponential, SuzukiTrotter from qiskit.primitives import Sampler -from qiskit.algorithms import PhaseEstimationScale -from qiskit.algorithms.phase_estimators import ( +from qiskit_algorithms import PhaseEstimationScale +from qiskit_algorithms.phase_estimators import ( PhaseEstimation, HamiltonianPhaseEstimation, IterativePhaseEstimation, diff --git a/test/test_qaoa.py b/test/test_qaoa.py index 7c743af7..b409099e 100644 --- a/test/test_qaoa.py +++ b/test/test_qaoa.py @@ -22,8 +22,8 @@ from ddt import ddt, idata, unpack import rustworkx as rx -from qiskit.algorithms import QAOA -from qiskit.algorithms.optimizers import COBYLA, NELDER_MEAD +from qiskit_algorithms import QAOA +from qiskit_algorithms.optimizers import COBYLA, NELDER_MEAD from qiskit.opflow import I, X, Z, PauliSumOp diff --git a/test/test_vqd.py b/test/test_vqd.py index 10ac4010..aa1bed28 100644 --- a/test/test_vqd.py +++ b/test/test_vqd.py @@ -19,8 +19,8 @@ from ddt import data, ddt, unpack from qiskit import BasicAer, QuantumCircuit -from qiskit.algorithms import VQD, AlgorithmError -from qiskit.algorithms.optimizers import ( +from qiskit_algorithms import VQD, AlgorithmError +from qiskit_algorithms.optimizers import ( COBYLA, L_BFGS_B, SLSQP, diff --git a/test/test_vqe.py b/test/test_vqe.py index c9fee954..0e9a0bec 100644 --- a/test/test_vqe.py +++ b/test/test_vqe.py @@ -23,8 +23,8 @@ from ddt import data, ddt, unpack from qiskit import BasicAer, QuantumCircuit -from qiskit.algorithms import VQE, AlgorithmError -from qiskit.algorithms.optimizers import ( +from qiskit_algorithms import VQE, AlgorithmError +from qiskit_algorithms.optimizers import ( CG, COBYLA, L_BFGS_B, diff --git a/test/time_evolvers/classical_methods/test_scipy_imaginary_evolver.py b/test/time_evolvers/classical_methods/test_scipy_imaginary_evolver.py index 5671bf22..e104392f 100644 --- a/test/time_evolvers/classical_methods/test_scipy_imaginary_evolver.py +++ b/test/time_evolvers/classical_methods/test_scipy_imaginary_evolver.py @@ -15,13 +15,13 @@ from test.python.algorithms import QiskitAlgorithmsTestCase from ddt import data, ddt, unpack import numpy as np -from qiskit.algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem +from qiskit_algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem from qiskit.quantum_info.states.statevector import Statevector from qiskit.quantum_info import SparsePauliOp from qiskit import QuantumCircuit -from qiskit.algorithms import SciPyImaginaryEvolver +from qiskit_algorithms import SciPyImaginaryEvolver from qiskit.opflow import PauliSumOp diff --git a/test/time_evolvers/classical_methods/test_scipy_real_evolver.py b/test/time_evolvers/classical_methods/test_scipy_real_evolver.py index 40fb1e1e..914dca0f 100644 --- a/test/time_evolvers/classical_methods/test_scipy_real_evolver.py +++ b/test/time_evolvers/classical_methods/test_scipy_real_evolver.py @@ -16,7 +16,7 @@ from ddt import data, ddt, unpack import numpy as np from qiskit import QuantumCircuit, QuantumRegister -from qiskit.algorithms import SciPyRealEvolver, TimeEvolutionProblem +from qiskit_algorithms import SciPyRealEvolver, TimeEvolutionProblem from qiskit.quantum_info import Statevector, SparsePauliOp diff --git a/test/time_evolvers/test_pvqd.py b/test/time_evolvers/test_pvqd.py index f0e3b3ae..9c196c7c 100644 --- a/test/time_evolvers/test_pvqd.py +++ b/test/time_evolvers/test_pvqd.py @@ -19,10 +19,10 @@ from ddt import data, ddt, unpack from qiskit import QiskitError -from qiskit.algorithms.time_evolvers import TimeEvolutionProblem -from qiskit.algorithms.optimizers import L_BFGS_B, SPSA, GradientDescent, OptimizerResult -from qiskit.algorithms.state_fidelities import ComputeUncompute -from qiskit.algorithms.time_evolvers.pvqd import PVQD +from qiskit_algorithms.time_evolvers import TimeEvolutionProblem +from qiskit_algorithms.optimizers import L_BFGS_B, SPSA, GradientDescent, OptimizerResult +from qiskit_algorithms.state_fidelities import ComputeUncompute +from qiskit_algorithms.time_evolvers.pvqd import PVQD from qiskit.circuit import Gate, Parameter, QuantumCircuit from qiskit.circuit.library import EfficientSU2 from qiskit.opflow import PauliSumOp diff --git a/test/time_evolvers/test_time_evolution_problem.py b/test/time_evolvers/test_time_evolution_problem.py index 1982fb20..c60f0443 100644 --- a/test/time_evolvers/test_time_evolution_problem.py +++ b/test/time_evolvers/test_time_evolution_problem.py @@ -16,7 +16,7 @@ from ddt import data, ddt from numpy.testing import assert_raises from qiskit import QuantumCircuit -from qiskit.algorithms import TimeEvolutionProblem +from qiskit_algorithms import TimeEvolutionProblem from qiskit.quantum_info import Pauli, SparsePauliOp, Statevector from qiskit.circuit import Parameter from qiskit.opflow import Y, Z, One, X, Zero, PauliSumOp diff --git a/test/time_evolvers/test_time_evolution_result.py b/test/time_evolvers/test_time_evolution_result.py index 26f21ba9..9e311fff 100644 --- a/test/time_evolvers/test_time_evolution_result.py +++ b/test/time_evolvers/test_time_evolution_result.py @@ -12,7 +12,7 @@ """Class for testing evolution result.""" import unittest from test.python.algorithms import QiskitAlgorithmsTestCase -from qiskit.algorithms import TimeEvolutionResult +from qiskit_algorithms import TimeEvolutionResult from qiskit.opflow import Zero diff --git a/test/time_evolvers/test_trotter_qrte.py b/test/time_evolvers/test_trotter_qrte.py index c784d2e3..25032949 100644 --- a/test/time_evolvers/test_trotter_qrte.py +++ b/test/time_evolvers/test_trotter_qrte.py @@ -19,7 +19,7 @@ from scipy.linalg import expm from numpy.testing import assert_raises -from qiskit.algorithms.time_evolvers import TimeEvolutionProblem, TrotterQRTE +from qiskit_algorithms.time_evolvers import TimeEvolutionProblem, TrotterQRTE from qiskit.primitives import Estimator from qiskit import QuantumCircuit from qiskit.circuit.library import ZGate diff --git a/test/time_evolvers/variational/solvers/ode/test_forward_euler_solver.py b/test/time_evolvers/variational/solvers/ode/test_forward_euler_solver.py index 802f9309..c4d1cbad 100644 --- a/test/time_evolvers/variational/solvers/ode/test_forward_euler_solver.py +++ b/test/time_evolvers/variational/solvers/ode/test_forward_euler_solver.py @@ -18,7 +18,7 @@ from ddt import ddt, data, unpack from scipy.integrate import solve_ivp -from qiskit.algorithms.time_evolvers.variational.solvers.ode.forward_euler_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.ode.forward_euler_solver import ( ForwardEulerSolver, ) diff --git a/test/time_evolvers/variational/solvers/ode/test_ode_function.py b/test/time_evolvers/variational/solvers/ode/test_ode_function.py index e680f450..6331c2f4 100644 --- a/test/time_evolvers/variational/solvers/ode/test_ode_function.py +++ b/test/time_evolvers/variational/solvers/ode/test_ode_function.py @@ -18,13 +18,13 @@ import numpy as np from qiskit.quantum_info import SparsePauliOp from qiskit.circuit import Parameter -from qiskit.algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( VarQTELinearSolver, ) -from qiskit.algorithms.time_evolvers.variational.solvers.ode.ode_function import ( +from qiskit_algorithms.time_evolvers.variational.solvers.ode.ode_function import ( OdeFunction, ) -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms.time_evolvers.variational import ( ImaginaryMcLachlanPrinciple, ) from qiskit.circuit.library import EfficientSU2 diff --git a/test/time_evolvers/variational/solvers/ode/test_var_qte_ode_solver.py b/test/time_evolvers/variational/solvers/ode/test_var_qte_ode_solver.py index 4492b3cc..2b490fa9 100644 --- a/test/time_evolvers/variational/solvers/ode/test_var_qte_ode_solver.py +++ b/test/time_evolvers/variational/solvers/ode/test_var_qte_ode_solver.py @@ -18,19 +18,19 @@ import numpy as np from qiskit.quantum_info import SparsePauliOp -from qiskit.algorithms.time_evolvers.variational.solvers.ode.forward_euler_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.ode.forward_euler_solver import ( ForwardEulerSolver, ) -from qiskit.algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( VarQTELinearSolver, ) -from qiskit.algorithms.time_evolvers.variational.solvers.ode.var_qte_ode_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.ode.var_qte_ode_solver import ( VarQTEOdeSolver, ) -from qiskit.algorithms.time_evolvers.variational.solvers.ode.ode_function import ( +from qiskit_algorithms.time_evolvers.variational.solvers.ode.ode_function import ( OdeFunction, ) -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms.time_evolvers.variational import ( ImaginaryMcLachlanPrinciple, ) from qiskit.circuit.library import EfficientSU2 diff --git a/test/time_evolvers/variational/solvers/test_varqte_linear_solver.py b/test/time_evolvers/variational/solvers/test_varqte_linear_solver.py index 7b842b95..cfecf470 100644 --- a/test/time_evolvers/variational/solvers/test_varqte_linear_solver.py +++ b/test/time_evolvers/variational/solvers/test_varqte_linear_solver.py @@ -23,10 +23,10 @@ import numpy as np from qiskit.quantum_info import SparsePauliOp -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms.time_evolvers.variational import ( ImaginaryMcLachlanPrinciple, ) -from qiskit.algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( +from qiskit_algorithms.time_evolvers.variational.solvers.var_qte_linear_solver import ( VarQTELinearSolver, ) from qiskit.circuit.library import EfficientSU2 diff --git a/test/time_evolvers/variational/test_var_qite.py b/test/time_evolvers/variational/test_var_qite.py index 9c79a002..46898da4 100644 --- a/test/time_evolvers/variational/test_var_qite.py +++ b/test/time_evolvers/variational/test_var_qite.py @@ -19,12 +19,12 @@ from qiskit import QuantumCircuit from qiskit.circuit import Parameter -from qiskit.algorithms.gradients import LinCombQGT, LinCombEstimatorGradient +from qiskit_algorithms.gradients import LinCombQGT, LinCombEstimatorGradient from qiskit.primitives import Estimator from qiskit.quantum_info import SparsePauliOp, Pauli from qiskit.utils import algorithm_globals -from qiskit.algorithms import TimeEvolutionProblem, VarQITE -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms import TimeEvolutionProblem, VarQITE +from qiskit_algorithms.time_evolvers.variational import ( ImaginaryMcLachlanPrinciple, ) from qiskit.circuit.library import EfficientSU2 diff --git a/test/time_evolvers/variational/test_var_qrte.py b/test/time_evolvers/variational/test_var_qrte.py index b7dfaf59..9d881cd6 100644 --- a/test/time_evolvers/variational/test_var_qrte.py +++ b/test/time_evolvers/variational/test_var_qrte.py @@ -20,12 +20,12 @@ from qiskit import QuantumCircuit from qiskit.circuit import Parameter, ParameterVector -from qiskit.algorithms.gradients import LinCombQGT, DerivativeType, LinCombEstimatorGradient +from qiskit_algorithms.gradients import LinCombQGT, DerivativeType, LinCombEstimatorGradient from qiskit.primitives import Estimator from qiskit.utils import algorithm_globals from qiskit.quantum_info import SparsePauliOp, Pauli, Statevector -from qiskit.algorithms import TimeEvolutionProblem, VarQRTE -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms import TimeEvolutionProblem, VarQRTE +from qiskit_algorithms.time_evolvers.variational import ( RealMcLachlanPrinciple, ) from qiskit.circuit.library import EfficientSU2 diff --git a/test/time_evolvers/variational/test_var_qte.py b/test/time_evolvers/variational/test_var_qte.py index 4b92e4e4..c0843d31 100644 --- a/test/time_evolvers/variational/test_var_qte.py +++ b/test/time_evolvers/variational/test_var_qte.py @@ -18,7 +18,7 @@ from ddt import data, ddt import numpy as np -from qiskit.algorithms.time_evolvers.variational.var_qte import VarQTE +from qiskit_algorithms.time_evolvers.variational.var_qte import VarQTE from qiskit.circuit import Parameter diff --git a/test/time_evolvers/variational/variational_principles/imaginary/test_imaginary_mc_lachlan_principle.py b/test/time_evolvers/variational/variational_principles/imaginary/test_imaginary_mc_lachlan_principle.py index 8bb0f0d7..a9f4a6ee 100644 --- a/test/time_evolvers/variational/variational_principles/imaginary/test_imaginary_mc_lachlan_principle.py +++ b/test/time_evolvers/variational/variational_principles/imaginary/test_imaginary_mc_lachlan_principle.py @@ -22,11 +22,11 @@ import numpy as np from qiskit.quantum_info import SparsePauliOp -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms.time_evolvers.variational import ( ImaginaryMcLachlanPrinciple, ) from qiskit.circuit.library import EfficientSU2 -from qiskit.algorithms.gradients import LinCombEstimatorGradient, DerivativeType +from qiskit_algorithms.gradients import LinCombEstimatorGradient, DerivativeType from qiskit.primitives import Estimator diff --git a/test/time_evolvers/variational/variational_principles/real/test_real_mc_lachlan_principle.py b/test/time_evolvers/variational/variational_principles/real/test_real_mc_lachlan_principle.py index 5a314979..32cddd71 100644 --- a/test/time_evolvers/variational/variational_principles/real/test_real_mc_lachlan_principle.py +++ b/test/time_evolvers/variational/variational_principles/real/test_real_mc_lachlan_principle.py @@ -23,11 +23,11 @@ import numpy as np from qiskit.quantum_info import SparsePauliOp -from qiskit.algorithms.time_evolvers.variational import ( +from qiskit_algorithms.time_evolvers.variational import ( RealMcLachlanPrinciple, ) from qiskit.circuit.library import EfficientSU2 -from qiskit.algorithms.gradients import LinCombEstimatorGradient, DerivativeType +from qiskit_algorithms.gradients import LinCombEstimatorGradient, DerivativeType from qiskit.primitives import Estimator diff --git a/test/utils/test_validate_bounds.py b/test/utils/test_validate_bounds.py index 80fe54ee..6604a229 100644 --- a/test/utils/test_validate_bounds.py +++ b/test/utils/test_validate_bounds.py @@ -18,7 +18,7 @@ import numpy as np -from qiskit.algorithms.utils import validate_bounds +from qiskit_algorithms.utils import validate_bounds from qiskit.utils import algorithm_globals diff --git a/test/utils/test_validate_initial_point.py b/test/utils/test_validate_initial_point.py index 32dd48cf..a8e8d456 100644 --- a/test/utils/test_validate_initial_point.py +++ b/test/utils/test_validate_initial_point.py @@ -18,7 +18,7 @@ import numpy as np -from qiskit.algorithms.utils import validate_initial_point +from qiskit_algorithms.utils import validate_initial_point from qiskit.utils import algorithm_globals