get_tranformation_matrix Function

public function get_tranformation_matrix(hamil, n_pairs) result(t_matrix)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: hamil(:,:)
integer, intent(in) :: n_pairs

Return Value real(kind=dp), (size(hamil,1),size(hamil,2))


Contents


Source Code

    function get_tranformation_matrix(hamil, n_pairs) result(t_matrix)
        ! n_pairs is actually also a global system dependent quantitiy..
        ! which actually might be helpful.. but input it here!
        HElement_t(dp), intent(in) :: hamil(:, :)
        integer, intent(in) :: n_pairs
        real(dp) :: t_matrix(size(hamil, 1), size(hamil, 2))

        integer :: i, j

        t_matrix = 0.0_dp

        do i = 1, size(hamil, 1)
            do j = 1, size(hamil, 1)
                if (i == j) then
                    t_matrix(i, i) = n_pairs
                else
                    if (abs(hamil(i, j)) > EPS) then
                        t_matrix(i, j) = sign(1.0_dp, real(hamil(i, j), dp))
                    end if
                end if
            end do
        end do

        t_matrix = trans_corr_param_2body / omega * t_matrix

    end function get_tranformation_matrix