Skip to content

Commit

Permalink
Xee_OTF now calls gCoul2_RPA
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaulzc committed Dec 6, 2024
1 parent 8da77c7 commit b7f3dbd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/interactions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pure real(r64) function gCoul2_RPA(el, crys, qcrys, X0_qw)
integer(i64) :: ik1, ik2, ik3, ikp1, ikp2, ikp3

! Prefac: Need to check correctness
prefac = 1.0e9_r64/crys%volume**2*qe/perm0/crys%epsilon0
prefac = 1.0e18_r64*qe**2/(perm0*crys%epsilon0)**2

!Transfer wave vector in Cartesian coordinates
qcart = matmul(crys%reclattvecs, qcrys)
Expand Down Expand Up @@ -212,7 +212,7 @@ pure real(r64) function gCoul2_RPA(el, crys, qcrys, X0_qw)
end do
end do

gCoul2_RPA = (prefac*abs(W_qw))**2 ! ?? Not sure
gCoul2_RPA = prefac*abs(W_qw)**2 ! ?? Not sure
end function gCoul2_RPA

pure real(r64) function Vm2_3ph(ev1_s1, ev2_s2, ev3_s3, &
Expand Down Expand Up @@ -2950,8 +2950,6 @@ subroutine calculate_Xee_OTF(el, num, wann, istate1, crys, X, &
istate_el2(:), istate_el3(:), istate_el4(:)

!Local variables
!$! Defining continuous mesh - Omegas_cont, specX0_cont, ImX0_cont, ReX0_cont
!$! temp, X0_qw
integer(i64) :: istate, &
n1, ik1, n2, ik2, n3, ik3, n4, ik4, &
count, nprocs
Expand Down Expand Up @@ -3013,8 +3011,7 @@ subroutine calculate_Xee_OTF(el, num, wann, istate1, crys, X, &
!Create initial electron wave vector
k1_vec = vec(el%indexlist_irred(ik1), el%wvmesh, crys%reclattvecs)

!$! Defining continuous mesh - Omegas_cont, specX0_cont, ImX0_cont, ReX0_cont
!$! temp, X0_qw
!$! Defining continuous mesh
allocate(Omegas_cont(600))
call linspace(Omegas_cont, -0.5_r64, 0.5_r64, 600_i64) !! The ranges to be tested

Expand Down Expand Up @@ -3046,6 +3043,8 @@ subroutine calculate_Xee_OTF(el, num, wann, istate1, crys, X, &
temp = interpolator_1d([abs(en3-en1)], Omegas_cont, ImX0_cont) &
+ oneI*interpolator_1d([abs(en3-en1)], Omegas_cont, ReX0_cont)
X0_qw = temp(1)
! Squared matrix element- screened by RPA dielectric
g2 = gCoul2_RPA(el, crys, q_vec%frac, X0_qw)

!Fermi function of electron 3
fermi3 = Fermi(en3, el%chempot, crys%T)
Expand Down Expand Up @@ -3073,9 +3072,9 @@ subroutine calculate_Xee_OTF(el, num, wann, istate1, crys, X, &
!Apply energy window to electron 2
if(abs(en2 - el%enref) > el%fsthick) cycle

!Squared matrix element
g2 = gCoul2(el, crys, q_vec%frac, &
el%evecs_irred(ik1, n1, :), el%evecs(ik3, n3, :))
!Squared matrix element - Thomas Fermi
!g2 = gCoul2(el, crys, q_vec%frac, &
! el%evecs_irred(ik1, n1, :), el%evecs(ik3, n3, :))

!Fermi function of electron 2
fermi2 = Fermi(en2, el%chempot, crys%T)
Expand Down

0 comments on commit b7f3dbd

Please sign in to comment.