utility_matmul_diag Function

public function utility_matmul_diag(mat1, mat2, dim)

Uses

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

Computes the diagonal elements of the matrix mat1.mat2

Arguments

Type IntentOptional AttributesName
complex(kind=dp) :: mat1(dim,dim)
complex(kind=dp) :: mat2(dim,dim)
integer :: dim

Return Value complex(kind=dp) (dim)


Called by

proc~~utility_matmul_diag~~CalledByGraph proc~utility_matmul_diag utility_matmul_diag proc~utility_commutator_diag utility_commutator_diag proc~utility_commutator_diag->proc~utility_matmul_diag proc~utility_rotate_diag utility_rotate_diag proc~utility_rotate_diag->proc~utility_matmul_diag proc~spin_get_s spin_get_S proc~spin_get_s->proc~utility_rotate_diag proc~spin_get_moment_k spin_get_moment_k proc~spin_get_moment_k->proc~utility_rotate_diag proc~wham_get_deleig_a wham_get_deleig_a proc~wham_get_deleig_a->proc~utility_rotate_diag proc~spin_get_nk spin_get_nk proc~spin_get_nk->proc~utility_rotate_diag proc~k_path k_path proc~k_path->proc~spin_get_nk proc~gyrotropic_get_k_list gyrotropic_get_k_list proc~gyrotropic_get_k_list->proc~spin_get_s proc~k_slice k_slice proc~k_slice->proc~spin_get_nk proc~berry_get_kubo_k berry_get_kubo_k proc~berry_get_kubo_k->proc~spin_get_nk proc~gyrotropic_main gyrotropic_main proc~gyrotropic_main->proc~gyrotropic_get_k_list proc~berry_main berry_main proc~berry_main->proc~berry_get_kubo_k

Contents

Source Code


Source Code

  function utility_matmul_diag(mat1, mat2, dim)
    !===========================================================!
    !                                                           !
    !! Computes the diagonal elements of the matrix mat1.mat2
    !                                                           !
    !===========================================================!

    use w90_constants, only: dp, cmplx_0

    integer          :: dim
    complex(kind=dp) :: utility_matmul_diag(dim)
    complex(kind=dp) :: mat1(dim, dim)
    complex(kind=dp) :: mat2(dim, dim)

    integer i, j

    utility_matmul_diag = cmplx_0
    do i = 1, dim
      do j = 1, dim
        utility_matmul_diag(i) = utility_matmul_diag(i) + mat1(i, j)*mat2(j, i)
      end do
    end do

  end function utility_matmul_diag