utility_commutator_diag Function

public function utility_commutator_diag(mat1, mat2, dim)

Uses

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

Computes diagonal elements of [mat1,mat2]=mat1.mat2-mat2.mat1

Arguments

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

Return Value complex(kind=dp) (dim)


Calls

proc~~utility_commutator_diag~~CallsGraph proc~utility_commutator_diag utility_commutator_diag proc~utility_matmul_diag utility_matmul_diag proc~utility_commutator_diag->proc~utility_matmul_diag

Contents


Source Code

  function utility_commutator_diag(mat1, mat2, dim)
    !===========================================================!
    !                                                           !
    !! Computes diagonal elements of
    !! [mat1,mat2]=mat1.mat2-mat2.mat1
    !                                                           !
    !===========================================================!

    use w90_constants, only: dp

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

    utility_commutator_diag = utility_matmul_diag(mat1, mat2, dim) - utility_matmul_diag(mat2, mat1, dim)

  end function utility_commutator_diag