Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scipy 1.14 compatibility fix #184

Merged
merged 3 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pylintdict
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ configs
confint
córcoles
crs
csr
currentmodule
customizable
cvar
Expand Down
4 changes: 2 additions & 2 deletions qiskit_algorithms/eigensolvers/numpy_eigensolver.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/numpy_2.0_fix-c29681db4874eee8.yaml
Original file line number Diff line number Diff line change
@@ -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.
Loading