From c833b25633f675e5eefb96b9a2e2abfa2fe35350 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 21 Jun 2024 11:47:39 -0400 Subject: [PATCH] Fix compatibility against numpy 2.0 --- python/triqs_dft_tools/sumk_dft_transport.py | 4 ++-- test/python/elk/elk_spectralcontours_convert.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/triqs_dft_tools/sumk_dft_transport.py b/python/triqs_dft_tools/sumk_dft_transport.py index 63e27155..ea7f4f56 100644 --- a/python/triqs_dft_tools/sumk_dft_transport.py +++ b/python/triqs_dft_tools/sumk_dft_transport.py @@ -620,14 +620,14 @@ def transport_distribution(sum_k, beta, directions=['xx'], energy_window=None, O print("Omega mesh automatically repined to: ", temp_Om_mesh) Gamma_w = {direction: numpy.zeros((len(temp_Om_mesh), n_om), - dtype=numpy.float_) for direction in directions} + dtype=numpy.float64) for direction in directions} # Sum over all k-points ikarray = numpy.array(list(range(sum_k.n_k))) for ik in mpi.slice_array(ikarray): # Calculate G_w for ik and initialize A_kw G_w = sum_k.lattice_gf(ik, mu, broadening=broadening, mesh=mesh, with_Sigma=with_Sigma) - A_kw = [numpy.zeros((sum_k.n_orbitals[ik][isp], sum_k.n_orbitals[ik][isp], n_om), dtype=numpy.complex_) + A_kw = [numpy.zeros((sum_k.n_orbitals[ik][isp], sum_k.n_orbitals[ik][isp], n_om), dtype=numpy.complex128) for isp in range(n_inequiv_spin_blocks)] for isp in range(n_inequiv_spin_blocks): diff --git a/test/python/elk/elk_spectralcontours_convert.py b/test/python/elk/elk_spectralcontours_convert.py index cdf69a0d..4df0c3ba 100644 --- a/test/python/elk/elk_spectralcontours_convert.py +++ b/test/python/elk/elk_spectralcontours_convert.py @@ -32,7 +32,7 @@ omega_range_elk = SK.spectral_contours(broadening=0.01, mesh=mesh, plot_range=(- Converter = ElkConverter(filename='SrVO3', repacking=True) Converter.hdf_file = 'elk_spectralcontours_convert.out.h5' ngrid=np.array([10,10,1],np.int_) -kgrid=np.array([[0.0,0.0,0.0],[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]],np.float_) +kgrid=np.array([[0.0,0.0,0.0],[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]],np.float64) Converter.convert_contours_input(kgrid=kgrid,ngrid=ngrid) SK2 = SumkDFTTools(hdf_file='elk_spectralcontours_convert.out.h5', use_dft_blocks=True) fs_elk_user = SK2.spectral_contours(broadening=0.01, mesh=mesh, with_Sigma=False, with_dc=False, FS=True, proj_type='wann', save_to_file=False)