Skip to content

Commit

Permalink
[py] fix numpy depr warnings (errors with modern numpy)
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoStrand committed Jul 13, 2022
1 parent 2c3c576 commit db1d326
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/triqs_tprf/matrix_rpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def tensor_to_matrix(tensor):
left = [slice(None)]*len(non_orb_idx) + [np.array(idx)]
right = [slice(None)]*(len(non_orb_idx)+1) + [np.array(idx)]

matrix = tensor.reshape(non_orb_idx+(norb**2,)*2)[left][right]
matrix = tensor.reshape(non_orb_idx+(norb**2,)*2)[tuple(left)][tuple(right)]

return matrix

Expand All @@ -186,7 +186,7 @@ def matrix_to_tensor(matrix):
left = [slice(None)]*len(non_orb_idx) + [np.array(idx)]
right = [slice(None)]*(len(non_orb_idx)+1) + [np.array(idx)]

tensor = matrix[left][right].reshape(non_orb_idx + (norb,)*4)
tensor = matrix[tuple(left)][tuple(right)].reshape(non_orb_idx + (norb,)*4)

return tensor

Expand Down

0 comments on commit db1d326

Please sign in to comment.