wham_get_occ_mat_list Subroutine

public subroutine wham_get_occ_mat_list(fermi_energy_list, f_list, g_list, UU, num_wann, error, comm, eig, occ)

Uses

  • proc~~wham_get_occ_mat_list~~UsesGraph proc~wham_get_occ_mat_list wham_get_occ_mat_list module~w90_comms w90_comms proc~wham_get_occ_mat_list->module~w90_comms module~w90_constants w90_constants proc~wham_get_occ_mat_list->module~w90_constants module~w90_postw90_common w90_postw90_common proc~wham_get_occ_mat_list->module~w90_postw90_common module~w90_comms->module~w90_constants module~w90_error_base w90_error_base module~w90_comms->module~w90_error_base module~w90_postw90_common->module~w90_constants module~w90_error w90_error module~w90_postw90_common->module~w90_error module~w90_error->module~w90_comms module~w90_error->module~w90_error_base

Occupation matrix f, and g=1-f for a list of Fermi energies

Arguments

Type IntentOptional 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(:)

Calls

proc~~wham_get_occ_mat_list~~CallsGraph proc~wham_get_occ_mat_list wham_get_occ_mat_list proc~pw90common_get_occ pw90common_get_occ proc~wham_get_occ_mat_list->proc~pw90common_get_occ proc~set_error_input set_error_input proc~wham_get_occ_mat_list->proc~set_error_input proc~comms_sync_error comms_sync_error proc~set_error_input->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_input->proc~set_base_error

Called by

proc~~wham_get_occ_mat_list~~CalledByGraph proc~wham_get_occ_mat_list wham_get_occ_mat_list proc~berry_get_imfgh_klist berry_get_imfgh_klist proc~berry_get_imfgh_klist->proc~wham_get_occ_mat_list proc~berry_get_imf_klist berry_get_imf_klist proc~berry_get_imf_klist->proc~berry_get_imfgh_klist proc~berry_main berry_main proc~berry_main->proc~berry_get_imfgh_klist proc~berry_main->proc~berry_get_imf_klist proc~gyrotropic_get_k_list gyrotropic_get_k_list proc~gyrotropic_get_k_list->proc~berry_get_imfgh_klist proc~gyrotropic_get_k_list->proc~berry_get_imf_klist proc~k_path k_path proc~k_path->proc~berry_get_imfgh_klist proc~k_path->proc~berry_get_imf_klist proc~k_slice k_slice proc~k_slice->proc~berry_get_imfgh_klist proc~k_slice->proc~berry_get_imf_klist proc~gyrotropic_main gyrotropic_main proc~gyrotropic_main->proc~gyrotropic_get_k_list program~postw90 postw90 program~postw90->proc~berry_main program~postw90->proc~k_path program~postw90->proc~k_slice program~postw90->proc~gyrotropic_main

Source Code

  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