-
Notifications
You must be signed in to change notification settings - Fork 1
/
DMFT_ED.f90
83 lines (77 loc) · 2.63 KB
/
DMFT_ED.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
module DMFT_ED
USE IOTOOLS, only:free_unit,reg
USE ED_INPUT_VARS
USE ED_VARS_GLOBAL
USE ED_BATH
USE ED_AUX_FUNX
USE ED_CHI2FIT
USE ED_HAMILTONIAN
USE ED_GREENS_FUNCTIONS
USE ED_OBSERVABLES
USE ED_DIAG
implicit none
contains
!+------------------------------------------------------------------+
!PURPOSE :
!+------------------------------------------------------------------+
subroutine init_ed_solver(bath_,hwband,Hunit)
real(8),dimension(:,:),intent(inout) :: bath_
real(8),optional,intent(in) :: hwband
real(8) :: hwband_
character(len=*),optional,intent(in) :: Hunit
character(len=64) :: Hunit_
logical :: check
logical,save :: isetup=.true.
hwband_=2.d0;if(present(hwband))hwband_=hwband
Hunit_='inputHLOC.in';if(present(Hunit))Hunit_=Hunit
if(ed_verbose<2)write(LOGfile,"(A)")"INIT SOLVER FOR "//reg(ed_file_suffix)
if(isetup)call init_ed_structure(Hunit_)
bath_ = 0.d0
check = check_bath_dimension(bath_)
if(.not.check)stop "init_ed_solver: wrong bath dimensions"
call allocate_bath(dmft_bath)
call init_bath_ed(dmft_bath,hwband_)
call copy_bath(dmft_bath,bath_)
if(isetup)then
if(.not.ed_supercond)then
call setup_pointers
else
call setup_pointers_sc
endif
if(ed_method=='full')call setup_eigenspace
endif
call deallocate_bath(dmft_bath)
isetup=.false.
end subroutine init_ed_solver
!+------------------------------------------------------------------+
!PURPOSE :
!+------------------------------------------------------------------+
subroutine ed_solver(bath_)
real(8),dimension(:,:),intent(in) :: bath_
integer :: unit
logical :: check
check = check_bath_dimension(bath_)
if(.not.check)stop "init_ed_solver: wrong bath dimensions"
call allocate_bath(dmft_bath)
call set_bath(bath_,dmft_bath)
if(ed_verbose<2)call write_bath(dmft_bath,LOGfile)
unit=free_unit()
open(unit,file=trim(Hfile)//trim(ed_file_suffix)//".used")
call write_bath(dmft_bath,unit)
close(unit)
select case(ed_method)
case default
call lanc_ed_diag
call lanc_ed_getgf
if(chiflag)call lanc_ed_getchi
case ('full')
call reset_eigenspace()
call full_ed_diag
call full_ed_getgf
if(chiflag)call full_ed_getchi
end select
call ed_getobs
call deallocate_bath(dmft_bath)
call es_delete_espace(state_list)
end subroutine ed_solver
end module DMFT_ED