From e40582b4890ef9f44ebc4287fdc1594adb95808d Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 5 Aug 2022 02:08:24 +0900 Subject: [PATCH 1/8] Tetrahedron method for spin hall conductivity --- src/Makefile.2 | 5 +- src/Makefile.header | 2 +- src/postw90/berry.F90 | 367 +++++++++++++++++- src/postw90/postw90_common.F90 | 4 + src/postw90/postw90_readwrite.F90 | 23 ++ src/postw90/postw90_types.F90 | 11 + src/postw90/tetrahedron.F90 | 619 ++++++++++++++++++++++++++++++ src/readwrite.F90 | 3 + 8 files changed, 1027 insertions(+), 7 deletions(-) create mode 100644 src/postw90/tetrahedron.F90 diff --git a/src/Makefile.2 b/src/Makefile.2 index 94a7565bc..0c305fd33 100644 --- a/src/Makefile.2 +++ b/src/Makefile.2 @@ -168,7 +168,10 @@ kpath.o: $(POSTDIR)kpath.F90 comms.o types.o constants.o io.o spin.o berry.o pos kslice.o: $(POSTDIR)kslice.F90 comms.o types.o constants.o io.o spin.o berry.o postw90_types.o ws_distance.o $(COMPILER) $(POSTOPTS) $(FCOPTS) -c $(POSTDIR)kslice.F90 -berry.o: $(POSTDIR)berry.F90 comms.o types.o constants.o utility.o postw90_common.o get_oper.o io.o spin.o wan_ham.o postw90_types.o ws_distance.o +tetrahedron.o: $(POSTDIR)tetrahedron.F90 constants.o utility.o + $(COMPILER) $(POSTOPTS) $(FCOPTS) -c $(POSTDIR)tetrahedron.F90 + +berry.o: $(POSTDIR)berry.F90 comms.o types.o constants.o utility.o postw90_common.o get_oper.o io.o spin.o wan_ham.o postw90_types.o ws_distance.o tetrahedron.o $(COMPILER) $(POSTOPTS) $(FCOPTS) -c $(POSTDIR)berry.F90 gyrotropic.o: $(POSTDIR)gyrotropic.F90 comms.o types.o constants.o utility.o postw90_common.o get_oper.o io.o spin.o wan_ham.o berry.o postw90_types.o ws_distance.o diff --git a/src/Makefile.header b/src/Makefile.header index 81fe4d319..2764ea429 100644 --- a/src/Makefile.header +++ b/src/Makefile.header @@ -5,7 +5,7 @@ OBJS = constants.o io.o utility.o types.o hamiltonian.o overlap.o kmesh.o dise OBJS_LIBV1 = wannier_lib.o OBJS_POST = ws_distance.o types.o kmesh.o io.o comms.o utility.o get_oper.o constants.o \ - postw90_common.o wan_ham.o spin.o dos.o berry.o gyrotropic.o kpath.o kslice.o \ + postw90_common.o wan_ham.o spin.o dos.o tetrahedron.o berry.o gyrotropic.o kpath.o kslice.o \ boltzwann.o geninterp.o postw90_types.o postw90_readwrite.o comms-abort.o readwrite.o LIBRARY = ../../libwannier.a diff --git a/src/postw90/berry.F90 b/src/postw90/berry.F90 index 8e7dfd75e..0a443ddf5 100644 --- a/src/postw90/berry.F90 +++ b/src/postw90/berry.F90 @@ -95,8 +95,8 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k ! !================================================! - use w90_comms, only: comms_reduce, w90comm_type, mpirank, mpisize - use w90_constants, only: dp, cmplx_0, pi, pw90_physical_constants_type + use w90_comms, only: comms_reduce, w90comm_type, mpirank, mpisize, comms_array_split + use w90_constants, only: dp, cmplx_0, pi, cmplx_i, pw90_physical_constants_type use w90_utility, only: utility_recip_lattice_base use w90_get_oper, only: get_HH_R, get_AA_R, get_BB_R, get_CC_R, get_SS_R, get_SHC_R, & get_SAA_R, get_SBB_R @@ -106,6 +106,7 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k use w90_postw90_types, only: pw90_berry_mod_type, pw90_spin_mod_type, & pw90_spin_hall_type, pw90_band_deriv_degen_type, pw90_oper_read_type, wigner_seitz_type, & kpoint_dist_type + use w90_tetrahedron, only: tetrahedron_spinhall, tetrahedron_P_matrix_init, tetrahedron_array_init implicit none @@ -198,6 +199,20 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k ! Spin Hall conductivity real(kind=dp), allocatable :: shc_fermi(:), shc_k_fermi(:) complex(kind=dp), allocatable :: shc_freq(:), shc_k_freq(:) + ! Tetrahedron method + real(kind=dp), allocatable :: imjv(:, :, :, :, :) + real(kind=dp), allocatable :: eig(:, :, :, :) + real(kind=dp), allocatable :: imjv_tet(:, :, :) + real(kind=dp), allocatable :: eig_tet(:, :) + integer, allocatable :: counts(:) + integer, allocatable :: displs(:) + real(kind=dp) :: kptc(3, 64), kptv(4, 3), & + Ftet(4), E1tet(4), E2tet(4), ttet(3, 3), omega, Ef + complex(kind=dp) :: shc_k_tet + integer :: itet, m, l, nfreq, tet_array(6, 20) + real(kind=dp) :: E1_opt(20), E2_opt(20), F_opt(20), P_matrix(4, 20) + real(kind=dp), parameter :: mesh_shift = 0.5_dp + ! for fermi energy scan, adaptive kmesh real(kind=dp), allocatable :: shc_k_fermi_dummy(:) @@ -378,6 +393,33 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k adpt_counter_list = 0 endif + if (pw90_berry%tetrahedron_method) then + !if (pw90_berry%tetrahedron_correction) then + allocate (imjv(num_wann, num_wann, 0:pw90_berry%kmesh%mesh(1) + 2, 0:pw90_berry%kmesh%mesh(2) + 2, 0:3)) + allocate (eig(num_wann, 0:pw90_berry%kmesh%mesh(1) + 2, 0:pw90_berry%kmesh%mesh(2) + 2, 0:3)) + allocate (imjv_tet(num_wann, num_wann, 64)) + allocate (eig_tet(num_wann, 64)) + allocate (counts(0:num_nodes - 1)) + allocate (displs(0:num_nodes - 1)) + call tetrahedron_P_matrix_init(P_matrix) + call tetrahedron_array_init(tet_array) + if (pw90_spin_hall%freq_scan) then + nfreq = pw90_berry%kubo_nfreq + else + nfreq = fermi_n + endif + !else !w/o correction: not implemented + ! allocate (imjv(num_wann, num_wann, pw90_berry%kmesh%mesh(1) + 1, pw90_berry%kmesh%mesh(2) + 1, 2)) + ! allocate (eig(num_wann, pw90_berry%kmesh%mesh(1) + 1, pw90_berry%kmesh%mesh(2) + 1, 2)) + ! allocate (imjv_tet(num_wann, num_wann, 8)) + ! allocate (eig_tet(num_wann, 8)) + ! allocate (counts(0:num_nodes - 1)) + ! allocate (displs(0:num_nodes - 1)) + ! !tetrahedron_array_small + !endif + call comms_array_split(pw90_berry%kmesh%mesh(3), counts, displs, comm) + endif + endif if (eval_kdotp) then @@ -441,6 +483,14 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k 'band-diagonal Wannier matrix elements of r, etc.' endif + if (pw90_berry%tetrahedron_method) then + if (pw90_berry%tetrahedron_correction) then + write (stdout, '(/,3x,a)') ' Tetrahedron method with Kawamura`s correction' + else + write (stdout, '(/,3x,a)') ' Tetrahedron method without correction' + endif + endif + if (print_output%timing_level > 1) then call io_stopwatch('berry: prelims', 2, stdout, seedname) call io_stopwatch('berry: k-interpolation', 1, stdout, seedname) @@ -495,7 +545,9 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k ! if (pw90_berry%wanint_kpoint_file) then - ! NOTE: still need to specify pw90_berry_kmesh in the input file + if (pw90_berry%tetrahedron_method) call io_error & + ('Tetrahedron method not implemented with wanint_kpoint_file', stdout, seedname) + ! NOTE: still need to specify pw90_pw90_berry%kmesh%mesh in the input file ! ! - Must use the correct nominal value in order to ! correctly set up adaptive smearing in kubo @@ -685,7 +737,7 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k end do !loop_xyz - else! Do not read 'kpoint.dat'. Loop over a regular grid in the full BZ + else if (.not. pw90_berry%tetrahedron_method) then! Do not read 'kpoint.dat'. Loop over a regular grid in the full BZ kweight = db1*db2*db3 kweight_adpt = kweight/pw90_berry%curv_adpt_kmesh**3 @@ -873,6 +925,139 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k end do !loop_xyz + else !tetrahedron_method + if (eval_shc) then + ! to do: move it to tetrahedron.f90? + do loop_z = displs(my_node_id), displs(my_node_id) + counts(my_node_id) - 1 ! current implementation limits max of nodes = pw90_berry%kmesh%mesh(3) + !obtaining energy eigenvalues and matrix elements + !parallelization by loop_z + if (print_output%iprint > 0) & + write (stdout, '(a,i0,a,i0)') "! obtaining energy eigenvalues and matrix elements... ", & + loop_z - displs(my_node_id) + 1, "/", counts(my_node_id) + do loop_x = -1, pw90_berry%kmesh%mesh(1) + 1 + do loop_y = -1, pw90_berry%kmesh%mesh(2) + 1 + kpt(1) = loop_x*db1 + mesh_shift*db1; kpt(2) = loop_y*db2 + mesh_shift*db2 + !boundary of BZ + if (kpt(1) < 0) kpt(1) = kpt(1) + pw90_berry%kmesh%mesh(1)*db1 + if (kpt(2) < 0) kpt(2) = kpt(2) + pw90_berry%kmesh%mesh(2)*db2 + if (kpt(1) > pw90_berry%kmesh%mesh(1)*db1 - 0.001_dp*db1) kpt(1) = kpt(1) - pw90_berry%kmesh%mesh(1)*db1 + if (kpt(2) > pw90_berry%kmesh%mesh(2)*db2 - 0.001_dp*db2) kpt(2) = kpt(2) - pw90_berry%kmesh%mesh(2)*db2 + !optimized tetrahedron method(Kawamura, PRB 89 094515) + !1st layer for points 6, 9, 10, 13 (in Fig. 3) + !2nd layer for points 1, 2, 5, 14, 19, 20 + !3rd layer for points 3, 4, 7, 16, 17, 18 + !4th layer for points 8, 11, 12, 15 + do i = 0, 3 ! main tetrahedra are between 2nd(i=1) and 3rd(i=2) layers + kpt(3) = (loop_z - 1 + i)*db3 + mesh_shift*db3 + if (kpt(3) < 0) kpt(3) = kpt(3) + pw90_berry%kmesh%mesh(3)*db3 !boundary of BZ + if (kpt(3) > pw90_berry%kmesh%mesh(3)*db3 - 0.001_dp*db3) kpt(3) = kpt(3) - pw90_berry%kmesh%mesh(3)*db3 !boundary of BZ + if (loop_z == displs(my_node_id) .or. i == 3) then + call berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wannier_data, ws_distance, & + wigner_seitz, AA_R, HH_R, SH_R, SHR_R, SR_R, SS_R, SAA_R, SBB_R, & + kpt, imjv(:, :, loop_x + 1, loop_y + 1, i), eig(:, loop_x + 1, loop_y + 1, i), & + real_lattice, mp_grid, num_wann, seedname, stdout) + else + imjv(:, :, loop_x + 1, loop_y + 1, i) = imjv(:, :, loop_x + 1, loop_y + 1, i + 1) + eig(:, loop_x + 1, loop_y + 1, i) = eig(:, loop_x + 1, loop_y + 1, i + 1) + endif + enddo + enddo + enddo + !summation + do loop_x = 0, pw90_berry%kmesh%mesh(1) - 1 + do loop_y = 0, pw90_berry%kmesh%mesh(2) - 1 + ! writing progress - summation is the main bottleneck + loop_xyz = (loop_z - displs(my_node_id))*pw90_berry%kmesh%mesh(1)*pw90_berry%kmesh%mesh(2) & + + loop_x*pw90_berry%kmesh%mesh(2) + loop_y + call berry_print_progress(loop_xyz, 0, counts(my_node_id)*pw90_berry%kmesh%mesh(1) & + *pw90_berry%kmesh%mesh(2) - 1, 1, stdout) + ! setting 8 vertices and surrounding points + do i = 0, 3 !16*l+4*k+i+1 = 1,2,3,...,64, eight vertices of a mesh(22, 23, 26, 27, 38, 39, 42, 43) and their surrounding points + do k = 0, 3 + do l = 0, 3 + kptc(1, 16*l + 4*k + i + 1) = (loop_x + i - 1)*db1 + mesh_shift*db1 + kptc(2, 16*l + 4*k + i + 1) = (loop_y + k - 1)*db2 + mesh_shift*db2 + kptc(3, 16*l + 4*k + i + 1) = (loop_z + l - 1)*db3 + mesh_shift*db3 + imjv_tet(:, :, 16*l + 4*k + i + 1) = imjv(:, :, loop_x + i, loop_y + k, l) + eig_tet(:, 16*l + 4*k + i + 1) = eig(:, loop_x + i, loop_y + k, l) + enddo + enddo + enddo + do itet = 1, 6 ! 6 tetrahedra + do i = 1, 4 ! four vertices + kptv(i, :) = kptc(:, tet_array(itet, i)) + enddo + do i = 1, 3 ! xyz + do k = 1, 3 ! three vectors forming a tetrahedron + ttet(i, k) = kptv(k + 1, i) - kptv(1, i) + enddo + enddo + + do n = 1, num_wann + do m = 1, num_wann + if (n == m) cycle + do i = 1, 20 ! four vertices + 16 points for optimization + F_opt(i) = imjv_tet(n, m, tet_array(itet, i)) + E1_opt(i) = eig_tet(n, tet_array(itet, i)) + E2_opt(i) = eig_tet(m, tet_array(itet, i)) + enddo + + E1tet = 0.0_dp + E2tet = 0.0_dp + Ftet = 0.0_dp + do i = 1, 4 + do k = 1, 20 !Eq. (16) of Kawamura, PRB 89 094515 + E1tet(i) = E1tet(i) + P_matrix(i, k)*E1_opt(k) + E2tet(i) = E2tet(i) + P_matrix(i, k)*E2_opt(k) + Ftet(i) = Ftet(i) + P_matrix(i, k)*F_opt(k) + enddo + enddo + + ! do i = 1, 4 + ! Ftet(i) = imjv_tet(n, m, tet_array(itet, i)) + ! E1tet(i) = eig_tet(n, tet_array(itet, i)) + ! E2tet(i) = eig_tet(m, tet_array(itet, i)) + ! enddo + do ifreq = 1, nfreq !fermiscan or freqscan + if (.not. pw90_spin_hall%freq_scan) then + omega = real(pw90_berry%kubo_freq_list(1), dp) + Ef = fermi_energy_list(ifreq) + else + omega = real(pw90_berry%kubo_freq_list(ifreq), dp) + Ef = fermi_energy_list(1) + endif + + if (omega == 0.0) then + shc_k_tet = & + tetrahedron_spinhall(Ftet, E1tet, E2tet, ttet, & + 0.0_dp, Ef, 3, pw90_berry%tetrahedron_cutoff) + else + shc_k_tet = & + (tetrahedron_spinhall(Ftet, E1tet, E2tet, ttet, & + -omega, Ef, 1, pw90_berry%tetrahedron_cutoff) & + - tetrahedron_spinhall(Ftet, E1tet, E2tet, ttet, & + omega, Ef, 1, pw90_berry%tetrahedron_cutoff)) & + /(2.0_dp*omega) + (cmplx_i*pi* & + (tetrahedron_spinhall(Ftet, E1tet, E2tet, ttet, & + -omega, Ef, 2, pw90_berry%tetrahedron_cutoff) & + + tetrahedron_spinhall(Ftet, E1tet, E2tet, ttet, & + omega, Ef, 2, pw90_berry%tetrahedron_cutoff))) & + /(2.0_dp*omega) + endif + + if (.not. pw90_spin_hall%freq_scan) then + shc_fermi(ifreq) = shc_fermi(ifreq) - real(shc_k_tet, dp) + else + shc_freq(ifreq) = shc_freq(ifreq) - shc_k_tet + endif + enddo !ifreq + enddo ! m + enddo ! n + enddo ! itet + enddo ! loop_y for summation + enddo ! loop_x for summation + enddo ! loop_z + end if end if !wanint_kpoint_file ! Collect contributions from all nodes @@ -2469,7 +2654,7 @@ subroutine berry_get_shc_klist(pw90_berry, dis_manifold, fermi_energy_list, kpt_ delHH(:, :, pw90_spin_hall%alpha), kpt, real_lattice, mp_grid, num_wann, & seedname, stdout) - ! adpt_smr only works with pw90_berry_kmesh, so do not use + ! adpt_smr only works with pw90_pw90_berry%kmesh%mesh, so do not use ! adpt_smr in kpath or kslice plots. if (pw90_berry%kubo_smearing%use_adaptive) then call utility_recip_lattice_base(real_lattice, recip_lattice, volume) @@ -2720,6 +2905,178 @@ end subroutine berry_get_js_k end subroutine berry_get_shc_klist + subroutine berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wannier_data, ws_distance, & + wigner_seitz, AA_R, HH_R, SH_R, SHR_R, SR_R, SS_R, SAA_R, SBB_R, & + kpt, imjv, eig_out, real_lattice, mp_grid, num_wann, & + seedname, stdout) + + !====================================================================! + ! returns the values used for calculating the SHC Kubo formula ! + ! imjv = Im [j^{z}_{x,nmk} * v_{y,nmk}] ! + ! eig_out = energy eigenvalues ! + !====================================================================! + use w90_constants, only: dp, cmplx_0, cmplx_i + use w90_utility, only: utility_diagonalize, utility_rotate + use w90_types, only: print_output_type, wannier_data_type, ws_region_type, & + ws_distance_type + use w90_postw90_types, only: pw90_berry_mod_type, pw90_spin_hall_type, wigner_seitz_type + use w90_postw90_common, only: pw90common_fourier_R_to_k_new, pw90common_fourier_R_to_k_vec + + ! arguments + type(pw90_berry_mod_type), intent(in) :: pw90_berry + type(ws_region_type), intent(in) :: ws_region + type(pw90_spin_hall_type), intent(in) :: pw90_spin_hall + type(wannier_data_type), intent(in) :: wannier_data + type(wigner_seitz_type), intent(inout) :: wigner_seitz + type(ws_distance_type), intent(inout) :: ws_distance + + integer, intent(in) :: num_wann + integer, intent(in) :: mp_grid(3) + integer, intent(in) :: stdout + + real(kind=dp), intent(in) :: kpt(3) + real(kind=dp), intent(in) :: real_lattice(3, 3) + real(kind=dp), dimension(:, :), intent(out) :: imjv + real(kind=dp), dimension(:), intent(out) :: eig_out + complex(kind=dp), allocatable, intent(inout) :: AA_R(:, :, :, :) ! <0n|r|Rm> + complex(kind=dp), allocatable, intent(inout) :: HH_R(:, :, :) ! <0n|r|Rm> + complex(kind=dp), allocatable, intent(inout) :: SR_R(:, :, :, :, :) ! <0n|sigma_x,y,z.(r-R)_alpha|Rm> + complex(kind=dp), allocatable, intent(inout) :: SHR_R(:, :, :, :, :) ! <0n|sigma_x,y,z.H.(r-R)_alpha|Rm> + complex(kind=dp), allocatable, intent(inout) :: SH_R(:, :, :, :) ! <0n|sigma_x,y,z.H|Rm> + complex(kind=dp), allocatable, intent(inout) :: SS_R(:, :, :, :) ! <0n|sigma_x,y,z|Rm> + complex(kind=dp), allocatable, intent(inout) :: SAA_R(:, :, :, :, :) + complex(kind=dp), allocatable, intent(inout) :: SBB_R(:, :, :, :, :) + + character(len=50), intent(in) :: seedname + + ! internal vars + complex(kind=dp), allocatable :: HH(:, :) + complex(kind=dp), allocatable :: delHH(:, :, :) + complex(kind=dp), allocatable :: UU(:, :) + complex(kind=dp), allocatable :: VV0(:, :, :) + complex(kind=dp), allocatable :: VV(:, :, :) + complex(kind=dp), allocatable :: AA(:, :, :) + complex(kind=dp), allocatable :: SS(:, :, :) + complex(kind=dp), allocatable :: spinVel0(:, :, :, :), spinVel(:, :, :, :) + + complex(kind=dp), allocatable :: SAA(:, :, :, :) + complex(kind=dp), allocatable :: SBB(:, :, :, :) + + integer :: i, j, n, m + real(kind=dp) :: eig(num_wann), occ(num_wann) + + allocate (HH(num_wann, num_wann)) + allocate (delHH(num_wann, num_wann, 3)) + allocate (UU(num_wann, num_wann)) + allocate (VV(num_wann, num_wann, 3)) + allocate (VV0(num_wann, num_wann, 3)) + allocate (AA(num_wann, num_wann, 3)) + allocate (SS(num_wann, num_wann, 3)) + allocate (spinVel0(num_wann, num_wann, 3, 3)) + allocate (spinVel(num_wann, num_wann, 3, 3)) + allocate (SAA(num_wann, num_wann, 3, 3)) + allocate (SBB(num_wann, num_wann, 3, 3)) + + call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & + HH_R, kpt, real_lattice, & + mp_grid, num_wann, seedname, stdout, OO=HH, & + OO_dx=delHH(:, :, 1), & + OO_dy=delHH(:, :, 2), & + OO_dz=delHH(:, :, 3)) +! call wham_get_eig_deleig(dis_manifold, kpt_latt, pw90_band_deriv_degen, ws_region, print_output, wannier_data, & +! ws_distance, wigner_seitz, delHH, HH, HH_R, u_matrix, UU, v_matrix, & +! del_eig, eig, eigval, kpt, real_lattice, scissors_shift, mp_grid, & +! num_bands, num_kpts, num_wann, num_valence_bands, effective_model, & +! have_disentangled, seedname, stdout, comm) + call utility_diagonalize(HH, num_wann, eig, UU, stdout, seedname) + call pw90common_fourier_R_to_k_vec(ws_region, wannier_data, ws_distance, wigner_seitz, & + AA_R, kpt, & + real_lattice, mp_grid, num_wann, seedname, stdout, & + OO_true=AA) + call pw90common_fourier_R_to_k_vec(ws_region, wannier_data, ws_distance, wigner_seitz, & + SS_R, kpt, & + real_lattice, mp_grid, num_wann, seedname, stdout, & + OO_true=SS) + + if (index(pw90_spin_hall%method, 'ryoo') > 0) then + call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & + SAA_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & + kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + OO=SAA(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) + call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & + SBB_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & + kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + OO=SBB(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) + else + call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & + SR_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & + kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + OO=SAA(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) + call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & + SHR_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & + kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + OO=SBB(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) + endif + + do i = 1, 3 + AA(:, :, i) = utility_rotate(AA(:, :, i), UU, num_wann) + SS(:, :, i) = utility_rotate(SS(:, :, i), UU, num_wann) + VV0(:, :, i) = utility_rotate(delHH(:, :, i), UU, num_wann) + do j = 1, 3 + SAA(:, :, i, j) = utility_rotate(SAA(:, :, i, j), UU, num_wann) + SBB(:, :, i, j) = utility_rotate(SBB(:, :, i, j), UU, num_wann) + enddo + enddo + + !velocity + do m = 1, num_wann + do n = 1, num_wann + VV(n, m, pw90_spin_hall%beta) = VV0(n, m, pw90_spin_hall%beta) & + - cmplx_i*AA(n, m, pw90_spin_hall%beta)*(eig(m) - eig(n)) + enddo + enddo + + !spin velocity + spinVel0 = 0.D0 + spinVel = 0.D0 + + i = pw90_spin_hall%alpha + j = pw90_spin_hall%gamma + spinVel0(:, :, j, i) = matmul(VV0(:, :, i), SS(:, :, j)) + & + matmul(SS(:, :, j), VV0(:, :, i)) + do m = 1, num_wann + do n = 1, num_wann + spinVel(n, m, j, i) = spinVel0(n, m, j, i) & + - cmplx_i*(eig(m)*SAA(n, m, j, i) - SBB(n, m, j, i)) + spinVel(n, m, j, i) = spinVel(n, m, j, i) & + + cmplx_i*(eig(n)*conjg(SAA(m, n, j, i)) - conjg(SBB(m, n, j, i))) + enddo + enddo + + spinVel = spinVel/2.0_dp + + !output + do n = 1, num_wann + do m = 1, num_wann + imjv(n, m) = aimag(spinVel(n, m, j, i)*VV(m, n, pw90_spin_hall%beta)) + enddo + enddo + eig_out = eig + + deallocate (HH) + deallocate (delHH) + deallocate (UU) + deallocate (VV) + deallocate (VV0) + deallocate (AA) + deallocate (SS) + deallocate (spinVel0) + deallocate (spinVel) + deallocate (SAA) + deallocate (SBB) + + end subroutine berry_get_shc_tetrahedron + !================================================! subroutine berry_print_progress(end_k, loop_k, start_k, step_k, stdout) !================================================! diff --git a/src/postw90/postw90_common.F90 b/src/postw90/postw90_common.F90 index e3aec6a7a..d4717bef7 100644 --- a/src/postw90/postw90_common.F90 +++ b/src/postw90/postw90_common.F90 @@ -394,6 +394,10 @@ subroutine pw90common_wanint_w90_wannier90_readwrite_dist(print_output, ws_regio call comms_bcast(pw90_berry%sc_w_thr, 1, stdout, seedname, comm) call comms_bcast(pw90_berry%sc_phase_conv, 1, stdout, seedname, comm) call comms_bcast(pw90_berry%sc_use_eta_corr, 1, stdout, seedname, comm) + + call comms_bcast(pw90_berry%tetrahedron_method, 1, stdout, seedname, comm) + call comms_bcast(pw90_berry%tetrahedron_correction, 1, stdout, seedname, comm) + call comms_bcast(pw90_berry%tetrahedron_cutoff, 1, stdout, seedname, comm) ! ---------------------------------------------- ! ! New input variables in development diff --git a/src/postw90/postw90_readwrite.F90 b/src/postw90/postw90_readwrite.F90 index 019f6b3ca..febf75272 100644 --- a/src/postw90/postw90_readwrite.F90 +++ b/src/postw90/postw90_readwrite.F90 @@ -655,6 +655,22 @@ subroutine w90_wannier90_readwrite_read_berry(pw90_calculation, pw90_berry, pw90 call w90_readwrite_get_keyword_vector(stdout, seedname, 'kdotp_kpoint', found, 3, & r_value=pw90_berry%kdotp_kpoint) + pw90_berry%tetrahedron_method = .false. + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_method', found, & + l_value=pw90_berry%tetrahedron_method) + if (pw90_berry%tetrahedron_method .and. index(pw90_berry%task, 'shc') == 0) & + call io_error('Error: tetrahedron_method only implemented in the shc routine', stdout, seedname) + + pw90_berry%tetrahedron_correction = .true. + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_correction', found, & + l_value=pw90_berry%tetrahedron_method) + + pw90_berry%tetrahedron_cutoff = 1.e-4_dp + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_cutoff', found, & + r_value=pw90_berry%tetrahedron_cutoff) + if (pw90_berry%tetrahedron_cutoff <= 0._dp) call io_error & + ('Error: tetrahedron_cutoff must be greater than zero', stdout, seedname) + kdotp_num_bands = 0 call w90_readwrite_get_keyword(stdout, seedname, 'kdotp_num_bands', found, i_value=kdotp_num_bands) if (found) then @@ -1681,6 +1697,13 @@ subroutine w90_postw90_readwrite_write(print_output, w90_system, fermi_energy_li write (stdout, '(1x,a21,5x,a47,4x,a1)') '| Smearing Function ', & trim(w90_readwrite_get_smearing_type(pw90_dos%smearing%type_index)), '|' endif + if (pw90_berry%tetrahedron_method) then + write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method :', ' T', '|' + write (stdout, '(1x,a46,10x,f8.3,13x,a1)') '| Tetrahedron cutoff :', & + pw90_berry%tetrahedron_cutoff, '|' + else + write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method :', ' F', '|' + endif if (pw90_extra_io%global_kmesh%mesh(1) == pw90_dos%kmesh%mesh(1) .and. & pw90_extra_io%global_kmesh%mesh(2) == pw90_dos%kmesh%mesh(2) .and. & pw90_extra_io%global_kmesh%mesh(3) == pw90_dos%kmesh%mesh(3)) then diff --git a/src/postw90/postw90_types.F90 b/src/postw90/postw90_types.F90 index 96111e6e2..5b3180d47 100644 --- a/src/postw90/postw90_types.F90 +++ b/src/postw90/postw90_types.F90 @@ -165,8 +165,19 @@ module w90_postw90_types integer :: kubo_nfreq complex(kind=dp), allocatable :: kubo_freq_list(:) real(kind=dp) :: kubo_eigval_max + ! + Module tetrahedron + !type(pw90_tetrahedron_type) :: tetrahedron + logical :: tetrahedron_method + logical :: tetrahedron_correction + real(kind=dp) :: tetrahedron_cutoff end type pw90_berry_mod_type + !type pw90_tetrahedron_type + ! logical :: method + ! logical :: correction + ! real(kind=dp) :: cutoff + !end type pw90_tetrahedron_type + ! spin Hall conductivity (postw90 - common, get_oper, berry, kpath) type pw90_spin_hall_type !!================================================== diff --git a/src/postw90/tetrahedron.F90 b/src/postw90/tetrahedron.F90 new file mode 100644 index 000000000..e57cb83c6 --- /dev/null +++ b/src/postw90/tetrahedron.F90 @@ -0,0 +1,619 @@ +!-*- mode: F90 -*-! +!------------------------------------------------------------! +! This file is distributed as part of the Wannier90 code and ! +! under the terms of the GNU General Public License. See the ! +! file `LICENSE' in the root directory of the Wannier90 ! +! distribution, or http://www.gnu.org/copyleft/gpl.txt ! +! ! +! The webpage of the Wannier90 code is www.wannier.org ! +! ! +! The Wannier90 code is hosted on GitHub: ! +! ! +! https://github.com/wannier-developers/wannier90 ! +!------------------------------------------------------------! +! ! +! w90_tetrahedron: functions for tetrahedron method ! +! ! +!------------------------------------------------------------! + +module w90_tetrahedron + + use w90_constants, only: dp + + implicit none + + private + !tetrahedron_fermidirac + !tetrahedron_sort + !tetrahedron_jacobian + !tetrahedron_log1p + + public :: tetrahedron_spinhall + ! To do: extend to other quantities(anomalous, ...) + public :: tetrahedron_integral + public :: tetrahedron_P_matrix_init + public :: tetrahedron_array_init + public :: tetrahedron_array_small_init + +contains + + subroutine tetrahedron_P_matrix_init(P_matrix) + + use w90_constants, only: dp + + implicit none + + real(kind=dp), dimension(4, 20), intent(inout) :: P_matrix + + ! correction, Kawamura PRB 89 094515 + P_matrix(1, 1:4) = real((/1440, 0, 30, 0/), dp) + P_matrix(2, 1:4) = real((/0, 1440, 0, 30/), dp) + P_matrix(3, 1:4) = real((/30, 0, 1440, 0/), dp) + P_matrix(4, 1:4) = real((/0, 30, 0, 1440/), dp) + ! + P_matrix(1, 5:8) = real((/-38, 7, 17, -28/), dp) + P_matrix(2, 5:8) = real((/-28, -38, 7, 17/), dp) + P_matrix(3, 5:8) = real((/17, -28, -38, 7/), dp) + P_matrix(4, 5:8) = real((/7, 17, -28, -38/), dp) + ! + P_matrix(1, 9:12) = real((/-56, 9, -46, 9/), dp) + P_matrix(2, 9:12) = real((/9, -56, 9, -46/), dp) + P_matrix(3, 9:12) = real((/-46, 9, -56, 9/), dp) + P_matrix(4, 9:12) = real((/9, -46, 9, -56/), dp) + ! + P_matrix(1, 13:16) = real((/-38, -28, 17, 7/), dp) + P_matrix(2, 13:16) = real((/7, -38, -28, 17/), dp) + P_matrix(3, 13:16) = real((/17, 7, -38, -28/), dp) + P_matrix(4, 13:16) = real((/-28, 17, 7, -38/), dp) + ! + P_matrix(1, 17:20) = real((/-18, -18, 12, -18/), dp) + P_matrix(2, 17:20) = real((/-18, -18, -18, 12/), dp) + P_matrix(3, 17:20) = real((/12, -18, -18, -18/), dp) + P_matrix(4, 17:20) = real((/-18, 12, -18, -18/), dp) + ! + P_matrix(1:4, 1:20) = P_matrix(1:4, 1:20)/1260.0_dp + + end subroutine tetrahedron_P_matrix_init + + subroutine tetrahedron_array_small_init(tet_array_small) + + implicit none + + integer, dimension(6, 4), intent(inout) :: tet_array_small + + ! without correction + ! z ! + ! 7----------8 ! tetrahedron #1: 1-5-6-8 + tet_array_small(1, :) = (/1, 5, 6, 8/) ! /| /| layer 2! tetrahedron #2: 1-7-5-8 + tet_array_small(2, :) = (/1, 7, 5, 8/) ! 5----------6 | ! tetrahedron #3: 1-3-7-8 + tet_array_small(3, :) = (/1, 3, 7, 8/) ! | | y | | ! tetrahedron #4: 1-4-3-8 + tet_array_small(4, :) = (/1, 4, 3, 8/) ! | 3--------|-4 ! tetrahedron #5: 1-2-4-8 + tet_array_small(5, :) = (/1, 2, 4, 8/) ! |/ |/ layer 1! tetrahedron #6: 1-6-2-8 + tet_array_small(6, :) = (/1, 6, 2, 8/) ! 1----------2 x ! + ! 1-8 : main diagonal ! + !=============================! + + end subroutine tetrahedron_array_small_init + + subroutine tetrahedron_array_init(tet_array) + + implicit none + + integer, dimension(6, 20), intent(inout) :: tet_array + ! with correction, Kawamura PRB 89 094515 + ! z ! + ! ! 61--62--63-64 ! tetrahedron #1: 22-38-39-43 + tet_array(1, 1:4) = (/22, 38, 39, 43/) ! /| /| layer 4! tetrahedron #2: 22-42-38-43 + tet_array(2, 1:4) = (/22, 42, 38, 43/) ! 49--50--51-52| ! tetrahedron #3: 22-26-42-43 + tet_array(3, 1:4) = (/22, 26, 42, 43/) ! | | y | | ! tetrahedron #4: 22-27-26-43 + tet_array(4, 1:4) = (/22, 27, 26, 43/) ! | 13--14--1|-16 ! tetrahedron #5: 22-23-27-43 + tet_array(5, 1:4) = (/22, 23, 27, 43/) ! |/ |/ layer 1! tetrahedron #6: 22-39-23-43 + tet_array(6, 1:4) = (/22, 39, 23, 43/) ! 1---2---3--4 x ! + ! 22-43 : main diagonal ! + !=============================! + tet_array(1, 5:20) = (/6, 37, 35, 64, 5, 33, 56, 48, 1, 54, 40, 47, 59, 23, 42, 18/) + tet_array(2, 5:20) = (/2, 46, 33, 64, 6, 41, 54, 44, 1, 62, 34, 48, 63, 18, 47, 17/) + tet_array(3, 5:20) = (/18, 10, 41, 64, 2, 9, 62, 60, 1, 30, 58, 44, 47, 38, 27, 21/) + tet_array(4, 5:20) = (/17, 28, 9, 64, 18, 11, 30, 59, 1, 32, 25, 60, 48, 21, 44, 5/) + tet_array(5, 5:20) = (/21, 19, 11, 64, 17, 3, 32, 63, 1, 24, 31, 59, 44, 26, 39, 6/) + tet_array(6, 5:20) = (/5, 55, 3, 64, 21, 35, 24, 47, 1, 56, 7, 63, 60, 6, 59, 2/) + !note: 18 points(4, 8, 12, 13, 14, 15, 16, 20, 29, 36, 45, 49, 50, 51, 52, 53, 57, 61) are not used + + end subroutine tetrahedron_array_init + + !================================================! + function tetrahedron_spinhall(F, E1, E2, t, hw, Ef, type, tet_cutoff) + !============================================================================= + ! Calculates contribution from a single tetrahedron, for the Kubo formula. ! + ! "integral d3k (f_{nk} - f_{mk} * (...) + ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB () ! + !============================================================================= + + use w90_constants, only: dp + + implicit none + + real(kind=dp) :: tetrahedron_spinhall + real(kind=dp), dimension(4), intent(in) :: F, E1, E2 + real(kind=dp), dimension(3, 3), intent(in) :: t + real(kind=dp), intent(in) :: hw, Ef + integer, intent(in) :: type + real(kind=dp), intent(in) :: tet_cutoff + !intermediate variables, s:sorted + real(kind=dp) :: t_s(3, 3), t_small(3, 3), x(3), y + real(kind=dp), dimension(4) :: D, occ1, occ2, F_s, E1_s, E2_s, & + F_small, D_small + integer :: i + logical :: flag1, flag2 + + !fnk-fmk = 0 then quickly returns zero + occ1 = 0.0_dp; occ2 = 0.0_dp; flag1 = .true.; flag2 = .true. + do i = 1, 4 + if (E1(i) < Ef) occ1(i) = 1.0_dp + if (E2(i) < Ef) occ2(i) = 1.0_dp + if (occ1(i) /= 1.0 .or. occ2(i) /= 1.0) flag1 = flag1 .and. .false. + if (occ1(i) /= 0.0 .or. occ2(i) /= 0.0) flag2 = flag2 .and. .false. + enddo + if (flag1 .or. flag2) then + tetrahedron_spinhall = 0.0_dp + else + tetrahedron_spinhall = tetrahedron_fermidirac(F, E1, E2, t, hw, Ef, type, tet_cutoff) & + - tetrahedron_fermidirac(F, E2, E1, t, hw, Ef, type, tet_cutoff) + endif + + return + + end function tetrahedron_spinhall + + function tetrahedron_fermidirac(F, E_ref, E2, t, hw, Ef, type, tet_cutoff) + !============================================================================= + ! Calculates contribution from a single tetrahedron, for the Kubo formula. ! + ! "integral d3k f_{nk} * (...) + ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB () ! + !============================================================================= + + use w90_constants, only: dp + + implicit none + + real(kind=dp) :: tetrahedron_fermidirac + real(kind=dp), dimension(4), intent(in) :: F, E_ref, E2 + real(kind=dp), dimension(3, 3), intent(in) :: t + real(kind=dp), intent(in) :: hw, Ef + integer, intent(in) :: type + real(kind=dp), intent(in) :: tet_cutoff + !intermediate variables, s:sorted + real(kind=dp) :: t_s(3, 3), t_small(3, 3), x(3), y + real(kind=dp), dimension(4) :: D, F_s, E1_s, E2_s, F_small, D_small + !result + real(kind=dp) :: Ans + integer :: i + + Ans = 0.0_dp + !sorting vertices according to E_ref + F_s = F; E1_s = E_ref; E2_s = E2; t_s = t !_s: sorted + call tetrahedron_sort(E1_s, E2_s, F_s, t_s) + D = E1_s - E2_s + !case 1,2,3,4,5 + if (Ef < E1_s(1)) then ! case 1: zero + Ans = Ans + 0.0_dp + else if (Ef < E1_s(2)) then ! case 2: a small tet. + + x(1) = (Ef - E1_s(1))/(E1_s(2) - E1_s(1)) + x(2) = (Ef - E1_s(1))/(E1_s(3) - E1_s(1)) + x(3) = (Ef - E1_s(1))/(E1_s(4) - E1_s(1)) + + F_small(1) = F_s(1); D_small(1) = D(1) + do i = 1, 3 + F_small(i + 1) = F_s(1) + (F_s(i + 1) - F_s(1))*x(i) + D_small(i + 1) = D(1) + (D(i + 1) - D(1))*x(i) + t_small(:, i) = t_s(:, i)*x(i) + enddo + Ans = Ans + tetrahedron_integral(F_small, D_small, t_small, hw, type, tet_cutoff) + + else if (Ef < E1_s(3)) then ! case 3: two tet.'s with cases 2 and 4 + + x(1) = (Ef - E1_s(4))/(E1_s(2) - E1_s(4)) + x(2) = (Ef - E1_s(1))/(E1_s(3) - E1_s(1)) + x(3) = (Ef - E1_s(1))/(E1_s(4) - E1_s(1)) + y = (Ef - E1_s(3))/(E1_s(2) - E1_s(3)) + + F_small = F_s; D_small = D; t_small = t_s + F_small(4) = F_s(1) + (F_s(4) - F_s(1))*x(3) + D_small(4) = D(1) + (D(4) - D(1))*x(3) + t_small(:, 3) = t_s(:, 3)*x(3) + Ans = Ans + tetrahedron_integral(F_small, D_small, t_small, hw, type, tet_cutoff) + + F_small(1) = F_s(1) + (F_s(3) - F_s(1))*x(2); F_small(2) = F_s(3) + (F_s(2) - F_s(3))*y + D_small(1) = D(1) + (D(3) - D(1))*x(2); D_small(2) = D(3) + (D(2) - D(3))*y + t_small(:, 1) = t_s(:, 1)*y + t_s(:, 2)*(1 - y - x(2)) + t_small(:, 2) = t_s(:, 2)*(1 - x(2)) + t_small(:, 3) = t_s(:, 3)*x(3) - t_s(:, 2)*x(2) + Ans = Ans - tetrahedron_integral(F_small, D_small, t_small, hw, type, tet_cutoff) + + F_small(1) = F_s(4) + (F_s(2) - F_s(4))*x(1) + F_small(3) = F_small(2); F_small(2) = F_s(2) + D_small(1) = D(4) + (D(2) - D(4))*x(1) + D_small(3) = D_small(2); D_small(2) = D(2) + t_small(:, 1) = (t_s(:, 1) - t_s(:, 3))*(1 - x(1)) + t_small(:, 2) = t_s(:, 1)*(y - x(1)) + t_s(:, 2)*(1 - y) + t_s(:, 3)*(x(1) - 1) + t_small(:, 3) = -t_s(:, 1)*x(1) + t_s(:, 3)*(x(1) + x(3) - 1) + Ans = Ans + tetrahedron_integral(F_small, D_small, t_small, hw, type, tet_cutoff) + + else if (Ef < E1_s(4)) then ! case 4: a large tet. - a small tet. + + x(1) = (Ef - E1_s(4))/(E1_s(2) - E1_s(4)) + x(2) = (Ef - E1_s(4))/(E1_s(3) - E1_s(4)) + x(3) = (Ef - E1_s(1))/(E1_s(4) - E1_s(1)) + + F_small(1) = F_s(4); F_small(2) = F_s(1) + (F_s(4) - F_s(1))*x(3) + F_small(3) = F_s(4) + (F_s(2) - F_s(4))*x(1) + F_small(4) = F_s(4) + (F_s(3) - F_s(4))*x(2) + D_small(1) = D(4); D_small(2) = D(1) + (D(4) - D(1))*x(3) + D_small(3) = D(4) + (D(2) - D(4))*x(1) + D_small(4) = D(4) + (D(3) - D(4))*x(2) + t_small(:, 1) = -t_s(:, 3)*(1 - x(3)) + t_small(:, 2) = (t_s(:, 1) - t_s(:, 3))*x(1) + t_small(:, 3) = (t_s(:, 2) - t_s(:, 3))*x(2) + Ans = Ans + tetrahedron_integral(F_s, D, t_s, hw, type, tet_cutoff) & + - tetrahedron_integral(F_small, D_small, t_small, hw, type, tet_cutoff) + + else ! case 5: a large tet. + Ans = Ans + tetrahedron_integral(F_s, D, t_s, hw, type, tet_cutoff) + endif + tetrahedron_fermidirac = Ans + + end function tetrahedron_fermidirac + + !======================================================================= + function tetrahedron_integral(F_in, D_in, t_in, hw, type, tet_cutoff) + !============================================================================= + ! Calculates contribution from a single tetrahedron, for the Kubo formula. ! + ! To do: extend to complex numbers ! + ! type 1: nondissipative, linear/linear ! + ! type 2: dissipative ! + ! type 3: nondissipative, linear/(linear)**2 ! + ! ! + ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB () ! + !============================================================================= + + use w90_constants, only: dp + use w90_utility, only: utility_inv3 + + implicit none + + real(kind=dp) :: tetrahedron_integral + real(kind=dp), dimension(4), intent(in) :: F_in, D_in + real(kind=dp), dimension(3, 3), intent(in) :: t_in + real(kind=dp), intent(in) :: hw + integer, intent(in) :: type + real(kind=dp), intent(in) :: tet_cutoff + !result + real(kind=dp) :: Ans, Det_t + + !intermediate variables + integer :: i, j, k, l + real(kind=dp) :: D(4), F(4), t(3, 3), DAV, D_small_prev, D_large_prev + real(kind=dp) :: dd(3), ll(3), ff, bb(4), cc(4, 3) + integer :: a, b, c + REAL(kind=dp) :: t_inverse(3, 3), dummy(4) + REAL(kind=dp) :: GradD, Jac, y + REAL(kind=dp) :: x(3) + REAL(kind=dp), DIMENSION(0:2) :: F_uv + !small parameter to avoid a problem of degenearcy + real(kind=dp), parameter :: avoid_deg = 1.e-4_dp + + D = D_in; F = F_in; t = t_in + call tetrahedron_sort(D, F, dummy, t) + Ans = 0.0_dp + + !case 1 and 3: nondissipative part, case 2: dissipative part + if (type == 1 .or. type == 3) then + if (type == 3) then + !treatment for accidental small band spliting(but degenerate actually) cases + do j = 1, 4 + if (abs(D(j)) < avoid_deg) then + D(j) = avoid_deg*(abs(D(j))/D(j)) + F = 0 + endif + enddo + endif + + !cutoff treatment, hw == 0.0 for case 3 + DAV = (D(2) + D(3))/2.0_dp + if (abs((D(2) - D(3))/(DAV + hw)) < tet_cutoff) then + D_small_prev = D(2); D_large_prev = D(3) + D(3) = DAV + 0.5_dp*abs(DAV + hw)*tet_cutoff + D(2) = DAV - 0.5_dp*abs(DAV + hw)*tet_cutoff + if (D(1) > D(2)) D(1) = D(1) + (D(2) - D_small_prev) + if (D(3) > D(4)) D(4) = D(4) + (D(3) - D_large_prev) + endif + DAV = (D(1) + D(2))/2.0_dp + if (abs((D(1) - D(2))/(DAV + hw)) < tet_cutoff) then + if (D(2) > 0) then + D(1) = D(2)*(2.0_dp - tet_cutoff)/(2.0_dp + tet_cutoff) + else + D(1) = D(2)*(2.0_dp + tet_cutoff)/(2.0_dp - tet_cutoff) + endif + endif + DAV = (D(3) + D(4))/2.0_dp + if (abs((D(3) - D(4))/(DAV + hw)) < tet_cutoff) then + if (D(3) > 0) then + D(4) = D(3)*(2.0_dp + tet_cutoff)/(2.0_dp - tet_cutoff) + else + D(4) = D(3)*(2.0_dp - tet_cutoff)/(2.0_dp + tet_cutoff) + endif + endif + + !intermediate variables for case 1 and 3 + do i = 1, 3 + dd(i) = (D(4) - D(i))/(D(i) + hw) + ll(i) = tetrahedron_log1p(dd(i)) + enddo + ff = 1.0_dp + + !determinant factor from parametrisation(tetrahedron volume) + Det_t = ABS(t(1, 1)*t(2, 2)*t(3, 3) + t(1, 2)*t(2, 3)*t(3, 1) + t(1, 3)*t(2, 1)*t(3, 2) & + - t(1, 1)*t(2, 3)*t(3, 2) - t(1, 3)*t(2, 2)*t(3, 1) - t(1, 2)*t(2, 1)*t(3, 3)) + endif + + select case (type) + case (1) + do i = 1, 3 + a = i + b = mod(i, 3) + 1 + c = mod(i + 1, 3) + 1 + cc(a, a) = -(1.0_dp + dd(a))*(3.0_dp*dd(a)**2 - 2.0_dp*(dd(b) + dd(c))*dd(a) + dd(b)*dd(c)) & + *((dd(b) - dd(c))*dd(b)*dd(c))**2 + cc(b, a) = -dd(a)*(1.0_dp + dd(b))*(dd(c) - dd(a))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + cc(c, a) = dd(a)*(1.0_dp + dd(c))*(dd(a) - dd(b))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + cc(4, a) = -(dd(a) - dd(b))*(dd(c) - dd(a))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + bb(a) = cc(4, a)*dd(a) + ff = ff*(1.0_dp + dd(a))/(dd(a)*(dd(a) - dd(b)))**2 + enddo + bb(4) = -dd(1)*dd(2)*dd(3)*((dd(1) - dd(2))*(dd(2) - dd(3))*(dd(3) - dd(1)))**2 + ff = -ff/6.0_dp + + do i = 1, 4 + Ans = Ans + F(i)*(cc(i, 1)*ll(1) + cc(i, 2)*ll(2) + cc(i, 3)*ll(3) + bb(i)) + enddo + Ans = Ans*ff/(D(4) + hw) + + tetrahedron_integral = Ans*Det_t + + case (2) + ! calculate integ d2k / |grad D| * F(k) + + ! obtaining |grad D| + call utility_inv3(t, t_inverse, Det_t) + t_inverse = t_inverse/Det_t + + GradD = 0.0_dp + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + GradD = GradD + t_inverse(i, k)*t_inverse(j, k)*(D(i + 1) - D(1))*(D(j + 1) - D(1)) + END DO + END DO + END DO + GradD = SQRT(ABS(GradD)) + + IF (hw < D(1)) THEN + Ans = 0.0_dp + ELSE IF (hw < D(2)) THEN + ! parametrization + x(1) = (hw - D(1))/(D(2) - D(1)) + x(2) = (hw - D(1))/(D(3) - D(1)) + x(3) = (hw - D(1))/(D(4) - D(1)) + ! Jacobian factor + Jac = tetrahedron_jacobian(t, x, 1) + ! integration formula + F_uv(0) = F(1) + (F(2) - F(1))*x(1) + F_uv(1) = (F(3) - F(1))*x(2) - (F(2) - F(1))*x(1) + F_uv(2) = (F(4) - F(1))*x(3) - (F(2) - F(1))*x(1) + Ans = Jac*(F_uv(0)/2.0_dp + (F_uv(1) + F_uv(2))/6.0_dp)/GradD + ELSE IF (hw < D(3)) THEN + ! parametrization + x(1) = (hw - D(4))/(D(2) - D(4)) + x(2) = (hw - D(1))/(D(3) - D(1)) + x(3) = (hw - D(1))/(D(4) - D(1)) + + !! triangle 1 + ! Jacobian factor + Jac = tetrahedron_jacobian(t, x, 2) + ! integration formula + F_uv(0) = F(1) + (F(4) - F(1))*x(3) + F_uv(1) = (F(2) - F(1))*x(1) + (F(4) - F(1))*(1.0_dp - x(1) - x(3)) + F_uv(2) = (F(3) - F(1))*x(2) - (F(4) - F(1))*x(3) + Ans = Jac*(F_uv(0)/2.0_dp + (F_uv(1) + F_uv(2))/6.0_dp) + + !! triangle 2 + y = (hw - D(3))/(D(2) - D(3)) + ! Jacobian factor + Jac = tetrahedron_jacobian(t, x, 3) + ! integration formula + F_uv(0) = F(1) + (F(2) - F(1))*y + (F(3) - F(1))*(1.0_dp - y) + F_uv(1) = (F(2) - F(1))*(x(1) - y) + & + (F(3) - F(1))*(y - 1.0_dp) + (F(4) - F(1))*(1.0_dp - x(1)) + F_uv(2) = -(F(2) - F(1))*y + (F(3) - F(1))*(y - 1.0_dp + x(2)) + Ans = Ans + Jac*(F_uv(0)/2.0_dp + (F_uv(1) + F_uv(2))/6.0_dp) + + Ans = Ans/GradD + ELSE IF (hw < D(4)) THEN + ! parametrization + x(1) = (hw - D(4))/(D(2) - D(4)) + x(2) = (hw - D(4))/(D(3) - D(4)) + x(3) = (hw - D(1))/(D(4) - D(1)) + ! Jacobian factor + Jac = tetrahedron_jacobian(t, x, 4) + ! integration formula + F_uv(0) = F(1) + (F(4) - F(1))*x(3) + F_uv(1) = (F(2) - F(1))*x(1) + (F(4) - F(1))*(1.0_dp - x(1) - x(3)) + F_uv(2) = (F(3) - F(1))*x(2) + (F(4) - F(1))*(1.0_dp - x(2) - x(3)) + Ans = Jac*(F_uv(0)/2.0_dp + (F_uv(1) + F_uv(2))/6.0_dp)/GradD + ELSE + Ans = 0.0_dp + END IF + tetrahedron_integral = Ans + + case (3) + do i = 1, 3 + a = i + b = mod(i, 3) + 1 + c = mod(i + 1, 3) + 1 + cc(a, a) = -(1.0_dp + dd(a))*(2.0_dp*dd(a)**3 + (3.0_dp - dd(b) - dd(c))*dd(a)**2 & + - 2.0_dp*(dd(b) + dd(c))*dd(a) + dd(b)*dd(c))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + cc(b, a) = -(1.0_dp + dd(a))*dd(a)*(1.0_dp + dd(b))*(dd(c) - dd(a))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + cc(c, a) = (1.0_dp + dd(a))*dd(a)*(1.0_dp + dd(c))*(dd(a) - dd(b))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + cc(4, a) = -(1.0_dp + dd(a))*(dd(a) - dd(b))*(dd(c) - dd(a))*((dd(b) - dd(c))*dd(b)*dd(c))**2 + bb(a) = cc(4, a)*dd(a) + ff = ff*(1.0_dp + dd(a))/(dd(a)*(dd(a) - dd(b)))**2 + enddo + bb(4) = -dd(1)*dd(2)*dd(3)*((dd(1) - dd(2))*(dd(2) - dd(3))*(dd(3) - dd(1)))**2 + ff = ff/2.0_dp + do i = 1, 4 + Ans = Ans + F(i)*(cc(i, 1)*ll(1) + cc(i, 2)*ll(2) + cc(i, 3)*ll(3) + bb(i)) + enddo + Ans = Ans*ff/(D(4) + hw)**2 + + tetrahedron_integral = Ans*Det_t + case default + tetrahedron_integral = 0.0_dp + end select + + return + end function tetrahedron_integral + + !========================================================= + subroutine tetrahedron_sort(a, b1, b2, t) + !===========================================! + !A simple bubble sort subroutine for size 4 ! + !Assuming the size of a is four ! + !===========================================! + + real(kind=dp), DIMENSION(4), INTENT(INOUT) :: a, b1, b2 + real(kind=dp), DIMENSION(3, 3), INTENT(INOUT) :: t + real(kind=dp), DIMENSION(4) :: b1_temp, b2_temp + real(kind=dp), DIMENSION(3, 4) :: t_temp + INTEGER :: i, j + INTEGER, DIMENSION(4) :: reference + real(kind=dp) :: temp + integer :: temp2 + + DO i = 1, 4 + reference(i) = i + ENDDO + b1_temp = b1; b2_temp = b2 + DO j = 1, 3 + t_temp(j, 1) = 0 + ENDDO + DO i = 2, 4 + DO j = 1, 3 + t_temp(j, i) = t(j, i - 1) + ENDDO + ENDDO + DO i = 4, 1, -1 + DO j = 1, i - 1, +1 + IF (a(j) > a(j + 1)) THEN + temp = a(j) + a(j) = a(j + 1) + a(j + 1) = temp + temp2 = reference(j) + reference(j) = reference(j + 1) + reference(j + 1) = temp2 + END IF + END DO + END DO + ! rearrange t(j,i) + DO i = 2, 4 + DO j = 1, 3 + t(j, i - 1) = t_temp(j, reference(i)) - t_temp(j, reference(1)) + ENDDO + ENDDO + ! rearrange b(j,i) + DO i = 1, 4 + b1(i) = b1_temp(reference(i)) + b2(i) = b2_temp(reference(i)) + ENDDO + + end subroutine tetrahedron_sort + +!========================================================= + function tetrahedron_jacobian(t, x, type) + !=======================================! + ! ! + ! Jacobian part of surface integrations ! + ! ! + !=======================================! + use w90_constants, only: dp + implicit none + real(kind=dp) :: tetrahedron_jacobian + real(kind=dp), DIMENSION(3, 3), INTENT(IN) :: t + real(kind=dp), DIMENSION(3), INTENT(IN) :: x + real(kind=dp), DIMENSION(3, 2) :: J + real(kind=dp) :: y + real(kind=dp) :: Ans + INTEGER, INTENT(IN) :: type + INTEGER :: j_, k, a, b, c, d + + IF (type == 1) THEN + J(1, 1) = -x(1); J(1, 2) = -x(1) + J(2, 1) = x(2); J(2, 2) = 0.0_dp + J(3, 1) = 0.0_dp; J(3, 2) = x(3) + ELSE IF (type == 2) THEN + J(1, 1) = x(1); J(1, 2) = 0.0_dp + J(2, 1) = 0.0_dp; J(2, 2) = x(2) + J(3, 1) = 1.0_dp - x(1) - x(3); J(3, 2) = -x(3) + ELSE IF (type == 3) THEN + y = x(1)*(x(2) - 1.0_dp)*x(3)/(-x(2) + x(1)*x(2) + x(2)*x(3) - x(1)*x(3)) + J(1, 1) = x(1) - y; J(1, 2) = -y + J(2, 1) = y - 1.0_dp; J(2, 2) = y - 1.0_dp + x(2) + J(3, 1) = 1.0_dp - x(1); J(3, 2) = 0.0_dp + ELSE + J(1, 1) = x(1); J(1, 2) = 0.0_dp + J(2, 1) = 0.0_dp; J(2, 2) = x(2) + J(3, 1) = 1.0_dp - x(1) - x(3); J(3, 2) = 1.0_dp - x(2) - x(3) + END IF + Ans = 0.0_dp + DO j_ = 1, 3 + DO k = 1, 3 + DO a = 1, 3 + DO b = 1, 3 + DO c = 1, 3 + DO d = 1, 3 + Ans = Ans + t(j_, a)*t(j_, b)*t(k, c)*t(k, d)*J(a, 1)*J(c, 2)*(J(b, 1)*J(d, 2) - J(b, 2)*J(d, 1)) + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + tetrahedron_jacobian = SQRT(ABS(Ans)) + + end function tetrahedron_jacobian + + function tetrahedron_log1p(x) + + use w90_constants, only: dp + + implicit none + + real(kind=dp) :: tetrahedron_log1p + real(kind=dp), intent(in) :: x + real(kind=dp) :: y, z + + if (ABS(x) > 0.5_dp) then + tetrahedron_log1p = LOG(ABS(1.0_dp + x)) + else + y = 1.0_dp + x + z = y - 1.0_dp + if (z == 0) then + tetrahedron_log1p = x + else + tetrahedron_log1p = x*LOG(y)/z + endif + endif + + end function tetrahedron_log1p + +end module w90_tetrahedron diff --git a/src/readwrite.F90 b/src/readwrite.F90 index 496e48fd8..43bba49c7 100644 --- a/src/readwrite.F90 +++ b/src/readwrite.F90 @@ -951,6 +951,9 @@ subroutine w90_readwrite_clear_keywords(stdout, seedname) call w90_readwrite_get_keyword(stdout, seedname, 'spin_kmesh_spacing', found) call w90_readwrite_get_keyword(stdout, seedname, 'spin_moment', found) call w90_readwrite_get_keyword(stdout, seedname, 'spn_formatted', found) + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_method', found) + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_correction', found) + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_cutoff', found) call w90_readwrite_get_keyword(stdout, seedname, 'transl_inv', found) call w90_readwrite_get_keyword(stdout, seedname, 'uhu_formatted', found) call w90_readwrite_get_keyword(stdout, seedname, 'use_degen_pert', found) From 7e18f03dccbdb44de7c9b9f9841422a3241110af Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 16:07:58 +0900 Subject: [PATCH 2/8] added ref. of tetrahedron method --- src/postw90/berry.F90 | 8 +++++--- src/postw90/tetrahedron.F90 | 9 ++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/postw90/berry.F90 b/src/postw90/berry.F90 index 87128de2a..1622dbc78 100644 --- a/src/postw90/berry.F90 +++ b/src/postw90/berry.F90 @@ -30,6 +30,7 @@ module w90_berry !! * QZYZ18 = PRB 98, 214402 (2018) (spin Hall conductivity - SHC) !! * RPS19 = PRB 99, 235113 (2019) (spin Hall conductivity - SHC) !! * IAdJS19 = arXiv:1910.06172 (2019) (quasi-degenerate k.p) + !! * GP22 = PRB 106, 075126 (2022) (tetrahedron method for spectral functions, SHC) ! --------------------------------------------------------------- ! ! * Undocumented, works for limited purposes only: @@ -523,10 +524,11 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k endif if (pw90_berry%tetrahedron_method) then - if (pw90_berry%tetrahedron_correction) then - write (stdout, '(/,3x,a)') ' Tetrahedron method with Kawamura`s correction' + if (pw90_berry%tetrahedron_higher_correction) then + write (stdout, '(/,3x,a)') ' Tetrahedron method with higher-order correction(PRB 89, 094515)' else - write (stdout, '(/,3x,a)') ' Tetrahedron method without correction' + write (stdout, '(/,3x,a)') ' Tetrahedron method without correction(PRB 89, 094515)' + call io_error ('Not yet implemented', stdout, seedname) endif endif diff --git a/src/postw90/tetrahedron.F90 b/src/postw90/tetrahedron.F90 index e57cb83c6..16283ab9b 100644 --- a/src/postw90/tetrahedron.F90 +++ b/src/postw90/tetrahedron.F90 @@ -28,7 +28,7 @@ module w90_tetrahedron !tetrahedron_jacobian !tetrahedron_log1p - public :: tetrahedron_spinhall + public :: tetrahedron_spinhall ! Minsu Ghim, and Cheol-Hwan Park, PRB 106 075126 ! To do: extend to other quantities(anomalous, ...) public :: tetrahedron_integral public :: tetrahedron_P_matrix_init @@ -125,8 +125,8 @@ end subroutine tetrahedron_array_init function tetrahedron_spinhall(F, E1, E2, t, hw, Ef, type, tet_cutoff) !============================================================================= ! Calculates contribution from a single tetrahedron, for the Kubo formula. ! - ! "integral d3k (f_{nk} - f_{mk} * (...) - ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB () ! + ! "integral d3k (f_{nk} - f_{mk}) * (...)" + ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB 106 075126 ! !============================================================================= use w90_constants, only: dp @@ -169,7 +169,6 @@ function tetrahedron_fermidirac(F, E_ref, E2, t, hw, Ef, type, tet_cutoff) !============================================================================= ! Calculates contribution from a single tetrahedron, for the Kubo formula. ! ! "integral d3k f_{nk} * (...) - ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB () ! !============================================================================= use w90_constants, only: dp @@ -274,7 +273,7 @@ function tetrahedron_integral(F_in, D_in, t_in, hw, type, tet_cutoff) ! type 2: dissipative ! ! type 3: nondissipative, linear/(linear)**2 ! ! ! - ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB () ! + ! Ref: Minsu Ghim and Cheol-Hwan Park, PRB 106 075126 ! !============================================================================= use w90_constants, only: dp From 3d9d0b70a2f581a9ec44880688a4d485a8b1d3e6 Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 16:08:46 +0900 Subject: [PATCH 3/8] changed name: tetrahedron_higher_correction --- src/postw90/berry.F90 | 2 +- src/postw90/postw90_common.F90 | 2 +- src/postw90/postw90_readwrite.F90 | 6 ++++-- src/postw90/postw90_types.F90 | 2 +- src/readwrite.F90 | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/postw90/berry.F90 b/src/postw90/berry.F90 index 1622dbc78..41974afff 100644 --- a/src/postw90/berry.F90 +++ b/src/postw90/berry.F90 @@ -432,7 +432,7 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k endif if (pw90_berry%tetrahedron_method) then - !if (pw90_berry%tetrahedron_correction) then + !if (pw90_berry%tetrahedron_higher_correction) then allocate (imjv(num_wann, num_wann, 0:pw90_berry%kmesh%mesh(1) + 2, 0:pw90_berry%kmesh%mesh(2) + 2, 0:3)) allocate (eig(num_wann, 0:pw90_berry%kmesh%mesh(1) + 2, 0:pw90_berry%kmesh%mesh(2) + 2, 0:3)) allocate (imjv_tet(num_wann, num_wann, 64)) diff --git a/src/postw90/postw90_common.F90 b/src/postw90/postw90_common.F90 index 8e1c7178e..856ce9ce7 100644 --- a/src/postw90/postw90_common.F90 +++ b/src/postw90/postw90_common.F90 @@ -508,7 +508,7 @@ subroutine pw90common_wanint_w90_wannier90_readwrite_dist(print_output, ws_regio if (allocated(error)) return call comms_bcast(pw90_berry%tetrahedron_method, 1, error, comm) if (allocated(error)) return - call comms_bcast(pw90_berry%tetrahedron_correction, 1, error, comm) + call comms_bcast(pw90_berry%tetrahedron_higher_correction, 1, error, comm) if (allocated(error)) return call comms_bcast(pw90_berry%tetrahedron_cutoff, 1, error, comm) if (allocated(error)) return diff --git a/src/postw90/postw90_readwrite.F90 b/src/postw90/postw90_readwrite.F90 index daffce807..0fec53dc3 100644 --- a/src/postw90/postw90_readwrite.F90 +++ b/src/postw90/postw90_readwrite.F90 @@ -842,9 +842,11 @@ subroutine w90_wannier90_readwrite_read_berry(pw90_calculation, pw90_berry, pw90 if (pw90_berry%tetrahedron_method .and. index(pw90_berry%task, 'shc') == 0) & call io_error('Error: tetrahedron_method only implemented in the shc routine', stdout, seedname) - pw90_berry%tetrahedron_correction = .true. - call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_correction', found, & + pw90_berry%tetrahedron_higher_correction = .true. + call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_higher_correction', found, & l_value=pw90_berry%tetrahedron_method) + if (.not. pw90_berry%tetrahedron_higher_correction) call io_error & + ('Error: Set tetrahedron_higher_correction = .true., tetrahedron_method works only with correction', stdout, seedname) pw90_berry%tetrahedron_cutoff = 1.e-4_dp call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_cutoff', found, & diff --git a/src/postw90/postw90_types.F90 b/src/postw90/postw90_types.F90 index 5b3180d47..7cb33351d 100644 --- a/src/postw90/postw90_types.F90 +++ b/src/postw90/postw90_types.F90 @@ -168,7 +168,7 @@ module w90_postw90_types ! + Module tetrahedron !type(pw90_tetrahedron_type) :: tetrahedron logical :: tetrahedron_method - logical :: tetrahedron_correction + logical :: tetrahedron_higher_correction real(kind=dp) :: tetrahedron_cutoff end type pw90_berry_mod_type diff --git a/src/readwrite.F90 b/src/readwrite.F90 index 88277a9d2..09f9f504b 100644 --- a/src/readwrite.F90 +++ b/src/readwrite.F90 @@ -1129,7 +1129,7 @@ subroutine w90_readwrite_clear_keywords(comm) call w90_readwrite_get_keyword('spin_moment', found, error, comm) call w90_readwrite_get_keyword('spn_formatted', found, error, comm) call w90_readwrite_get_keyword('tetrahedron_method', found, error, comm) - call w90_readwrite_get_keyword('tetrahedron_correction', found, error, comm) + call w90_readwrite_get_keyword('tetrahedron_higher_correction', found, error, comm) call w90_readwrite_get_keyword('tetrahedron_cutoff', found, error, comm) call w90_readwrite_get_keyword('transl_inv', found, error, comm) call w90_readwrite_get_keyword('uhu_formatted', found, error, comm) From 6a892dfbc9cfffa5dab7d61695a719265e81dc9d Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 16:19:16 +0900 Subject: [PATCH 4/8] added writing process of ref./higher_correction --- src/postw90/postw90_readwrite.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/postw90/postw90_readwrite.F90 b/src/postw90/postw90_readwrite.F90 index 0fec53dc3..c7a272ba6 100644 --- a/src/postw90/postw90_readwrite.F90 +++ b/src/postw90/postw90_readwrite.F90 @@ -2074,7 +2074,9 @@ subroutine w90_postw90_readwrite_write(print_output, w90_system, fermi_energy_li trim(w90_readwrite_get_smearing_type(pw90_dos%smearing%type_index)), '|' endif if (pw90_berry%tetrahedron_method) then - write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method :', ' T', '|' + write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method (PRB 106, 075125) :', ' T', '|' + write (stdout, '(1x,a46,10x,a8,13x,L8)') '| with higher-order correction :', & + pw90_berry%tetrahedron_higher_correction, '|' write (stdout, '(1x,a46,10x,f8.3,13x,a1)') '| Tetrahedron cutoff :', & pw90_berry%tetrahedron_cutoff, '|' else From 3dfcf0e539afb5ade3a8a8d24dfcd406c7001274 Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 16:42:58 +0900 Subject: [PATCH 5/8] better format for tetrahedron_cutoff --- src/postw90/postw90_readwrite.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postw90/postw90_readwrite.F90 b/src/postw90/postw90_readwrite.F90 index c7a272ba6..6bdd9f766 100644 --- a/src/postw90/postw90_readwrite.F90 +++ b/src/postw90/postw90_readwrite.F90 @@ -2077,7 +2077,7 @@ subroutine w90_postw90_readwrite_write(print_output, w90_system, fermi_energy_li write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method (PRB 106, 075125) :', ' T', '|' write (stdout, '(1x,a46,10x,a8,13x,L8)') '| with higher-order correction :', & pw90_berry%tetrahedron_higher_correction, '|' - write (stdout, '(1x,a46,10x,f8.3,13x,a1)') '| Tetrahedron cutoff :', & + write (stdout, '(1x,a46,10x,E8.3,13x,a1)') '| Tetrahedron cutoff :', & pw90_berry%tetrahedron_cutoff, '|' else write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method :', ' F', '|' From 9f7eda0a3ca14f447f8d912e1175aa1514d14b15 Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 17:46:15 +0900 Subject: [PATCH 6/8] stdout, seedname -> error, comm --- src/postw90/berry.F90 | 37 ++++++++++++++++++------------- src/postw90/postw90_readwrite.F90 | 16 ++++++------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/postw90/berry.F90 b/src/postw90/berry.F90 index 41974afff..a1ae29fd3 100644 --- a/src/postw90/berry.F90 +++ b/src/postw90/berry.F90 @@ -528,7 +528,7 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k write (stdout, '(/,3x,a)') ' Tetrahedron method with higher-order correction(PRB 89, 094515)' else write (stdout, '(/,3x,a)') ' Tetrahedron method without correction(PRB 89, 094515)' - call io_error ('Not yet implemented', stdout, seedname) + call set_error_input(error, 'Not yet implemented', comm) endif endif @@ -590,8 +590,8 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k ! if (pw90_berry%wanint_kpoint_file) then - if (pw90_berry%tetrahedron_method) call io_error & - ('Tetrahedron method not implemented with wanint_kpoint_file', stdout, seedname) + if (pw90_berry%tetrahedron_method) call set_error_input& + (error, 'Tetrahedron method not implemented with wanint_kpoint_file', comm) ! NOTE: still need to specify pw90_pw90_berry%kmesh%mesh in the input file ! ! - Must use the correct nominal value in order to @@ -1037,7 +1037,7 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k call berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wannier_data, ws_distance, & wigner_seitz, AA_R, HH_R, SH_R, SHR_R, SR_R, SS_R, SAA_R, SBB_R, & kpt, imjv(:, :, loop_x + 1, loop_y + 1, i), eig(:, loop_x + 1, loop_y + 1, i), & - real_lattice, mp_grid, num_wann, seedname, stdout) + real_lattice, mp_grid, num_wann, seedname, stdout, error, comm) else imjv(:, :, loop_x + 1, loop_y + 1, i) = imjv(:, :, loop_x + 1, loop_y + 1, i + 1) eig(:, loop_x + 1, loop_y + 1, i) = eig(:, loop_x + 1, loop_y + 1, i + 1) @@ -3065,7 +3065,7 @@ end subroutine berry_get_shc_klist subroutine berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wannier_data, ws_distance, & wigner_seitz, AA_R, HH_R, SH_R, SHR_R, SR_R, SS_R, SAA_R, SBB_R, & kpt, imjv, eig_out, real_lattice, mp_grid, num_wann, & - seedname, stdout) + seedname, stdout, error, comm) !====================================================================! ! returns the values used for calculating the SHC Kubo formula ! @@ -3074,6 +3074,8 @@ subroutine berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wann !====================================================================! use w90_constants, only: dp, cmplx_0, cmplx_i use w90_utility, only: utility_diagonalize, utility_rotate + use w90_error, only: w90_error_type + use w90_comms, only: w90comm_type use w90_types, only: print_output_type, wannier_data_type, ws_region_type, & ws_distance_type use w90_postw90_types, only: pw90_berry_mod_type, pw90_spin_hall_type, wigner_seitz_type @@ -3086,6 +3088,8 @@ subroutine berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wann type(wannier_data_type), intent(in) :: wannier_data type(wigner_seitz_type), intent(inout) :: wigner_seitz type(ws_distance_type), intent(inout) :: ws_distance + type(w90_error_type), allocatable, intent(out) :: error + type(w90comm_type), intent(in) :: comm integer, intent(in) :: num_wann integer, intent(in) :: mp_grid(3) @@ -3136,42 +3140,43 @@ subroutine berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wann call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & HH_R, kpt, real_lattice, & - mp_grid, num_wann, seedname, stdout, OO=HH, & + mp_grid, num_wann, error, comm, OO=HH, & OO_dx=delHH(:, :, 1), & OO_dy=delHH(:, :, 2), & OO_dz=delHH(:, :, 3)) + if (allocated(error)) return ! call wham_get_eig_deleig(dis_manifold, kpt_latt, pw90_band_deriv_degen, ws_region, print_output, wannier_data, & ! ws_distance, wigner_seitz, delHH, HH, HH_R, u_matrix, UU, v_matrix, & ! del_eig, eig, eigval, kpt, real_lattice, scissors_shift, mp_grid, & ! num_bands, num_kpts, num_wann, num_valence_bands, effective_model, & -! have_disentangled, seedname, stdout, comm) - call utility_diagonalize(HH, num_wann, eig, UU, stdout, seedname) +! have_disentangled, timer, error, comm) + call utility_diagonalize(HH, num_wann, eig, UU, error, comm) call pw90common_fourier_R_to_k_vec(ws_region, wannier_data, ws_distance, wigner_seitz, & AA_R, kpt, & - real_lattice, mp_grid, num_wann, seedname, stdout, & - OO_true=AA) + real_lattice, mp_grid, num_wann, & + error, comm, OO_true=AA) call pw90common_fourier_R_to_k_vec(ws_region, wannier_data, ws_distance, wigner_seitz, & SS_R, kpt, & - real_lattice, mp_grid, num_wann, seedname, stdout, & - OO_true=SS) + real_lattice, mp_grid, num_wann, & + error, comm, OO_true=SS) if (index(pw90_spin_hall%method, 'ryoo') > 0) then call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SAA_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + kpt, real_lattice, mp_grid, num_wann, error, comm,& OO=SAA(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SBB_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + kpt, real_lattice, mp_grid, num_wann, error, comm,& OO=SBB(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) else call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SR_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + kpt, real_lattice, mp_grid, num_wann, error, comm,& OO=SAA(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SHR_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, seedname, stdout, & + kpt, real_lattice, mp_grid, num_wann, error, comm,& OO=SBB(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) endif diff --git a/src/postw90/postw90_readwrite.F90 b/src/postw90/postw90_readwrite.F90 index 6bdd9f766..2eded0bd3 100644 --- a/src/postw90/postw90_readwrite.F90 +++ b/src/postw90/postw90_readwrite.F90 @@ -837,22 +837,22 @@ subroutine w90_wannier90_readwrite_read_berry(pw90_calculation, pw90_berry, pw90 if (allocated(error)) return pw90_berry%tetrahedron_method = .false. - call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_method', found, & + call w90_readwrite_get_keyword('tetrahedron_method', found, error, comm, & l_value=pw90_berry%tetrahedron_method) if (pw90_berry%tetrahedron_method .and. index(pw90_berry%task, 'shc') == 0) & - call io_error('Error: tetrahedron_method only implemented in the shc routine', stdout, seedname) + call set_error_input(error, 'Error: tetrahedron_method only implemented in the shc routine', comm) pw90_berry%tetrahedron_higher_correction = .true. - call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_higher_correction', found, & + call w90_readwrite_get_keyword('tetrahedron_higher_correction', found, error, comm, & l_value=pw90_berry%tetrahedron_method) - if (.not. pw90_berry%tetrahedron_higher_correction) call io_error & - ('Error: Set tetrahedron_higher_correction = .true., tetrahedron_method works only with correction', stdout, seedname) + if (.not. pw90_berry%tetrahedron_higher_correction) call set_error_input & + (error, 'Error: Set tetrahedron_higher_correction = .true., tetrahedron_method works only with correction', comm) pw90_berry%tetrahedron_cutoff = 1.e-4_dp - call w90_readwrite_get_keyword(stdout, seedname, 'tetrahedron_cutoff', found, & + call w90_readwrite_get_keyword('tetrahedron_cutoff', found, error, comm, & r_value=pw90_berry%tetrahedron_cutoff) - if (pw90_berry%tetrahedron_cutoff <= 0._dp) call io_error & - ('Error: tetrahedron_cutoff must be greater than zero', stdout, seedname) + if (pw90_berry%tetrahedron_cutoff <= 0._dp) call set_error_input & + (error, 'Error: tetrahedron_cutoff must be greater than zero', comm) kdotp_num_bands = 0 call w90_readwrite_get_keyword('kdotp_num_bands', found, error, comm, i_value=kdotp_num_bands) From c7cc4956bfe3fc09b22a8ba41defbcd30bd3d051 Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 18:03:21 +0900 Subject: [PATCH 7/8] make test-suite for tetrahedron(spin hall) --- test-suite/tests/jobconfig | 11 + .../testpostw90_pt_tetra_shcfermi/.gitignore | 5 + .../testpostw90_pt_tetra_shcfermi/Makefile | 24 +++ .../testpostw90_pt_tetra_shcfermi/Pt.amn.bz2 | 1 + .../Pt.chk.fmt.bz2 | 1 + .../testpostw90_pt_tetra_shcfermi/Pt.eig | 1 + .../testpostw90_pt_tetra_shcfermi/Pt.mmn.bz2 | 1 + .../testpostw90_pt_tetra_shcfermi/Pt.spn.bz2 | 1 + .../testpostw90_pt_tetra_shcfermi/Pt.win | 143 +++++++++++++ .../benchmark.out.default.inp=Pt.win | 202 ++++++++++++++++++ .../testpostw90_pt_tetra_shcfreq/.gitignore | 5 + .../testpostw90_pt_tetra_shcfreq/Makefile | 24 +++ .../testpostw90_pt_tetra_shcfreq/Pt.amn.bz2 | 1 + .../Pt.chk.fmt.bz2 | 1 + .../tests/testpostw90_pt_tetra_shcfreq/Pt.eig | 1 + .../testpostw90_pt_tetra_shcfreq/Pt.mmn.bz2 | 1 + .../testpostw90_pt_tetra_shcfreq/Pt.spn.bz2 | 1 + .../tests/testpostw90_pt_tetra_shcfreq/Pt.win | 144 +++++++++++++ .../benchmark.out.default.inp=Pt.win | 22 ++ 19 files changed, 590 insertions(+) create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfermi/.gitignore create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfermi/Makefile create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.amn.bz2 create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.chk.fmt.bz2 create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.eig create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.mmn.bz2 create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.spn.bz2 create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.win create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfermi/benchmark.out.default.inp=Pt.win create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfreq/.gitignore create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfreq/Makefile create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.amn.bz2 create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.chk.fmt.bz2 create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.eig create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.mmn.bz2 create mode 120000 test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.spn.bz2 create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.win create mode 100644 test-suite/tests/testpostw90_pt_tetra_shcfreq/benchmark.out.default.inp=Pt.win diff --git a/test-suite/tests/jobconfig b/test-suite/tests/jobconfig index 486a89f81..6e6cbd060 100644 --- a/test-suite/tests/jobconfig +++ b/test-suite/tests/jobconfig @@ -430,6 +430,17 @@ program = POSTW90_KDOTP_OK inputs_args = ('gaas.win', '') output = gaas-kdotp_0.dat +# Test of tetrahedron method for spin Hall conductivity of Pt +[testpostw90_pt_tetra_shcfreq/] +program = POSTW90_SHCFREQDAT_OK +inputs_args = ('Pt.win', '') +output = Pt-shc-freqscan.dat + +[testpostw90_pt_tetra_shcfermi/] +program = POSTW90_SHCFERMIDAT_OK +inputs_args = ('Pt.win', '') +output = Pt-shc-fermiscan.dat + # Test of MPI error handling implementation [partestw90_mpierr/] program = WANNIER90_WERR_FAIL diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/.gitignore b/test-suite/tests/testpostw90_pt_tetra_shcfermi/.gitignore new file mode 100644 index 000000000..89f4d36c5 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/.gitignore @@ -0,0 +1,5 @@ +Pt-shc-fermiscan.dat +Pt.wpout +Pt.amn +Pt.mmn +Pt.spn diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Makefile b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Makefile new file mode 100644 index 000000000..be37a8d48 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Makefile @@ -0,0 +1,24 @@ +all: $(patsubst %.chk.fmt.bz2, %.chk, $(wildcard *.chk.fmt.bz2)) $(patsubst %.mmn.bz2, %.mmn, $(wildcard *.mmn.bz2)) $(patsubst %.amn.bz2, %.amn, $(wildcard *.amn.bz2)) $(patsubst %.spn.bz2, %.spn, $(wildcard *.spn.bz2)) + +%.chk: %.chk.fmt.bz2 + $(eval SEEDNAME:=$(patsubst %.chk.fmt.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).chk.fmt && ../../../w90chk2chk.x -f2u $(SEEDNAME) && rm $(SEEDNAME).chk.fmt + +%.mmn: %.mmn.bz2 + $(eval SEEDNAME:=$(patsubst %.mmn.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).mmn + +%.amn: %.amn.bz2 + $(eval SEEDNAME:=$(patsubst %.amn.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).amn + +%.spn: %.spn.bz2 + $(eval SEEDNAME:=$(patsubst %.spn.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).spn + + +.PHONY: all diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.amn.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.amn.bz2 new file mode 120000 index 000000000..a358ce810 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.amn.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.amn.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.chk.fmt.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.chk.fmt.bz2 new file mode 120000 index 000000000..1229bde58 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.chk.fmt.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.chk.fmt.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.eig b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.eig new file mode 120000 index 000000000..4e933729b --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.eig @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.eig \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.mmn.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.mmn.bz2 new file mode 120000 index 000000000..a73417d80 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.mmn.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.mmn.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.spn.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.spn.bz2 new file mode 120000 index 000000000..4f2a73bd3 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.spn.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.spn.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.win b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.win new file mode 100644 index 000000000..0174b375a --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/Pt.win @@ -0,0 +1,143 @@ +shc_freq_scan = false +shc_alpha = 1 +shc_beta = 2 +shc_gamma = 3 +spn_formatted = true +shc_method = qiao + +tetrahedron_method = true +tetrahedron_higher_correction = true +tetrahedron_cutoff = 1.e-4 + +#kpath = true +kpath_task = bands+shc +kpath_bands_colour = shc +kpath_num_points = 400 +#kubo_adpt_smr = false +#kubo_smr_fixed_en_width = 1 +#fermi_energy = 17.9919 + +begin kpoint_path +W 0.75 0.50 0.25 L 0.50 0.00 0.00 +L 0.50 0.00 0.00 G 0.00 0.00 0.00 +G 0.00 0.00 0.00 X 0.50 0.50 0.00 +X 0.50 0.50 0.00 W 0.75 0.50 0.25 +W 0.75 0.50 0.25 G 0.00 0.00 0.00 +end kpoint_path + +#kslice = true +kslice_task = shc+fermi_lines +kslice_2dkmesh = 400 +kslice_corner = 0.0 0.0 0.0 +kslice_b1 = 1.00 0.00 0.00 +kslice_b2 = 0.3535533905932738 1.0606601717798214 0.00 + +berry = true +berry_task = eval_shc +berry_kmesh = 10 +berry_curv_unit = ang2 +#berry_curv_adpt_kmesh = 5 +#berry_curv_adpt_kmesh_thresh = 100.0 + +fermi_energy_min = 6 +fermi_energy_max = 26 +fermi_energy_step = 0.1 + +num_bands = 40 +num_wann = 18 + +dis_win_min = 0.0d0 +dis_win_max = 60.0d0 +dis_froz_min = 0.0d0 +dis_froz_max = 30.00d0 +dis_num_iter = 2000 +dis_conv_tol = 1.0e-10 +conv_tol = 1.0e-10 +conv_window = 40 +num_iter = 2000 +guiding_centres = T + +spinors = true +begin projections +Pt: d;s;p +end projections + +begin unit_cell_cart +bohr +-3.703863220455861e0 0.000000000000000e0 3.703863220455861e0 + 0.000000000000000e0 3.703863220455861e0 3.703863220455861e0 +-3.703863220455861e0 3.703863220455861e0 0.000000000000000e0 +end unit_cell_cart + +begin atoms_frac +Pt 0.000 0.000 0.000 +end atoms_frac + +mp_grid = 4 4 4 + +begin kpoints + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.25000000 + 0.00000000 0.00000000 0.50000000 + 0.00000000 0.00000000 0.75000000 + 0.00000000 0.25000000 0.00000000 + 0.00000000 0.25000000 0.25000000 + 0.00000000 0.25000000 0.50000000 + 0.00000000 0.25000000 0.75000000 + 0.00000000 0.50000000 0.00000000 + 0.00000000 0.50000000 0.25000000 + 0.00000000 0.50000000 0.50000000 + 0.00000000 0.50000000 0.75000000 + 0.00000000 0.75000000 0.00000000 + 0.00000000 0.75000000 0.25000000 + 0.00000000 0.75000000 0.50000000 + 0.00000000 0.75000000 0.75000000 + 0.25000000 0.00000000 0.00000000 + 0.25000000 0.00000000 0.25000000 + 0.25000000 0.00000000 0.50000000 + 0.25000000 0.00000000 0.75000000 + 0.25000000 0.25000000 0.00000000 + 0.25000000 0.25000000 0.25000000 + 0.25000000 0.25000000 0.50000000 + 0.25000000 0.25000000 0.75000000 + 0.25000000 0.50000000 0.00000000 + 0.25000000 0.50000000 0.25000000 + 0.25000000 0.50000000 0.50000000 + 0.25000000 0.50000000 0.75000000 + 0.25000000 0.75000000 0.00000000 + 0.25000000 0.75000000 0.25000000 + 0.25000000 0.75000000 0.50000000 + 0.25000000 0.75000000 0.75000000 + 0.50000000 0.00000000 0.00000000 + 0.50000000 0.00000000 0.25000000 + 0.50000000 0.00000000 0.50000000 + 0.50000000 0.00000000 0.75000000 + 0.50000000 0.25000000 0.00000000 + 0.50000000 0.25000000 0.25000000 + 0.50000000 0.25000000 0.50000000 + 0.50000000 0.25000000 0.75000000 + 0.50000000 0.50000000 0.00000000 + 0.50000000 0.50000000 0.25000000 + 0.50000000 0.50000000 0.50000000 + 0.50000000 0.50000000 0.75000000 + 0.50000000 0.75000000 0.00000000 + 0.50000000 0.75000000 0.25000000 + 0.50000000 0.75000000 0.50000000 + 0.50000000 0.75000000 0.75000000 + 0.75000000 0.00000000 0.00000000 + 0.75000000 0.00000000 0.25000000 + 0.75000000 0.00000000 0.50000000 + 0.75000000 0.00000000 0.75000000 + 0.75000000 0.25000000 0.00000000 + 0.75000000 0.25000000 0.25000000 + 0.75000000 0.25000000 0.50000000 + 0.75000000 0.25000000 0.75000000 + 0.75000000 0.50000000 0.00000000 + 0.75000000 0.50000000 0.25000000 + 0.75000000 0.50000000 0.50000000 + 0.75000000 0.50000000 0.75000000 + 0.75000000 0.75000000 0.00000000 + 0.75000000 0.75000000 0.25000000 + 0.75000000 0.75000000 0.50000000 + 0.75000000 0.75000000 0.75000000 +end kpoints diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfermi/benchmark.out.default.inp=Pt.win b/test-suite/tests/testpostw90_pt_tetra_shcfermi/benchmark.out.default.inp=Pt.win new file mode 100644 index 000000000..d02bafb32 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfermi/benchmark.out.default.inp=Pt.win @@ -0,0 +1,202 @@ +#No. Fermi energy(eV) SHC((hbar/e)*S/cm) + 1 6.000000 0.00000000E+00 + 2 6.100000 0.00000000E+00 + 3 6.200000 0.00000000E+00 + 4 6.300000 0.00000000E+00 + 5 6.400000 0.00000000E+00 + 6 6.500000 0.00000000E+00 + 7 6.600000 0.00000000E+00 + 8 6.700000 0.00000000E+00 + 9 6.800000 0.00000000E+00 + 10 6.900000 0.00000000E+00 + 11 7.000000 0.00000000E+00 + 12 7.100000 0.00000000E+00 + 13 7.200000 0.00000000E+00 + 14 7.300000 0.00000000E+00 + 15 7.400000 0.00000000E+00 + 16 7.500000 0.00000000E+00 + 17 7.600000 -0.41127205E-01 + 18 7.700000 0.63312201E-01 + 19 7.800000 0.14360764E+00 + 20 7.900000 0.17449464E+00 + 21 8.000000 0.15424238E+00 + 22 8.100000 0.13176655E+00 + 23 8.200000 0.11172428E+00 + 24 8.300000 0.81203418E-01 + 25 8.400000 0.48944789E-01 + 26 8.500000 -0.40272762E+00 + 27 8.600000 -0.70126494E+00 + 28 8.700000 -0.23912914E+00 + 29 8.800000 -0.41067543E+00 + 30 8.900000 -0.68931374E+00 + 31 9.000000 -0.10099429E+01 + 32 9.100000 -0.14588221E+01 + 33 9.200000 -0.19440051E+01 + 34 9.300000 -0.26457916E+01 + 35 9.400000 -0.33877137E+01 + 36 9.500000 -0.49751393E+01 + 37 9.600000 -0.45956535E+01 + 38 9.700000 -0.68097118E+01 + 39 9.800000 -0.97085580E+01 + 40 9.900000 -0.10732411E+02 + 41 10.000000 -0.12193213E+02 + 42 10.100000 -0.14399343E+02 + 43 10.200000 -0.16823392E+02 + 44 10.300000 -0.20019011E+02 + 45 10.400000 -0.25180244E+02 + 46 10.500000 -0.31664917E+02 + 47 10.600000 -0.27219807E+02 + 48 10.700000 -0.29739007E+02 + 49 10.800000 -0.36641260E+02 + 50 10.900000 -0.39903443E+02 + 51 11.000000 -0.43132479E+02 + 52 11.100000 -0.48341648E+02 + 53 11.200000 0.43658410E+03 + 54 11.300000 -0.57016653E+02 + 55 11.400000 -0.65090744E+02 + 56 11.500000 -0.10797124E+03 + 57 11.600000 -0.10300160E+03 + 58 11.700000 -0.14111221E+03 + 59 11.800000 -0.20393421E+03 + 60 11.900000 0.27757035E+05 + 61 12.000000 -0.19444405E+03 + 62 12.100000 -0.37319471E+03 + 63 12.200000 -0.50511197E+03 + 64 12.300000 -0.69796546E+03 + 65 12.400000 -0.88727347E+03 + 66 12.500000 -0.99625397E+03 + 67 12.600000 -0.97111060E+03 + 68 12.700000 -0.65482543E+03 + 69 12.800000 -0.45597134E+03 + 70 12.900000 -0.91771596E+03 + 71 13.000000 -0.10646250E+04 + 72 13.100000 -0.12010676E+04 + 73 13.200000 -0.14292425E+04 + 74 13.300000 -0.15642916E+04 + 75 13.400000 -0.16694349E+04 + 76 13.500000 -0.23899028E+04 + 77 13.600000 -0.20326982E+04 + 78 13.700000 -0.20609091E+04 + 79 13.800000 -0.20403600E+04 + 80 13.900000 -0.19657195E+04 + 81 14.000000 -0.18411640E+04 + 82 14.100000 -0.16225791E+04 + 83 14.200000 -0.14148275E+04 + 84 14.300000 -0.13688867E+04 + 85 14.400000 -0.12561536E+04 + 86 14.500000 -0.96452897E+03 + 87 14.600000 -0.86700845E+03 + 88 14.700000 -0.64770025E+03 + 89 14.800000 -0.66188512E+03 + 90 14.900000 -0.60421177E+03 + 91 15.000000 -0.65639040E+03 + 92 15.100000 -0.67234379E+03 + 93 15.200000 -0.74416570E+03 + 94 15.300000 -0.73896443E+03 + 95 15.400000 -0.68629306E+03 + 96 15.500000 -0.65813090E+03 + 97 15.600000 -0.62026509E+03 + 98 15.700000 -0.30345240E+03 + 99 15.800000 -0.11570286E+03 + 100 15.900000 -0.14248383E+03 + 101 16.000000 -0.28612915E+03 + 102 16.100000 -0.25709142E+03 + 103 16.200000 -0.39513467E+03 + 104 16.300000 -0.49736324E+03 + 105 16.400000 -0.48054480E+03 + 106 16.500000 -0.31111273E+03 + 107 16.600000 -0.27964029E+03 + 108 16.700000 -0.30360258E+03 + 109 16.800000 0.21880608E+01 + 110 16.900000 0.14976234E+03 + 111 17.000000 0.24539616E+03 + 112 17.100000 0.42882164E+03 + 113 17.200000 0.57791161E+03 + 114 17.300000 0.78871040E+03 + 115 17.400000 0.84531682E+03 + 116 17.500000 0.96971384E+03 + 117 17.600000 0.14043909E+04 + 118 17.700000 0.15173745E+04 + 119 17.800000 0.18315210E+04 + 120 17.900000 0.18802817E+04 + 121 18.000000 0.22940859E+04 + 122 18.100000 0.18433464E+04 + 123 18.200000 0.17482589E+04 + 124 18.300000 0.16200805E+04 + 125 18.400000 0.14176897E+04 + 126 18.500000 0.12487406E+04 + 127 18.600000 0.10965366E+04 + 128 18.700000 0.97982321E+03 + 129 18.800000 0.88715642E+03 + 130 18.900000 0.80094897E+03 + 131 19.000000 0.72668148E+03 + 132 19.100000 0.66193390E+03 + 133 19.200000 0.61312454E+03 + 134 19.300000 0.56389380E+03 + 135 19.400000 0.51538882E+03 + 136 19.500000 0.47200913E+03 + 137 19.600000 0.43155947E+03 + 138 19.700000 0.39498550E+03 + 139 19.800000 0.35986029E+03 + 140 19.900000 0.33107881E+03 + 141 20.000000 0.30292950E+03 + 142 20.100000 0.28732256E+03 + 143 20.200000 0.26331846E+03 + 144 20.300000 0.24059022E+03 + 145 20.400000 0.23277771E+03 + 146 20.500000 0.37962667E+03 + 147 20.600000 0.20070884E+03 + 148 20.700000 0.17275304E+03 + 149 20.800000 0.19477009E+03 + 150 20.900000 0.18725300E+03 + 151 21.000000 0.18747127E+03 + 152 21.100000 0.20657722E+03 + 153 21.200000 0.19412190E+03 + 154 21.300000 0.20000378E+03 + 155 21.400000 0.21009683E+03 + 156 21.500000 0.22506809E+03 + 157 21.600000 0.25040406E+03 + 158 21.700000 0.35295458E+03 + 159 21.800000 0.33430723E+03 + 160 21.900000 0.35952388E+03 + 161 22.000000 0.39686137E+03 + 162 22.100000 0.42788135E+03 + 163 22.200000 0.45203188E+03 + 164 22.300000 0.49684012E+03 + 165 22.400000 0.49145984E+03 + 166 22.500000 0.51225399E+03 + 167 22.600000 0.52899629E+03 + 168 22.700000 0.26334760E+03 + 169 22.800000 0.54830268E+03 + 170 22.900000 0.54975885E+03 + 171 23.000000 0.52785318E+03 + 172 23.100000 0.54226719E+03 + 173 23.200000 0.52988541E+03 + 174 23.300000 0.50771418E+03 + 175 23.400000 0.46715781E+03 + 176 23.500000 0.55066876E+03 + 177 23.600000 0.63633141E+03 + 178 23.700000 0.66284562E+03 + 179 23.800000 0.51798700E+03 + 180 23.900000 0.59093542E+03 + 181 24.000000 0.70607522E+03 + 182 24.100000 0.78079327E+03 + 183 24.200000 0.84549910E+03 + 184 24.300000 0.89562495E+03 + 185 24.400000 0.92932965E+03 + 186 24.500000 0.93844058E+03 + 187 24.600000 0.94434395E+03 + 188 24.700000 0.90033005E+03 + 189 24.800000 0.84301717E+03 + 190 24.900000 0.80872827E+03 + 191 25.000000 0.72707906E+03 + 192 25.100000 0.65026329E+03 + 193 25.200000 0.57736155E+03 + 194 25.300000 0.51429769E+03 + 195 25.400000 0.44997931E+03 + 196 25.500000 0.38985995E+03 + 197 25.600000 0.34738500E+03 + 198 25.700000 0.29262046E+03 + 199 25.800000 0.28926738E+03 + 200 25.900000 0.26749632E+03 + 201 26.000000 0.24306156E+03 diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/.gitignore b/test-suite/tests/testpostw90_pt_tetra_shcfreq/.gitignore new file mode 100644 index 000000000..c98d2dd8d --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/.gitignore @@ -0,0 +1,5 @@ +Pt-shc-freqscan.dat +Pt.wpout +Pt.amn +Pt.mmn +Pt.spn diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Makefile b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Makefile new file mode 100644 index 000000000..be37a8d48 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Makefile @@ -0,0 +1,24 @@ +all: $(patsubst %.chk.fmt.bz2, %.chk, $(wildcard *.chk.fmt.bz2)) $(patsubst %.mmn.bz2, %.mmn, $(wildcard *.mmn.bz2)) $(patsubst %.amn.bz2, %.amn, $(wildcard *.amn.bz2)) $(patsubst %.spn.bz2, %.spn, $(wildcard *.spn.bz2)) + +%.chk: %.chk.fmt.bz2 + $(eval SEEDNAME:=$(patsubst %.chk.fmt.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).chk.fmt && ../../../w90chk2chk.x -f2u $(SEEDNAME) && rm $(SEEDNAME).chk.fmt + +%.mmn: %.mmn.bz2 + $(eval SEEDNAME:=$(patsubst %.mmn.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).mmn + +%.amn: %.amn.bz2 + $(eval SEEDNAME:=$(patsubst %.amn.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).amn + +%.spn: %.spn.bz2 + $(eval SEEDNAME:=$(patsubst %.spn.bz2, %, $<)) + echo $(SEEDNAME) + cat $< | bunzip2 - > $(SEEDNAME).spn + + +.PHONY: all diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.amn.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.amn.bz2 new file mode 120000 index 000000000..a358ce810 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.amn.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.amn.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.chk.fmt.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.chk.fmt.bz2 new file mode 120000 index 000000000..1229bde58 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.chk.fmt.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.chk.fmt.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.eig b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.eig new file mode 120000 index 000000000..4e933729b --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.eig @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.eig \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.mmn.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.mmn.bz2 new file mode 120000 index 000000000..a73417d80 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.mmn.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.mmn.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.spn.bz2 b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.spn.bz2 new file mode 120000 index 000000000..4f2a73bd3 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.spn.bz2 @@ -0,0 +1 @@ +../../checkpoints/pt_shc_postw90/Pt.spn.bz2 \ No newline at end of file diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.win b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.win new file mode 100644 index 000000000..ed7b97915 --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/Pt.win @@ -0,0 +1,144 @@ +shc_freq_scan = true +shc_alpha = 1 +shc_beta = 2 +shc_gamma = 3 +spn_formatted = true +shc_method = qiao + +tetrahedron_method = true +tetrahedron_higher_correction = true +tetrahedron_cutoff = 1.e-4 + +#kpath = true +kpath_task = bands+shc +kpath_bands_colour = shc +kpath_num_points = 400 +#kubo_adpt_smr = false +#kubo_smr_fixed_en_width = 1 +#fermi_energy = 17.9919 + +begin kpoint_path +W 0.75 0.50 0.25 L 0.50 0.00 0.00 +L 0.50 0.00 0.00 G 0.00 0.00 0.00 +G 0.00 0.00 0.00 X 0.50 0.50 0.00 +X 0.50 0.50 0.00 W 0.75 0.50 0.25 +W 0.75 0.50 0.25 G 0.00 0.00 0.00 +end kpoint_path + +#kslice = true +kslice_task = shc+fermi_lines +kslice_2dkmesh = 400 +kslice_corner = 0.0 0.0 0.0 +kslice_b1 = 1.00 0.00 0.00 +kslice_b2 = 0.3535533905932738 1.0606601717798214 0.00 + +berry = true +berry_task = eval_shc +berry_kmesh = 10 +berry_curv_unit = ang2 +#berry_curv_adpt_kmesh = 5 +#berry_curv_adpt_kmesh_thresh = 100.0 + +fermi_energy = 18.3823 +kubo_freq_min = 0.0 +kubo_freq_max = 2.0 +kubo_freq_step = 0.1 + +num_bands = 40 +num_wann = 18 + +dis_win_min = 0.0d0 +dis_win_max = 60.0d0 +dis_froz_min = 0.0d0 +dis_froz_max = 30.00d0 +dis_num_iter = 2000 +dis_conv_tol = 1.0e-10 +conv_tol = 1.0e-10 +conv_window = 40 +num_iter = 2000 +guiding_centres = T + +spinors = true +begin projections +Pt: d;s;p +end projections + +begin unit_cell_cart +bohr +-3.703863220455861e0 0.000000000000000e0 3.703863220455861e0 + 0.000000000000000e0 3.703863220455861e0 3.703863220455861e0 +-3.703863220455861e0 3.703863220455861e0 0.000000000000000e0 +end unit_cell_cart + +begin atoms_frac +Pt 0.000 0.000 0.000 +end atoms_frac + +mp_grid = 4 4 4 + +begin kpoints + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.25000000 + 0.00000000 0.00000000 0.50000000 + 0.00000000 0.00000000 0.75000000 + 0.00000000 0.25000000 0.00000000 + 0.00000000 0.25000000 0.25000000 + 0.00000000 0.25000000 0.50000000 + 0.00000000 0.25000000 0.75000000 + 0.00000000 0.50000000 0.00000000 + 0.00000000 0.50000000 0.25000000 + 0.00000000 0.50000000 0.50000000 + 0.00000000 0.50000000 0.75000000 + 0.00000000 0.75000000 0.00000000 + 0.00000000 0.75000000 0.25000000 + 0.00000000 0.75000000 0.50000000 + 0.00000000 0.75000000 0.75000000 + 0.25000000 0.00000000 0.00000000 + 0.25000000 0.00000000 0.25000000 + 0.25000000 0.00000000 0.50000000 + 0.25000000 0.00000000 0.75000000 + 0.25000000 0.25000000 0.00000000 + 0.25000000 0.25000000 0.25000000 + 0.25000000 0.25000000 0.50000000 + 0.25000000 0.25000000 0.75000000 + 0.25000000 0.50000000 0.00000000 + 0.25000000 0.50000000 0.25000000 + 0.25000000 0.50000000 0.50000000 + 0.25000000 0.50000000 0.75000000 + 0.25000000 0.75000000 0.00000000 + 0.25000000 0.75000000 0.25000000 + 0.25000000 0.75000000 0.50000000 + 0.25000000 0.75000000 0.75000000 + 0.50000000 0.00000000 0.00000000 + 0.50000000 0.00000000 0.25000000 + 0.50000000 0.00000000 0.50000000 + 0.50000000 0.00000000 0.75000000 + 0.50000000 0.25000000 0.00000000 + 0.50000000 0.25000000 0.25000000 + 0.50000000 0.25000000 0.50000000 + 0.50000000 0.25000000 0.75000000 + 0.50000000 0.50000000 0.00000000 + 0.50000000 0.50000000 0.25000000 + 0.50000000 0.50000000 0.50000000 + 0.50000000 0.50000000 0.75000000 + 0.50000000 0.75000000 0.00000000 + 0.50000000 0.75000000 0.25000000 + 0.50000000 0.75000000 0.50000000 + 0.50000000 0.75000000 0.75000000 + 0.75000000 0.00000000 0.00000000 + 0.75000000 0.00000000 0.25000000 + 0.75000000 0.00000000 0.50000000 + 0.75000000 0.00000000 0.75000000 + 0.75000000 0.25000000 0.00000000 + 0.75000000 0.25000000 0.25000000 + 0.75000000 0.25000000 0.50000000 + 0.75000000 0.25000000 0.75000000 + 0.75000000 0.50000000 0.00000000 + 0.75000000 0.50000000 0.25000000 + 0.75000000 0.50000000 0.50000000 + 0.75000000 0.50000000 0.75000000 + 0.75000000 0.75000000 0.00000000 + 0.75000000 0.75000000 0.25000000 + 0.75000000 0.75000000 0.50000000 + 0.75000000 0.75000000 0.75000000 +end kpoints diff --git a/test-suite/tests/testpostw90_pt_tetra_shcfreq/benchmark.out.default.inp=Pt.win b/test-suite/tests/testpostw90_pt_tetra_shcfreq/benchmark.out.default.inp=Pt.win new file mode 100644 index 000000000..ba53e50cf --- /dev/null +++ b/test-suite/tests/testpostw90_pt_tetra_shcfreq/benchmark.out.default.inp=Pt.win @@ -0,0 +1,22 @@ +#No. Frequency(eV) Re(sigma)((hbar/e)*S/cm) Im(sigma)((hbar/e)*S/cm) + 1 0.000000 0.14613901E+04 0.00000000E+00 + 2 0.100000 0.15772574E+04 0.18732087E+01 + 3 0.200000 0.15924584E+04 0.29268093E-04 + 4 0.300000 0.16482785E+04 0.76366446E-02 + 5 0.400000 0.17427817E+04 0.58266598E+00 + 6 0.500000 0.19116805E+04 -0.17218196E+02 + 7 0.600000 0.22917980E+04 -0.26915985E+02 + 8 0.700000 0.25098755E+04 0.61396190E+03 + 9 0.800000 0.24796811E+04 0.13659641E+04 + 10 0.900000 0.16802848E+04 0.19297446E+04 + 11 1.000000 0.15083821E+04 0.16556939E+04 + 12 1.100000 0.13965311E+04 0.17462347E+04 + 13 1.200000 0.99656062E+03 0.18217215E+04 + 14 1.300000 0.73116568E+03 0.17649837E+04 + 15 1.400000 0.55171357E+03 0.16733827E+04 + 16 1.500000 0.41806794E+03 0.15520612E+04 + 17 1.600000 0.32302641E+03 0.14522313E+04 + 18 1.700000 0.25815212E+03 0.13501685E+04 + 19 1.800000 0.20773861E+03 0.12608422E+04 + 20 1.900000 0.16665231E+03 0.11853571E+04 + 21 2.000000 0.13906338E+03 0.11288179E+04 From 0da964b4dfc544c6856f57224b3b9fb19a05d2de Mon Sep 17 00:00:00 2001 From: manxkim Date: Fri, 30 Sep 2022 18:32:45 +0900 Subject: [PATCH 8/8] pre-commit --- src/postw90/berry.F90 | 10 +++++----- src/postw90/postw90_readwrite.F90 | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/postw90/berry.F90 b/src/postw90/berry.F90 index a1ae29fd3..f8b4e3b68 100644 --- a/src/postw90/berry.F90 +++ b/src/postw90/berry.F90 @@ -590,7 +590,7 @@ subroutine berry_main(pw90_berry, dis_manifold, fermi_energy_list, kmesh_info, k ! if (pw90_berry%wanint_kpoint_file) then - if (pw90_berry%tetrahedron_method) call set_error_input& + if (pw90_berry%tetrahedron_method) call set_error_input & (error, 'Tetrahedron method not implemented with wanint_kpoint_file', comm) ! NOTE: still need to specify pw90_pw90_berry%kmesh%mesh in the input file ! @@ -3163,20 +3163,20 @@ subroutine berry_get_shc_tetrahedron(pw90_berry, ws_region, pw90_spin_hall, wann if (index(pw90_spin_hall%method, 'ryoo') > 0) then call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SAA_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, error, comm,& + kpt, real_lattice, mp_grid, num_wann, error, comm, & OO=SAA(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SBB_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, error, comm,& + kpt, real_lattice, mp_grid, num_wann, error, comm, & OO=SBB(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) else call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SR_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, error, comm,& + kpt, real_lattice, mp_grid, num_wann, error, comm, & OO=SAA(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) call pw90common_fourier_R_to_k_new(ws_region, wannier_data, ws_distance, wigner_seitz, & SHR_R(:, :, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha), & - kpt, real_lattice, mp_grid, num_wann, error, comm,& + kpt, real_lattice, mp_grid, num_wann, error, comm, & OO=SBB(:, :, pw90_spin_hall%gamma, pw90_spin_hall%alpha)) endif diff --git a/src/postw90/postw90_readwrite.F90 b/src/postw90/postw90_readwrite.F90 index 2eded0bd3..b94ac5a38 100644 --- a/src/postw90/postw90_readwrite.F90 +++ b/src/postw90/postw90_readwrite.F90 @@ -846,7 +846,7 @@ subroutine w90_wannier90_readwrite_read_berry(pw90_calculation, pw90_berry, pw90 call w90_readwrite_get_keyword('tetrahedron_higher_correction', found, error, comm, & l_value=pw90_berry%tetrahedron_method) if (.not. pw90_berry%tetrahedron_higher_correction) call set_error_input & - (error, 'Error: Set tetrahedron_higher_correction = .true., tetrahedron_method works only with correction', comm) + (error, 'Error: Set tetrahedron_higher_correction = .true., tetrahedron_method works only with correction', comm) pw90_berry%tetrahedron_cutoff = 1.e-4_dp call w90_readwrite_get_keyword('tetrahedron_cutoff', found, error, comm, & @@ -2076,7 +2076,7 @@ subroutine w90_postw90_readwrite_write(print_output, w90_system, fermi_energy_li if (pw90_berry%tetrahedron_method) then write (stdout, '(1x,a46,10x,a8,13x,a1)') '| Tetrahedron method (PRB 106, 075125) :', ' T', '|' write (stdout, '(1x,a46,10x,a8,13x,L8)') '| with higher-order correction :', & - pw90_berry%tetrahedron_higher_correction, '|' + pw90_berry%tetrahedron_higher_correction, '|' write (stdout, '(1x,a46,10x,E8.3,13x,a1)') '| Tetrahedron cutoff :', & pw90_berry%tetrahedron_cutoff, '|' else