apply_rotation Function

public function apply_rotation(in_orbs, rot_angle) result(out_orbs)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: in_orbs(nBasis/2)
real(kind=dp), intent(in) :: rot_angle

Return Value integer, (nBasis/2)


Contents

Source Code


Source Code

    function apply_rotation(in_orbs, rot_angle) result(out_orbs)
        ! function to rotate the k- or r-vectors and return the mapped
        ! orbitals
        integer, intent(in) :: in_orbs(nBasis / 2)
        real(dp), intent(in) :: rot_angle
        integer :: out_orbs(nBasis / 2)
#ifdef DEBUG_
        character(*), parameter :: this_routine = "apply_rotation"
#endif
        integer :: i

        if (.not. t_symmetry_rotation .or. (near_zero(rot_angle) &
                                            .or. (rot_angle.isclose.360.0_dp))) then
            out_orbs = in_orbs
            return
        end if

        ! i need the k- or r-vectors (or provide them as input? TDB)
        do i = 1, nBasis / 2
            out_orbs(i) = rotate(in_orbs(i), rot_angle)
        end do

    end function apply_rotation