calculates the sum \( \sum_{\gamma'} \Bigl|{S}^{Jp}_{\gamma, \gamma'}\Bigr|^{2} \) for all \(\gamma\) channels
Type | Intent | Optional | 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} \) |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int32), | private | :: | channel_index_ |
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