init_perturbation_annihilation Subroutine

public subroutine init_perturbation_annihilation(pert)


Type IntentOptional Attributes Name
type(perturbation), intent(inout) :: pert


Source Code

    subroutine init_perturbation_annihilation(pert)

        ! Create the 'ann_elems' and 'ann_bits' components of a perturbation object.
        ! The 'ann_orbs' components should be allocated and filled in already, as
        ! should the nannihilate component.

        type(perturbation), intent(inout) :: pert
        integer :: i

        if (.not. allocated(pert%ann_elems)) allocate(pert%ann_elems(pert%nannihilate))
        if (.not. allocated(pert%ann_bits)) allocate(pert%ann_bits(pert%nannihilate))
        do i = 1, pert%nannihilate
            pert%ann_elems(i) = (pert%ann_orbs(i) - 1) / bits_n_int
            pert%ann_bits(i) = mod(pert%ann_orbs(i) - 1, bits_n_int)
        end do

    end subroutine init_perturbation_annihilation