utility_rotate_new Subroutine

public subroutine utility_rotate_new(mat, rot, N, reverse)

Uses

  • proc~~utility_rotate_new~~UsesGraph proc~utility_rotate_new utility_rotate_new module~w90_constants w90_constants proc~utility_rotate_new->module~w90_constants

Arguments

Type IntentOptional AttributesName
complex(kind=dp), intent(inout) :: mat(N,N)
complex(kind=dp), intent(in) :: rot(N,N)
integer, intent(in) :: N
logical, intent(in), optional :: reverse

Calls

proc~~utility_rotate_new~~CallsGraph proc~utility_rotate_new utility_rotate_new proc~utility_zgemm_new utility_zgemm_new proc~utility_rotate_new->proc~utility_zgemm_new

Called by

proc~~utility_rotate_new~~CalledByGraph proc~utility_rotate_new utility_rotate_new proc~wham_get_jjp_jjm_list wham_get_JJp_JJm_list proc~wham_get_jjp_jjm_list->proc~utility_rotate_new

Contents

Source Code


Source Code

  subroutine utility_rotate_new(mat, rot, N, reverse)
    !==============================================================!
    !                                                              !
    ! Rotates the N x N matrix 'mat' according to                  !
    ! * (rot)^dagger.mat.rot (reverse = .false. or not present) OR !
    ! * rot.mat.(rot)^dagger (reverse = .true.),                   !
    ! where 'rot' is a unitary matrix.                             !
    ! The matrix 'mat' is overwritten.                             !
    !                                                              !
    !==============================================================!

    use w90_constants, only: dp

    integer, intent(in)             :: N
    logical, optional, intent(in)   :: reverse
    complex(kind=dp), intent(inout) :: mat(N, N)
    complex(kind=dp), intent(in)    :: rot(N, N)
    complex(kind=dp)                :: tmp(N, N)
    logical                         :: rev

    if (.not. present(reverse)) then
      rev = .false.
    else
      rev = reverse
    end if

    if (rev) then
      call utility_zgemm_new(rot, mat, tmp, 'N', 'C')
      call utility_zgemm_new(rot, tmp, mat, 'N', 'C')
    else
      call utility_zgemm_new(mat, rot, tmp, 'C', 'N')
      call utility_zgemm_new(tmp, rot, mat, 'C', 'N')
    end if

  end subroutine utility_rotate_new