pick_elec_pair_uniform_guga Subroutine

public subroutine pick_elec_pair_uniform_guga(nI, spin_orbs, sym_prod, sum_ml, temp_pgen)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer, intent(out) :: spin_orbs(2)
integer, intent(out) :: sym_prod
integer, intent(out) :: sum_ml
real(kind=dp), intent(out) :: temp_pgen

Contents


Source Code

    subroutine pick_elec_pair_uniform_guga(nI, spin_orbs, sym_prod, sum_ml, &
                                           temp_pgen)
        ! pick two occupied "spin orbitals" uniform-randomly
        integer, intent(in) :: nI(nel)
        integer, intent(out) :: spin_orbs(2), sym_prod, sum_ml

        integer :: i, ind(2)
        real(dp), intent(out) :: temp_pgen

        i = 1 + int(ElecPairs * genrand_real2_dSFMT())

        ind(2) = ceiling((1 + sqrt(1 + 8 * real(i, dp))) / 2)
        ind(1) = i - ((ind(2) - 1) * (ind(2) - 2)) / 2

        spin_orbs = nI(ind)

        sym_prod = RandExcitSymLabelProd(SpinOrbSymLabel(spin_orbs(1)), &
                                         SpinOrbSymLabel(spin_orbs(2)))

        temp_pgen = 1.0_dp / real(ElecPairs, dp)

        sum_ml = sum(G1(spin_orbs)%ml)

    end subroutine pick_elec_pair_uniform_guga