diff --git a/qiskit_neko/tests/machine_learning/test_neural_network_classifier.py b/qiskit_neko/tests/machine_learning/test_neural_network_classifier.py index ac96f95..914613a 100644 --- a/qiskit_neko/tests/machine_learning/test_neural_network_classifier.py +++ b/qiskit_neko/tests/machine_learning/test_neural_network_classifier.py @@ -13,9 +13,9 @@ """Tests for quantum neural networks classifier.""" import numpy as np from ddt import ddt, data -from qiskit.algorithms.optimizers import COBYLA +from qiskit_algorithms.optimizers import COBYLA +from qiskit_algorithms.utils import algorithm_globals from qiskit.primitives import Sampler as ReferenceSampler -from qiskit.utils import algorithm_globals from qiskit_aer.primitives import Sampler as AerSampler from qiskit_machine_learning.algorithms.classifiers import VQC @@ -49,7 +49,7 @@ def test_neural_network_classifier(self, implementation): num_qubits=2, optimizer=COBYLA(maxiter=100), sampler=sampler, - initial_point=np.zeros((2, 4)), + initial_point=None, ) vqc.fit(x, y01) diff --git a/qiskit_neko/tests/nature/test_ground_state_solver.py b/qiskit_neko/tests/nature/test_ground_state_solver.py index 2363181..7115d01 100644 --- a/qiskit_neko/tests/nature/test_ground_state_solver.py +++ b/qiskit_neko/tests/nature/test_ground_state_solver.py @@ -12,8 +12,8 @@ """Test ground state solvers.""" -from qiskit.algorithms.minimum_eigensolvers import NumPyMinimumEigensolver, VQE -from qiskit.algorithms.optimizers import SLSQP +from qiskit_algorithms import NumPyMinimumEigensolver, VQE +from qiskit_algorithms.optimizers import SLSQP from qiskit.primitives import Estimator from qiskit_nature.second_q.algorithms import GroundStateEigensolver from qiskit_nature.second_q.circuit.library import HartreeFock, UCCSD @@ -49,6 +49,7 @@ def test_ground_state_solver(self): vqe_solver.initial_point = [0.0] * ansatz.num_parameters calc = GroundStateEigensolver(qubit_mapper, vqe_solver) result = calc.solve(es_problem) + # Calculate expected result from numpy solver numpy_solver = NumPyMinimumEigensolver() np_calc = GroundStateEigensolver(qubit_mapper, numpy_solver) diff --git a/qiskit_neko/tests/primitives/test_vqe.py b/qiskit_neko/tests/primitives/test_vqe.py index 0239f1c..6b182e8 100644 --- a/qiskit_neko/tests/primitives/test_vqe.py +++ b/qiskit_neko/tests/primitives/test_vqe.py @@ -12,8 +12,8 @@ """Test primitives with vqe.""" -from qiskit.algorithms.minimum_eigensolvers import VQE, SamplingVQE -from qiskit.algorithms.optimizers import SPSA +from qiskit_algorithms import VQE, SamplingVQE +from qiskit_algorithms.optimizers import SPSA from qiskit.circuit.library import TwoLocal from qiskit.opflow import PauliSumOp from qiskit.primitives import BackendEstimator, BackendSampler diff --git a/requirements.txt b/requirements.txt index 360bea6..d7f8af6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ qiskit-terra +qiskit-algorithms qiskit-aer qiskit-nature[pyscf] qiskit-experiments