Occupation matrix f, and g=1-f for a list of Fermi energies
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | allocatable | :: | fermi_energy_list(:) | ||
| complex(kind=dp), | intent(out) | :: | f_list(:,:,:) | |||
| complex(kind=dp), | intent(out) | :: | g_list(:,:,:) | |||
| complex(kind=dp), | intent(in) | :: | UU(:,:) | |||
| integer, | intent(in) | :: | num_wann | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm | |||
| real(kind=dp), | intent(in), | optional | :: | eig(:) | ||
| real(kind=dp), | intent(in), | optional | :: | occ(:) |
subroutine wham_get_occ_mat_list(fermi_energy_list, f_list, g_list, UU, num_wann, error, comm, & eig, occ) !================================================! ! !! Occupation matrix f, and g=1-f !! for a list of Fermi energies ! Tsirkin: !now optionally either eig or occ parameters may be supplied ! (Changed consistently the calls from the Berry module) !================================================! use w90_constants, only: dp, cmplx_0, cmplx_1 use w90_postw90_common, only: pw90common_get_occ use w90_comms, only: w90_comm_type ! arguments type(w90_error_type), allocatable, intent(out) :: error type(w90_comm_type), intent(in) :: comm real(kind=dp), allocatable, intent(in) :: fermi_energy_list(:) integer, intent(in) :: num_wann real(kind=dp), intent(in), optional :: eig(:) real(kind=dp), intent(in), optional :: occ(:) complex(kind=dp), intent(in) :: UU(:, :) complex(kind=dp), intent(out) :: f_list(:, :, :) complex(kind=dp), intent(out) :: g_list(:, :, :) ! local variables integer :: n, m, i, if, nfermi_loc real(kind=dp), allocatable :: occ_list(:, :) if (present(occ)) then nfermi_loc = 1 else nfermi_loc = 0 if (allocated(fermi_energy_list)) nfermi_loc = size(fermi_energy_list) end if allocate (occ_list(num_wann, nfermi_loc)) if (present(occ) .and. present(eig)) then call set_error_input(error, 'occ_list and eig cannot be both arguments in get_occ_mat_list', & comm) return elseif (.not. present(occ) .and. .not. present(eig)) then call set_error_input(error, 'either occ_list or eig must be passed as arguments to get_occ_mat_list', comm) return end if if (present(occ)) then occ_list(:, 1) = occ(:) else do if = 1, nfermi_loc call pw90common_get_occ(fermi_energy_list(if), eig, occ_list(:, if), num_wann) end do end if f_list = cmplx_0 do if = 1, nfermi_loc do n = 1, num_wann do m = 1, num_wann do i = 1, num_wann f_list(n, m, if) = f_list(n, m, if) & + UU(n, i)*occ_list(i, if)*conjg(UU(m, i)) end do g_list(n, m, if) = -f_list(n, m, if) if (m == n) g_list(n, n, if) = g_list(n, n, if) + cmplx_1 end do end do end do end subroutine wham_get_occ_mat_list