-
Notifications
You must be signed in to change notification settings - Fork 3
/
ED_GREENS_FUNCTIONS.f90
175 lines (146 loc) · 4.75 KB
/
ED_GREENS_FUNCTIONS.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
MODULE ED_GREENS_FUNCTIONS
USE ED_GF_SHARED
USE ED_GF_NORMAL
!USE ED_GF_CHISPIN
!
implicit none
private
public :: buildGf_impurity
!public :: buildChi_impurity
real(8),dimension(:,:,:),allocatable :: zimp,simp
contains
!+------------------------------------------------------------------+
! GF CALCULATIONS
!+------------------------------------------------------------------+
subroutine buildGF_impurity()
!
call allocate_grids
!
impGmats=zero
impGreal=zero
!
impSmats = zero
impSreal = zero
!
impG0mats=zero
impG0real=zero
!
!
write(LOGfile,"(A)")"Get impurity Greens functions:"
call build_gf_normal()
call build_sigma_normal()
!
if(MPIMASTER)then
if(ed_print_Sigma)call ed_print_impSigma()
if(ed_print_G)call ed_print_impG()
if(ed_print_G0)call ed_print_impG0()
endif
!
if(MPIMASTER)then
allocate(simp(Nlat,Norb,Nspin),zimp(Nlat,Norb,Nspin))
call get_szr()
call write_szr()
deallocate(simp,zimp)
endif
!
call deallocate_grids
!
end subroutine buildgf_impurity
!+------------------------------------------------------------------+
! SUSCEPTIBILITY CALCULATIONS
!+------------------------------------------------------------------+
!subroutine buildChi_impurity()
!!
!call allocate_grids
!!
!!
!!BUILD SPIN SUSCEPTIBILITY
!spinChi_tau=zero
!spinChi_w=zero
!spinChi_iv=zero
!call build_chi_spin()
!!
!!
!! !BUILD CHARGE SUSCEPTIBILITY
!! densChi_tau=zero
!! densChi_w=zero
!! densChi_iv=zero
!! densChi_mix_tau=zero
!! densChi_mix_w=zero
!! densChi_mix_iv=zero
!! densChi_tot_tau=zero
!! densChi_tot_w=zero
!! densChi_tot_iv=zero
!! call build_chi_dens()
!!
!!
!! !BUILD PAIR SUSCEPTIBILITY
!! pairChi_tau=zero
!! pairChi_w=zero
!! pairChi_iv=zero
!! call build_chi_pair()
!!
!!
!!PRINTING:
!if(MPIMASTER)call ed_print_impChi()
!!
!!
!call deallocate_grids
!!
!end subroutine buildChi_impurity
!+-------------------------------------------------------------------+
!PURPOSE : get scattering rate and renormalization constant Z
!+-------------------------------------------------------------------+
subroutine get_szr()
integer :: ilat,ispin,iorb
real(8) :: wm1,wm2
wm1 = pi/beta ; wm2=3d0*pi/beta
do ilat=1,Nlat
do ispin=1,Nspin
do iorb=1,Norb
simp(ilat,iorb,ispin) = dimag(impSmats(ilat,ilat,ispin,ispin,iorb,iorb,1)) - &
wm1*(dimag(impSmats(ilat,ilat,ispin,ispin,iorb,iorb,2))-dimag(impSmats(ilat,ilat,ispin,ispin,iorb,iorb,1)))/(wm2-wm1)
zimp(ilat,iorb,ispin) = 1.d0/( 1.d0 + abs( dimag(impSmats(ilat,ilat,ispin,ispin,iorb,iorb,1))/wm1 ))
enddo
enddo
enddo
end subroutine get_szr
!+-------------------------------------------------------------------+
!PURPOSE : write observables to file
!+-------------------------------------------------------------------+
subroutine write_szr()
integer :: unit
integer :: iorb,jorb,ispin,ilat
!
open(free_unit(unit),file="zeta_info.ed")
write(unit,"(A1,90(A10,6X))")"#",&
((reg(txtfy(iorb+(ispin-1)*Norb))//"z_"//reg(txtfy(iorb))//"s"//reg(txtfy(ispin)),iorb=1,Norb),ispin=1,Nspin)
close(unit)
!
open(free_unit(unit),file="sig_info.ed")
write(unit,"(A1,90(A10,6X))")"#",&
((reg(txtfy(iorb+(ispin-1)*Norb))//"sig_"//reg(txtfy(iorb))//"s"//reg(txtfy(ispin)),iorb=1,Norb),ispin=1,Nspin)
close(unit)
!
do ilat=1,Nlat
open(free_unit(unit),file="zeta_all"//reg(ed_file_suffix)//"_site"//str(ilat,3)//".ed",position='append')
write(unit,"(90(F15.9,1X))")&
((zimp(ilat,iorb,ispin),iorb=1,Norb),ispin=1,Nspin)
close(unit)
open(free_unit(unit),file="zeta_last"//reg(ed_file_suffix)//"_site"//str(ilat,3)//".ed")
write(unit,"(90(F15.9,1X))")&
((zimp(ilat,iorb,ispin),iorb=1,Norb),ispin=1,Nspin)
close(unit)
!
open(free_unit(unit),file="sig_all"//reg(ed_file_suffix)//"_site"//str(ilat,3)//".ed",position='append')
write(unit,"(90(F15.9,1X))")&
((simp(ilat,iorb,ispin),iorb=1,Norb),ispin=1,Nspin)
close(unit)
open(free_unit(unit),file="sig_last"//reg(ed_file_suffix)//"_site"//str(ilat,3)//".ed")
write(unit,"(90(F15.9,1X))")&
((simp(ilat,iorb,ispin),iorb=1,Norb),ispin=1,Nspin)
close(unit)
enddo
!
end subroutine write_szr
end MODULE ED_GREENS_FUNCTIONS