checks the unitarity of the S-matrix (Eq. (13) in "Solution of coupled equations")
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | number_of_open_channels |
number of open channels |
||
real(kind=dp), | intent(in) | :: | s_matrix_real(number_of_open_channels,number_of_open_channels) |
real part of the S-matrix |
||
real(kind=dp), | intent(in) | :: | s_matrix_imag(number_of_open_channels,number_of_open_channels) |
imaginary part of the S-matrix |
||
logical, | intent(inout) | :: | is_unitary |
(output) if .true. unitarity is fulfilled, .false. otherwise |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int32), | private | :: | channel_index | ||||
real(kind=dp), | private | :: | sum_of_squares(number_of_open_channels) |
subroutine unitarity_check(number_of_open_channels, s_matrix_real, &
s_matrix_imag,is_unitary)
!! checks the unitarity of the S-matrix
!! (Eq. (13) in "Solution of coupled equations")
!---------------------------------------------------------------------!
integer(int32), intent(in) :: number_of_open_channels
!! number of open channels
real(dp), intent(in) :: s_matrix_real(number_of_open_channels, &
number_of_open_channels)
!! real part of the S-matrix
real(dp), intent(in) :: s_matrix_imag(number_of_open_channels, &
number_of_open_channels)
!! imaginary part of the S-matrix
logical, intent(inout) :: is_unitary
!! (output) if .true. unitarity is fulfilled, .false. otherwise
!---------------------------------------------------------------------!
integer(int32) :: channel_index
real(dp) :: sum_of_squares(number_of_open_channels)
!---------------------------------------------------------------------!
is_unitary = .true.
!---------------------------------------------------------------------!
call write_message("-- Check of the unitarity of the S-matrix...")
!---------------------------------------------------------------------!
! Calculating sum of squares for each channel
!---------------------------------------------------------------------!
call calculate_sum_of_squares_for_each_channel(s_matrix_real, &
s_matrix_imag, sum_of_squares)
!---------------------------------------------------------------------!
! Checking unitarity for each channel
!---------------------------------------------------------------------!
is_unitary = check_unitarity_for_each_channel(sum_of_squares)
!---------------------------------------------------------------------!
! Handling the output message based on unitarity check
!---------------------------------------------------------------------!
call handle_unitarity_output_message(is_unitary, sum_of_squares)
!---------------------------------------------------------------------!
end subroutine unitarity_check