-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathonesitematrix.f90
executable file
·174 lines (150 loc) · 4.19 KB
/
onesitematrix.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
Module OnesiteMatrix
! this subroutine is construct the onesite operator matrix
! in sparse CSR format
use variables
use communicate
use kinds_mod
implicit none
integer,parameter :: noperators=11
real(kind=r8) :: onesitemat(4,noperators) ! one site matrix in 4*4 basis
integer(kind=i4) :: osmrowindex(5,noperators),osmcolindex(4,noperators)
! onesitemat(:,:,x)
! x=1 means a(+)up
! x=2 means a(+)down
! x=3 means occpuation operator-nulcearQ
! x=4 means a up
! x=5 means a down
! x=6 means small Hamiltonian
! x=7 means niup+nidown operator
! x=8 means niup-nidown operator
! x=9 means ai^+up*aidown
! x=10 means ai^+down*aiup
! x=11 means (niup-nidown)^2
contains
!====================================================
!====================================================
subroutine ConstructOnesiteMatrix(orbindex)
implicit none
integer :: orbindex
integer :: i
! orbindex is the orbital index
! this is the new site index maybe nleft+1 or nright-1
call master_print_message("enter subroutine onesitematrix")
onesitemat=0.0D0
osmrowindex=0
osmcolindex=0
! x=1 means a(+)up
onesitemat(1,1)=1.0D0
onesitemat(2,1)=1.0D0
osmcolindex(1,1)=1
osmcolindex(2,1)=3
osmrowindex(1,1)=1
osmrowindex(2,1)=1
osmrowindex(3,1)=2
osmrowindex(4,1)=2
osmrowindex(5,1)=3
! x=2 means a(+)down
onesitemat(1,2)=1.0D0
onesitemat(2,2)=-1.0D0
osmcolindex(1,2)=1
osmcolindex(2,2)=2
osmrowindex(1,2)=1
osmrowindex(2,2)=1
osmrowindex(3,2)=1
osmrowindex(4,2)=2
osmrowindex(5,2)=3
! x=3 means occpuation operator-nulcearQ
onesitemat(1,3)=-nuclQ(orbindex)
onesitemat(2,3)=1.0D0-nuclQ(orbindex)
onesitemat(3,3)=1.0D0-nuclQ(orbindex)
onesitemat(4,3)=2.0D0-nuclQ(orbindex)
do i=1,4,1
osmcolindex(i,3)=i
osmrowindex(i,3)=i
end do
osmrowindex(5,3)=5
! x=4 means a up
onesitemat(1,4)=1.0D0
onesitemat(2,4)=1.0D0
osmcolindex(1,4)=2
osmcolindex(2,4)=4
osmrowindex(1,4)=1
osmrowindex(2,4)=2
osmrowindex(3,4)=2
osmrowindex(4,4)=3
osmrowindex(5,4)=3
! x=5 means a down
onesitemat(1,5)=1.0D0
onesitemat(2,5)=-1.0D0
osmcolindex(1,5)=3
osmcolindex(2,5)=4
osmrowindex(1,5)=1
osmrowindex(2,5)=2
osmrowindex(3,5)=3
osmrowindex(4,5)=3
osmrowindex(5,5)=3
! x=6 means small Hamiltonian
onesitemat(1,6)=t(orbindex,orbindex)
onesitemat(2,6)=t(orbindex,orbindex)
onesitemat(3,6)=2.0D0*t(orbindex,orbindex)+HubbardU(orbindex)
osmcolindex(1,6)=2
osmcolindex(2,6)=3
osmcolindex(3,6)=4
osmrowindex(1,6)=1
osmrowindex(2,6)=1
osmrowindex(3,6)=2
osmrowindex(4,6)=3
osmrowindex(5,6)=4
! x=7 means niup+nidown operator ; used in bond order calculation
onesitemat(1,7)=1.0D0
onesitemat(2,7)=1.0D0
onesitemat(3,7)=2.0D0
osmcolindex(1,7)=2
osmcolindex(2,7)=3
osmcolindex(3,7)=4
osmrowindex(1,7)=1
osmrowindex(2,7)=1
osmrowindex(3,7)=2
osmrowindex(4,7)=3
osmrowindex(5,7)=4
! x=8 means niup-nidown operator ; used in bond order calculation
onesitemat(1,8)=1.0D0
onesitemat(2,8)=-1.0D0
osmcolindex(1,8)=2
osmcolindex(2,8)=3
osmrowindex(1,8)=1
osmrowindex(2,8)=1
osmrowindex(3,8)=2
osmrowindex(4,8)=3
osmrowindex(5,8)=3
! x=9 means ai^+up*aidown
onesitemat(1,9)=1.0D0
osmcolindex(1,9)=3
osmrowindex(1,9)=1
osmrowindex(2,9)=1
osmrowindex(3,9)=2
osmrowindex(4,9)=2
osmrowindex(5,9)=2
! x=10 means ai^+down*aiup
onesitemat(1,10)=1.0D0
osmcolindex(1,10)=2
osmrowindex(1,10)=1
osmrowindex(2,10)=1
osmrowindex(3,10)=1
osmrowindex(4,10)=2
osmrowindex(5,10)=2
! x=11 means (niup-nidown)^2
onesitemat(1,11)=1.0D0
onesitemat(2,11)=1.0D0
osmcolindex(1,11)=2
osmcolindex(2,11)=3
osmrowindex(1,11)=1
osmrowindex(2,11)=1
osmrowindex(3,11)=2
osmrowindex(4,11)=3
osmrowindex(5,11)=3
return
end subroutine ConstructOnesiteMatrix
!====================================================
!====================================================
end module OnesiteMatrix