Skip to content

Commit

Permalink
Fix compatibility against numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Jun 21, 2024
1 parent a22195f commit fec7ca4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/triqs_tprf/hf_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def mode_decomposition(self):
U_AB = self._to_matrix_AB(self.hfs.U_abcd)
chi0_AB = self._to_matrix_AB(self.chi0_abcd)

e = np.linalg.eigvals(np.mat(chi0_AB) * np.mat(U_AB))
e = np.linalg.eigvals(np.asmatrix(chi0_AB) * np.asmatrix(U_AB))

idx = np.argsort(e.real)
e = e[idx]
Expand Down Expand Up @@ -281,8 +281,8 @@ def __init__(self, hartree_solver, eps=1e-9):
super(HartreeResponse, self).__init__(hartree_solver)

I_ab = np.eye(self.norb)
U_ab = np.mat(self.extract_dens_dens(self.solver.U_abcd))
chi0_ab = np.mat(self._compute_chi0_ab())
U_ab = np.asmatrix(self.extract_dens_dens(self.solver.U_abcd))
chi0_ab = np.asmatrix(self._compute_chi0_ab())
chi_ab = chi0_ab * np.linalg.inv(I_ab - U_ab * chi0_ab)

self.chi0_ab = np.array(chi0_ab)
Expand Down

0 comments on commit fec7ca4

Please sign in to comment.