Merge lp:~nickpapior/siesta/4.0-trs into lp:siesta/4.0
- 4.0-trs
- Merge into rel-4.0
Status: | Merged |
---|---|
Merged at revision: | 564 |
Proposed branch: | lp:~nickpapior/siesta/4.0-trs |
Merge into: | lp:siesta/4.0 |
Diff against target: |
466 lines (+97/-141) 8 files modified
Docs/siesta.tex (+5/-4) Src/Makefile (+4/-4) Src/diag2g.F (+23/-26) Src/diag2k.F (+50/-95) Src/kpoint_grid.F90 (+7/-5) Src/kpoint_pdos.F90 (+7/-5) Src/mulliken.F (+0/-1) version.info (+1/-1) |
To merge this branch: | bzr merge lp:~nickpapior/siesta/4.0-trs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nick Papior | Needs Resubmitting | ||
Ramon Cuadrado (community) | Needs Information | ||
Alberto Garcia | Pending | ||
Review via email: mp+336912@code.launchpad.net |
Commit message
Description of the change
Removed TRS in the diag2k code.
Also made it default to not apply TRS for the kpoint generation for non-colinear spin.
I ran the fe_noncol_kp test. And only saw that it converges faster using the new code.
The results are not exactly the same (even when mpirun -np 1), so I can't comment on this.
Probably this code needs revision from Ramon.
- 556. By Nick Papior
-
Further cleaned interface to clear out an inconsistency in the code
Alberto Garcia (albertog) wrote : | # |
Nick Papior (nickpapior) wrote : | # |
Super, I agree! :)
Ramon Cuadrado (ramon-cuadrado) wrote : | # |
Hi Nick, Alberto,
It seems that diag2k.F is ok. However, do you mind to send me the output that you got for fe_noncoll.fdf? The one that you comment that it does not give the same results? Thanks.
Cheers,
Ramón
Nick Papior (nickpapior) wrote : | # |
I cannot attach the output, but I send it offsite.
- 557. By Nick Papior
-
Merged 4.0
- 558. By Nick Papior
-
Stream-lined NC mulliken output with 4.1
- 559. By Nick Papior
-
Merged 4.0 into trs
- 560. By Nick Papior
-
Fixed documentation for TRS
- 561. By Nick Papior
-
Patched diag2[gk] to conform to sign-conventions in 4.1
This also lead to the discovery of a sign error in the phases.
So now everything in 4.0 is the same as 4.1 (for non-collinear).I have checked fe_clust_
noncollinear and FeO.
Both yield, exactly the same output before and after this commit.
Nick Papior (nickpapior) wrote : | # |
Amended!
Preview Diff
1 | === modified file 'Docs/siesta.tex' |
2 | --- Docs/siesta.tex 2018-04-09 13:45:49 +0000 |
3 | +++ Docs/siesta.tex 2018-04-12 11:54:08 +0000 |
4 | @@ -2779,13 +2779,14 @@ |
5 | \item[{\bf TimeReversalSymmetryForKpoints}] ({\it boolean}): |
6 | \index{TimeReversalSymmetryForKpoints@{\bf TimeReversalSymmetryForKpoints}} |
7 | |
8 | -If {\tt .true.}, the k-points in the BZ generated by the methods above |
9 | -are paired as (k,-k) and only one member of the pair is retained. This |
10 | +If {\tt .true.}, the $k$-points in the BZ generated by the methods above |
11 | +are paired as ($k$,$-k$) and only one member of the pair is retained. This |
12 | symmetry is valid in the absence of external magnetic fields or |
13 | -spin-orbit interaction. |
14 | +non-collinear/spin-orbit interaction. |
15 | |
16 | {\it Default value:} {\tt .true.} unless the option {\bf SpinSpiral} |
17 | -is used. In this case time-reversal-symmetry is broken explicitly. |
18 | +is used. In this case time-reversal-symmetry is broken explicitly. It is also default {\tt |
19 | + .false.} for non-collinear calculations. |
20 | |
21 | \end{description} |
22 | |
23 | |
24 | === modified file 'Src/Makefile' |
25 | --- Src/Makefile 2018-04-11 09:23:27 +0000 |
26 | +++ Src/Makefile 2018-04-12 11:54:08 +0000 |
27 | @@ -558,10 +558,10 @@ |
28 | kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o |
29 | kinefsm.o: precision.o |
30 | kpoint_convert.o: precision.o sys.o units.o |
31 | -kpoint_grid.o: find_kgrid.o minvec.o parallel.o precision.o siesta_cml.o |
32 | -kpoint_grid.o: siesta_options.o sys.o units.o |
33 | -kpoint_pdos.o: find_kgrid.o minvec.o parallel.o precision.o siesta_options.o |
34 | -kpoint_pdos.o: sys.o units.o |
35 | +kpoint_grid.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o |
36 | +kpoint_grid.o: siesta_cml.o siesta_options.o sys.o units.o |
37 | +kpoint_pdos.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o |
38 | +kpoint_pdos.o: siesta_options.o sys.o units.o |
39 | ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o parallel.o precision.o sys.o |
40 | ksvinit.o: alloc.o parallel.o precision.o sys.o |
41 | listsc.o: alloc.o |
42 | |
43 | === modified file 'Src/diag2g.F' |
44 | --- Src/diag2g.F 2016-01-25 16:00:16 +0000 |
45 | +++ Src/diag2g.F 2018-04-12 11:54:08 +0000 |
46 | @@ -99,7 +99,7 @@ |
47 | logical getD |
48 | |
49 | ! Internal variables ............................................. |
50 | - real(dp) psi(2,2,nuotot,2*nuo) |
51 | + complex(dp) :: psi(2,nuotot,2*nuo) |
52 | complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux |
53 | complex(dp),dimension(:,:), allocatable :: caux |
54 | |
55 | @@ -196,8 +196,8 @@ |
56 | if (abs(qe).gt.occtol) then |
57 | if (Node.eq.BNode) then |
58 | do j = 1,nuotot |
59 | - caux(1,j)=dcmplx( psi(1,1,j,iie), psi(2,1,j,iie)) ! c_{i,up} |
60 | - caux(2,j)=dcmplx( psi(1,2,j,iie), psi(2,2,j,iie)) ! c_{i,dn} |
61 | + caux(1,j) = psi(1,j,iie) ! c_{i,up} |
62 | + caux(2,j) = psi(2,j,iie) ! c_{i,dn} |
63 | enddo |
64 | endif |
65 | #ifdef MPI |
66 | @@ -211,45 +211,42 @@ |
67 | ind = listdptr(io) + j |
68 | jo = listd(ind) |
69 | |
70 | -! | ------- 1,1 ------- ------- 2,1 ------- | |
71 | -! | c_{j,up} c_{i,up}^* c_{j,dn} c_{i,up)^* | |
72 | -! D_{j,i} = | | |
73 | -! | ------- 1,2 ------- ------- 2,2 ------- | |
74 | -! | c_{j,up} c_{i,dn}^* c_{j,dn} c_{i,dn)^* | |
75 | +! | ------- 1,1 ------- ------- 1,2 ------- | |
76 | +! | c_{j,up}^* c_{i,up} c_{j,dn}^* c_{i,up) | |
77 | +! D_{j,i} = | | |
78 | +! | ------- 2,1 ------- ------- 2,2 ------- | |
79 | +! | c_{j,up}^* c_{i,dn} c_{j,dn}^* c_{i,dn) | |
80 | ! |
81 | !------- 1,1 ----------------------------------------------------------- |
82 | - D11 = dconjg(caux(1,iio)) * caux(1,jo) |
83 | + D11 = dconjg(caux(1,jo)) * caux(1,iio) |
84 | !------- 2,2 ----------------------------------------------------------- |
85 | - D22 = dconjg(caux(2,iio)) * caux(2,jo) |
86 | + D22 = dconjg(caux(2,jo)) * caux(2,iio) |
87 | +!------- 1,2 ----------------------------------------------------------- |
88 | + D12 = dconjg(caux(2,jo)) * caux(1,iio) |
89 | !------- 2,1 ----------------------------------------------------------- |
90 | - D12 = dconjg(caux(1,iio)) * caux(2,jo) |
91 | -!------- 1,2 ----------------------------------------------------------- |
92 | - D21 = dconjg(caux(2,iio)) * caux(1,jo) |
93 | - |
94 | -!------------ Density matrix has to be hermitian ---------------------- |
95 | - D11 = 0.5_dp * (D11 + dconjg(D11)) |
96 | - D22 = 0.5_dp * (D22 + dconjg(D22)) |
97 | + D21 = dconjg(caux(1,jo)) * caux(2,iio) |
98 | + |
99 | + ! Make D12/D21 Hermitian |
100 | D12 = 0.5_dp * (D12 + dconjg(D21)) |
101 | - D21 = dconjg(D12) |
102 | |
103 | ! Add contribution to density matrices of unit-cell orbitals |
104 | ! ---------------------------------------------------------------- |
105 | -! | D11 = D_{j,i}(1) D21 = D_{j,i}(3)-i D_{j,i}(4) | |
106 | -! | D12 = D_{i,j}(3)+i D_{i,j}(4) D22 = D_{j,i}(2) | |
107 | -! ---------------------------------------------------------------- |
108 | -! ---------------------------------------------------------------- |
109 | -! | D11 = Dnew(1) D21 = Dnew(3)-i Dnew(4) | |
110 | -! | D12 = Dnew(3)+i Dnew(4) D22 = Dnew(2) | |
111 | +! | D11 = D_{j,i}(1) D12 = D_{j,i}(3)+i D_{j,i}(4) | |
112 | +! | D12 = D_{i,j}(3)-i D_{i,j}(4) D22 = D_{j,i}(2) | |
113 | +! ---------------------------------------------------------------- |
114 | +! ---------------------------------------------------------------- |
115 | +! | D11 = Dnew(1) D12 = Dnew(3)+i Dnew(4) | |
116 | +! | D21 = Dnew(3)-i Dnew(4) D22 = Dnew(2) | |
117 | ! ---------------------------------------------------------------- |
118 | Dnew(ind,1) = Dnew(ind,1) + dreal(D11) * qe |
119 | Dnew(ind,2) = Dnew(ind,2) + dreal(D22) * qe |
120 | Dnew(ind,3) = Dnew(ind,3) + dreal(D12) * qe |
121 | - Dnew(ind,4) = Dnew(ind,4) + dimag(D12) * qe |
122 | + Dnew(ind,4) = Dnew(ind,4) - dimag(D12) * qe |
123 | |
124 | Enew(ind,1) = Enew(ind,1) + dreal(D11) * ee |
125 | Enew(ind,2) = Enew(ind,2) + dreal(D22) * ee |
126 | Enew(ind,3) = Enew(ind,3) + dreal(D12) * ee |
127 | - Enew(ind,4) = Enew(ind,4) + dimag(D12) * ee |
128 | + Enew(ind,4) = Enew(ind,4) - dimag(D12) * ee |
129 | |
130 | enddo |
131 | enddo |
132 | |
133 | === modified file 'Src/diag2k.F' |
134 | --- Src/diag2k.F 2016-01-25 16:00:16 +0000 |
135 | +++ Src/diag2k.F 2018-04-12 11:54:08 +0000 |
136 | @@ -109,13 +109,12 @@ |
137 | real(dp) kpoint(3,nk), wk(nk), xij(3,maxnh) |
138 | real(dp) e1, e2, ef, eo(maxo*4,nk), qo(maxo*4,nk) |
139 | real(dp) occtol, qtot, temp, Entropy |
140 | - |
141 | + complex(dp) :: psi(2,nuotot,nuo*2) |
142 | + |
143 | logical getD |
144 | |
145 | ! TEMPOS, INTERNAL VARIABLES etc. |
146 | |
147 | - real(dp) psi(2,2,nuotot,nuo*2) |
148 | - |
149 | integer BNode, BTest, ie, ierror, iie, ik, ind, io, iio |
150 | integer iuo, j, jo, juo, neigneeded |
151 | real(dp) ee, qe, t |
152 | @@ -123,9 +122,9 @@ |
153 | ! Haux(js,juo,is,iuo) = <js,juo|H|is,iuo> |
154 | ! Indices is and js are for spin components |
155 | ! Indices iuo and juo are for orbital components |
156 | - complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux |
157 | + complex(dp),dimension(:,:,:,:), allocatable, target :: Haux, Saux |
158 | |
159 | - complex(dp),dimension(:,:,:,:), allocatable :: Dkc, Ekc |
160 | + complex(dp),dimension(:,:,:,:), pointer :: Dkc, Ekc |
161 | complex(dp) :: cicj |
162 | complex(dp) :: D11, D22, D12, D21 |
163 | complex(dp),dimension(:,:), allocatable :: caux |
164 | @@ -144,12 +143,10 @@ |
165 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') |
166 | allocate(Saux(MColl,nuotot,MColl,nuo)) |
167 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') |
168 | - allocate(Dkc(MColl,nuotot,MColl,nuo)) |
169 | - call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') |
170 | - allocate(Ekc(MColl,nuotot,MColl,nuo)) |
171 | - call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') |
172 | - allocate(caux(MColl,MColl*nuotot)) |
173 | - call memory('A','Z',MColl*MColl*nuotot,'diag2k') |
174 | + Dkc => Haux |
175 | + Ekc => Saux |
176 | + allocate(caux(MColl,nuotot)) |
177 | + call memory('A','Z',MColl*nuotot,'diag2k') |
178 | |
179 | eo = 0.0_dp |
180 | |
181 | @@ -174,7 +171,7 @@ |
182 | kxij = kpoint(1,ik) * xij(1,ind) + |
183 | . kpoint(2,ik) * xij(2,ind) + |
184 | . kpoint(3,ik) * xij(3,ind) |
185 | - kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij) |
186 | + kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij) |
187 | |
188 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs |
189 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs |
190 | @@ -243,7 +240,7 @@ |
191 | kxij = kpoint(1,ik) * xij(1,ind) + |
192 | . kpoint(2,ik) * xij(2,ind) + |
193 | . kpoint(3,ik) * xij(3,ind) |
194 | - kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij) |
195 | + kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij) |
196 | |
197 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs |
198 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs |
199 | @@ -274,7 +271,7 @@ |
200 | kxij = kpoint(1,ik) * xij(1,ind) + |
201 | . kpoint(2,ik) * xij(2,ind) + |
202 | . kpoint(3,ik) * xij(3,ind) |
203 | - kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij) |
204 | + kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij) |
205 | |
206 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs |
207 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs |
208 | @@ -290,14 +287,13 @@ |
209 | . neigneeded,iscf,ierror) |
210 | endif |
211 | |
212 | -!----------------------------------------------------------------------- |
213 | +!----------------------------------------------------------------------- |
214 | ! Store the products of eigenvectors in matrices Dk and Ek |
215 | ! WARNING: Dk and Ek may be EQUIVALENCE'd to Haux and Saux |
216 | -!----------------------------------------------------------------------- |
217 | +!----------------------------------------------------------------------- |
218 | |
219 | Dkc = dcmplx(0.0_dp,0.0_dp) |
220 | Ekc = dcmplx(0.0_dp,0.0_dp) |
221 | - caux = dcmplx(0.0_dp,0.0_dp) |
222 | |
223 | BNode = 0 |
224 | iie = 0 |
225 | @@ -311,8 +307,8 @@ |
226 | if (qe.gt.occtol) then |
227 | if (Node.eq.BNode) then |
228 | do j = 1,nuotot |
229 | - caux(1,j)=dcmplx(psi(1,1,j,iie),psi(2,1,j,iie)) ! c_{i,up} |
230 | - caux(2,j)=dcmplx(psi(1,2,j,iie),psi(2,2,j,iie)) ! c_{i,dn} |
231 | + caux(1,j) = psi(1,j,iie) ! c_{i,up} |
232 | + caux(2,j) = psi(2,j,iie) ! c_{i,dn} |
233 | enddo |
234 | endif |
235 | #ifdef MPI |
236 | @@ -324,37 +320,33 @@ |
237 | call LocalToGlobalOrb(iuo,Node,Nodes,iio) |
238 | do juo = 1,nuotot |
239 | |
240 | -! Relation: c_{i,up} = caux(1,i) |
241 | -! c_{i,dn} = caux(2,i) |
242 | -! |
243 | -! | ----- 1,1 ------- ----- 2,1 ------- | |
244 | -! | c_{j,u} c_{i,u}^* c_{j,u} c_{i,d)^* | |
245 | -! D_{j,i} = | | |
246 | -! | ----- 1,2 ------- ----- 2,2 ------- | |
247 | -! | c_{j,d} c_{i,u}^* c_{j,d} c_{i,d)^* | |
248 | -! |
249 | -! |
250 | -! | ----- 1,1 ------- ----- 2,1 ------- | |
251 | -! | D_{j,i}(1) D_{j,i}(3)+i D_{j,i}(4) | |
252 | -! = | | |
253 | -! | ----- 1,2 ------- ----- 2,2 ------- | |
254 | -! | D_{i,j}(3)-i D_{i,j}(4) D_{j,i}(2) | |
255 | -! |
256 | +! | ------- 1,1 ------- ------- 1,2 ------- | |
257 | +! | c_{j,up}^* c_{i,up} c_{j,dn}^* c_{i,up) | |
258 | +! D_{j,i} = | | |
259 | +! | ------- 2,1 ------- ------- 2,2 ------- | |
260 | +! | c_{j,up}^* c_{i,dn} c_{j,dn}^* c_{i,dn) | |
261 | +! |
262 | +! |
263 | +! | ------- 1,1 ------- ------- 1,2 ------- | |
264 | +! | D_{j,i}(1) D_{j,i}(3)+i D_{j,i}(4) | |
265 | +! = | | |
266 | +! | ------- 2,1 ------- ------- 2,2 ------- | |
267 | +! | D_{i,j}(3)-i D_{i,j}(4) D_{j,i}(2) | |
268 | |
269 | !------- 1,1 ----------------------------------------------------------- |
270 | - cicj = dconjg(caux(1,iio)) * caux(1,juo) |
271 | + cicj = dconjg(caux(1,juo)) * caux(1,iio) |
272 | Dkc(1,juo,1,iuo) = Dkc(1,juo,1,iuo) + qe * cicj |
273 | Ekc(1,juo,1,iuo) = Ekc(1,juo,1,iuo) + ee * cicj |
274 | !------- 2,2 ----------------------------------------------------------- |
275 | - cicj = dconjg(caux(2,iio)) * caux(2,juo) |
276 | + cicj = dconjg(caux(2,juo)) * caux(2,iio) |
277 | Dkc(2,juo,2,iuo) = Dkc(2,juo,2,iuo) + qe * cicj |
278 | Ekc(2,juo,2,iuo) = Ekc(2,juo,2,iuo) + ee * cicj |
279 | -!------- 2,1 ----------------------------------------------------------- |
280 | - cicj = dconjg(caux(1,iio)) * caux(2,juo) |
281 | +!------- 1,2 ----------------------------------------------------------- |
282 | + cicj = dconjg(caux(2,juo)) * caux(1,iio) |
283 | Dkc(1,juo,2,iuo) = Dkc(1,juo,2,iuo) + qe * cicj |
284 | Ekc(1,juo,2,iuo) = Ekc(1,juo,2,iuo) + ee * cicj |
285 | -!------- 1,2 ----------------------------------------------------------- |
286 | - cicj = dconjg(caux(2,iio)) * caux(1,juo) |
287 | +!------- 2,1 ----------------------------------------------------------- |
288 | + cicj = dconjg(caux(1,juo)) * caux(2,iio) |
289 | Dkc(2,juo,1,iuo) = Dkc(2,juo,1,iuo) + qe * cicj |
290 | Ekc(2,juo,1,iuo) = Ekc(2,juo,1,iuo) + ee * cicj |
291 | enddo |
292 | @@ -383,47 +375,31 @@ |
293 | . kpoint(3,ik) * xij(3,ind) |
294 | kphs = cdexp(dcmplx(0.0_dp,-1.0_dp)*kxij) |
295 | |
296 | -! Average k and -k solutions because time-reversal symetry |
297 | - D11 = 0.5_dp * (Dkc(1,juo,1,iuo) * kphs |
298 | - . + dconjg(Dkc(1,juo,1,iuo) * kphs)) |
299 | - |
300 | - D22 = 0.5_dp * (Dkc(2,juo,2,iuo) * kphs |
301 | - . + dconjg(Dkc(2,juo,2,iuo) * kphs)) |
302 | - |
303 | - D12 = 0.5_dp * (Dkc(1,juo,2,iuo) * kphs |
304 | - . + dconjg(Dkc(2,juo,1,iuo) * kphs)) |
305 | - |
306 | - D21 = 0.5_dp * (Dkc(2,juo,1,iuo) * kphs |
307 | - . + dconjg(Dkc(1,juo,2,iuo) * kphs)) |
308 | - |
309 | + D11 = Dkc(1,juo,1,iuo) * kphs |
310 | + D22 = Dkc(2,juo,2,iuo) * kphs |
311 | + D12 = Dkc(1,juo,2,iuo) * kphs |
312 | + D21 = Dkc(2,juo,1,iuo) * kphs |
313 | + |
314 | + ! Make D12/D21 Hermitian |
315 | D12 = 0.5_dp * (D12 + dconjg(D21)) |
316 | - D21 = dconjg(D12) |
317 | - |
318 | + |
319 | Dnew(ind,1) = Dnew(ind,1) + dreal(D11) |
320 | Dnew(ind,2) = Dnew(ind,2) + dreal(D22) |
321 | Dnew(ind,3) = Dnew(ind,3) + dreal(D12) |
322 | - Dnew(ind,4) = Dnew(ind,4) + dimag(D12) |
323 | - |
324 | -! Average k and -k solutions because time-reversal symetry |
325 | - D11 = 0.5_dp * (Ekc(1,juo,1,iuo) * kphs |
326 | - . + dconjg(Ekc(1,juo,1,iuo) * kphs)) |
327 | - |
328 | - D22 = 0.5_dp * (Ekc(2,juo,2,iuo) * kphs |
329 | - . + dconjg(Ekc(2,juo,2,iuo) * kphs)) |
330 | - |
331 | - D12 = 0.5_dp * (Ekc(1,juo,2,iuo) * kphs |
332 | - . + dconjg(Ekc(2,juo,1,iuo) * kphs)) |
333 | - |
334 | - D21 = 0.5_dp * (Ekc(2,juo,1,iuo) * kphs |
335 | - . + dconjg(Ekc(1,juo,2,iuo) * kphs)) |
336 | - |
337 | + Dnew(ind,4) = Dnew(ind,4) - dimag(D12) |
338 | + |
339 | + D11 = Ekc(1,juo,1,iuo) * kphs |
340 | + D22 = Ekc(2,juo,2,iuo) * kphs |
341 | + D12 = Ekc(1,juo,2,iuo) * kphs |
342 | + D21 = Ekc(2,juo,1,iuo) * kphs |
343 | + |
344 | + ! Make D12/D21 Hermitian |
345 | D12 = 0.5_dp * (D12 + dconjg(D21)) |
346 | - D21 = dconjg(D12) |
347 | |
348 | Enew(ind,1) = Enew(ind,1) + dreal(D11) |
349 | Enew(ind,2) = Enew(ind,2) + dreal(D22) |
350 | Enew(ind,3) = Enew(ind,3) + dreal(D12) |
351 | - Enew(ind,4) = Enew(ind,4) + dimag(D12) |
352 | + Enew(ind,4) = Enew(ind,4) - dimag(D12) |
353 | |
354 | enddo |
355 | enddo |
356 | @@ -436,30 +412,9 @@ |
357 | deallocate(Haux) |
358 | call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') |
359 | deallocate(Saux) |
360 | - call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') |
361 | - deallocate(Dkc) |
362 | - call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') |
363 | - deallocate(Ekc) |
364 | - call memory('D','Z',MColl*MColl*nuotot,'diag2k') |
365 | + call memory('D','Z',MColl*nuotot,'diag2k') |
366 | deallocate(caux) |
367 | |
368 | -! write(160+node,*)'ITERATION' |
369 | -! write(170+node,*)'ITERATION' |
370 | -! do iuo = 1,nuo |
371 | -! do j = 1,numd(iuo) |
372 | -! ind = listdptr(iuo) + j |
373 | -! jo = listd(ind) |
374 | -! juo = indxuo(jo) |
375 | -! write(160+node,'(3i5,4f15.9)')iuo,juo,jo,Dnew(ind,1:4) |
376 | -! write(170+node,'(3i5,4f15.9)')iuo,juo,jo, |
377 | -! . (Dnew(ind,1)+Dnew(ind,2))*0.5, |
378 | -! . (Dnew(ind,1)-Dnew(ind,2))*0.5,Dnew(ind,3:4) |
379 | -! enddo |
380 | -! enddo |
381 | -! |
382 | -! call die('maslyuk') |
383 | -!*********************************************************************** |
384 | return |
385 | end subroutine diag2k |
386 | -!*********************************************************************** |
387 | |
388 | |
389 | === modified file 'Src/kpoint_grid.F90' |
390 | --- Src/kpoint_grid.F90 2017-10-05 10:01:03 +0000 |
391 | +++ Src/kpoint_grid.F90 2018-04-12 11:54:08 +0000 |
392 | @@ -44,6 +44,7 @@ |
393 | USE parallel, only : Node |
394 | USE fdf, only : fdf_defined, fdf_get |
395 | USE m_find_kgrid, only : find_kgrid |
396 | + use m_spin, only: MColl |
397 | |
398 | implicit none |
399 | real(dp) :: ucell(3,3) |
400 | @@ -52,11 +53,12 @@ |
401 | if (scf_kgrid_first_time) then |
402 | nullify(kweight,kpoint) |
403 | spiral = fdf_defined('SpinSpiral') |
404 | - ! Allow the user to control the use of time-reversal-symmetry |
405 | - ! By default, it is on, except for "spin-spiral" calculations |
406 | - time_reversal_symmetry = fdf_get( & |
407 | - "TimeReversalSymmetryForKpoints", & |
408 | - (.not. spiral)) |
409 | + ! Allow the user to control the use of time-reversal-symmetry |
410 | + ! By default, it is on, except for "spin-spiral" calculations |
411 | + ! and/or non-colinear calculations |
412 | + time_reversal_symmetry = fdf_get( & |
413 | + "TimeReversalSymmetryForKpoints", & |
414 | + (.not. spiral) .and. MColl == 1) |
415 | call setup_scf_kscell(ucell, firm_displ) |
416 | |
417 | scf_kgrid_first_time = .false. |
418 | |
419 | === modified file 'Src/kpoint_pdos.F90' |
420 | --- Src/kpoint_pdos.F90 2017-10-05 10:01:03 +0000 |
421 | +++ Src/kpoint_pdos.F90 2018-04-12 11:54:08 +0000 |
422 | @@ -43,6 +43,7 @@ |
423 | USE parallel, only : Node |
424 | USE fdf, only : fdf_defined, fdf_get |
425 | USE m_find_kgrid, only : find_kgrid |
426 | + use m_spin, only: MColl |
427 | |
428 | implicit none |
429 | real(dp), intent(in) :: ucell(3,3) |
430 | @@ -52,11 +53,12 @@ |
431 | if (pdos_kgrid_first_time) then |
432 | nullify(kweight_pdos,kpoints_pdos) |
433 | spiral = fdf_defined('SpinSpiral') |
434 | - ! Allow the user to control the use of time-reversal-symmetry |
435 | - ! By default, it is on, except for "spin-spiral" calculations |
436 | - time_reversal_symmetry = fdf_get( & |
437 | - "TimeReversalSymmetryForKpoints", & |
438 | - (.not. spiral)) |
439 | + ! Allow the user to control the use of time-reversal-symmetry |
440 | + ! By default, it is on, except for "spin-spiral" calculations |
441 | + ! and/or non-colinear calculations |
442 | + time_reversal_symmetry = fdf_get( & |
443 | + "TimeReversalSymmetryForKpoints", & |
444 | + (.not. spiral) .and. MColl == 1) |
445 | |
446 | call setup_pdos_kscell(ucell, firm_displ) |
447 | |
448 | |
449 | === modified file 'Src/mulliken.F' |
450 | --- Src/mulliken.F 2018-04-11 23:32:54 +0000 |
451 | +++ Src/mulliken.F 2018-04-12 11:54:08 +0000 |
452 | @@ -513,7 +513,6 @@ |
453 | end if ! nspin .ge. 4 |
454 | end if |
455 | |
456 | -C ................... |
457 | |
458 | #ifdef DEBUG |
459 | call write_debug( ' POS mulliken' ) |
460 | |
461 | === modified file 'version.info' |
462 | --- version.info 2018-04-11 23:32:54 +0000 |
463 | +++ version.info 2018-04-12 11:54:08 +0000 |
464 | @@ -1,1 +1,1 @@ |
465 | -siesta-4.0--563 |
466 | +siesta-4.0--563--trs-7 |
It looks good to me, but I will wait for Ramón's opinion.