diff --git a/.pylintdict b/.pylintdict index 257e3f66..f4d90d78 100644 --- a/.pylintdict +++ b/.pylintdict @@ -52,6 +52,7 @@ configs confint córcoles crs +csr currentmodule customizable cvar diff --git a/qiskit_algorithms/eigensolvers/numpy_eigensolver.py b/qiskit_algorithms/eigensolvers/numpy_eigensolver.py index d1aef88c..b5deb93a 100644 --- a/qiskit_algorithms/eigensolvers/numpy_eigensolver.py +++ b/qiskit_algorithms/eigensolvers/numpy_eigensolver.py @@ -1,6 +1,6 @@ # This code is part of a Qiskit project. # -# (C) Copyright IBM 2022, 2023. +# (C) Copyright IBM 2022, 2024. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -152,7 +152,7 @@ def _solve(self, operator: BaseOperator) -> tuple[np.ndarray, np.ndarray]: @staticmethod def _solve_sparse(op_matrix: scisparse.csr_matrix, k: int) -> tuple[np.ndarray, np.ndarray]: - if (op_matrix != op_matrix.H).nnz == 0: + if (op_matrix != op_matrix.getH()).nnz == 0: # Operator is Hermitian return scisparse.linalg.eigsh(op_matrix, k=k, which="SA") else: diff --git a/releasenotes/notes/numpy_2.0_fix-c29681db4874eee8.yaml b/releasenotes/notes/numpy_2.0_fix-c29681db4874eee8.yaml new file mode 100644 index 00000000..cbeed03d --- /dev/null +++ b/releasenotes/notes/numpy_2.0_fix-c29681db4874eee8.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Compatibility fix for scipy 1.14 version. csr_matrix.H had been deprecated + and was removed. The :class:`.NumPyEigensolver` algorithm, which + had been using that, has been updated to use an alternative.