CalcPGenLattice Subroutine

public subroutine CalcPGenLattice(Ex, pGen)

Arguments

Type IntentOptional Attributes Name
integer :: Ex(2,2)
real(kind=dp) :: pGen

Contents

Source Code


Source Code

    SUBROUTINE CalcPGenLattice(Ex, pGen)

        INTEGER :: Ex(2, 2), iSpin, jSpin
        real(dp) :: pGen, pAIJ
        character(*), parameter :: this_routine = "CalcPGenLattice"

        ASSERT(.not. tNoFailAb)

        ! can i make this easier?
        iSpin = get_ispn(get_src(ex))
        if (iSpin == 1) then
            pAIJ = 1.0_dp / (nBasis / 2 - nOccBeta)
        else if (iSpin == 2) then
            pAIJ = 1.0_dp / (nBasis - Nel)
        else if (iSpin == 3) then
            pAIJ = 1.0_dp / (nBasis / 2 - nOccAlpha)
        end if

        ! Note, p(b|ij)=p(a|ij) for this system
        ! there is a small difference here and in the excitation generator
        ! part. is is only multiplied by 2 if it is a parallel excitation
        ! in the excitation generator.. but not here anymore..
        if (tUEG) then
            pGen = 2.0_dp / (NEl * (NEl - 1)) * 2.0_dp * pAIJ
        else ! i.e. if hubbard model, use modified probabilities
            ! hubbard model can't spawn alpha/alpha and beta/beta type excitations
            pGen = 1.0_dp / (nOccAlpha * nOccBeta) * 2.0_dp * pAIJ
        end if

    END SUBROUTINE CalcPGenLattice