calculate_sum_of_squares_for_each_channel Subroutine

private subroutine calculate_sum_of_squares_for_each_channel(s_matrix_real, s_matrix_imag, sum_of_squares_)

calculates the sum \( \sum_{\gamma'} \Bigl|{S}^{Jp}_{\gamma, \gamma'}\Bigr|^{2} \) for all \(\gamma\) channels

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: s_matrix_real(:,:)

real part of the S-matrix

real(kind=dp), intent(in) :: s_matrix_imag(:,:)

imaginary part of the S-matrix

real(kind=dp), intent(out) :: sum_of_squares_(:)

(output) \( \sum_{\gamma'} \Bigl|{S}^{Jp}_{\gamma, \gamma'}\Bigr|^{2} \)


Called by

proc~~calculate_sum_of_squares_for_each_channel~~CalledByGraph proc~calculate_sum_of_squares_for_each_channel calculate_sum_of_squares_for_each_channel proc~unitarity_check unitarity_check proc~unitarity_check->proc~calculate_sum_of_squares_for_each_channel program~scattering SCATTERING program~scattering->proc~unitarity_check

Contents


Variables

Type Visibility Attributes Name Initial
integer(kind=int32), private :: channel_index_

Source Code

      subroutine calculate_sum_of_squares_for_each_channel(s_matrix_real,      &
         s_matrix_imag, sum_of_squares_)
         !! calculates the sum
         !! \\( \sum\_{\gamma'} \Bigl|{S}^{Jp}\_{\gamma, \gamma'}\Bigr|^{2} \\)
         !! for all \\(\gamma\\) channels
         !---------------------------------------------------------------------!
         real(dp), intent(in) :: s_matrix_real(:,:)
            !! real part of the S-matrix
         real(dp), intent(in) :: s_matrix_imag(:,:)
            !! imaginary part of the S-matrix
         real(dp), intent(out) :: sum_of_squares_(:)
            !! (output) \\( \sum\_{\gamma'} \Bigl|{S}^{Jp}\_{\gamma, \gamma'}\Bigr|^{2} \\)
         !---------------------------------------------------------------------!
         integer(int32) :: channel_index_
         !---------------------------------------------------------------------!
         do channel_index_ = 1, size(s_matrix_real, 1)
            sum_of_squares_(channel_index_) =                                  &
               sum(s_matrix_real(channel_index_, :)**2                         &
               + s_matrix_imag(channel_index_, :)**2)
         enddo
         !---------------------------------------------------------------------!
      end subroutine calculate_sum_of_squares_for_each_channel