function that calculates the Euclidean norm (L2 norm or modulus) of a vector , where where is the dimension of the complex vector .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in), | dimension(:) | :: | a |
function norm_2_complex(a) result(result) complex(dp), dimension(:), intent(in) :: a real(dp) :: result result = sqrt(real(dot_product(a, conjg(a)))) end function norm_2_complex