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 | 2779 | \item[{\bf TimeReversalSymmetryForKpoints}] ({\it boolean}): | 2779 | \item[{\bf TimeReversalSymmetryForKpoints}] ({\it boolean}): |
6 | 2780 | \index{TimeReversalSymmetryForKpoints@{\bf TimeReversalSymmetryForKpoints}} | 2780 | \index{TimeReversalSymmetryForKpoints@{\bf TimeReversalSymmetryForKpoints}} |
7 | 2781 | 2781 | ||
10 | 2782 | If {\tt .true.}, the k-points in the BZ generated by the methods above | 2782 | If {\tt .true.}, the $k$-points in the BZ generated by the methods above |
11 | 2783 | are paired as (k,-k) and only one member of the pair is retained. This | 2783 | are paired as ($k$,$-k$) and only one member of the pair is retained. This |
12 | 2784 | symmetry is valid in the absence of external magnetic fields or | 2784 | symmetry is valid in the absence of external magnetic fields or |
14 | 2785 | spin-orbit interaction. | 2785 | non-collinear/spin-orbit interaction. |
15 | 2786 | 2786 | ||
16 | 2787 | {\it Default value:} {\tt .true.} unless the option {\bf SpinSpiral} | 2787 | {\it Default value:} {\tt .true.} unless the option {\bf SpinSpiral} |
18 | 2788 | is used. In this case time-reversal-symmetry is broken explicitly. | 2788 | is used. In this case time-reversal-symmetry is broken explicitly. It is also default {\tt |
19 | 2789 | .false.} for non-collinear calculations. | ||
20 | 2789 | 2790 | ||
21 | 2790 | \end{description} | 2791 | \end{description} |
22 | 2791 | 2792 | ||
23 | 2792 | 2793 | ||
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 | 558 | kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o | 558 | kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o |
29 | 559 | kinefsm.o: precision.o | 559 | kinefsm.o: precision.o |
30 | 560 | kpoint_convert.o: precision.o sys.o units.o | 560 | kpoint_convert.o: precision.o sys.o units.o |
35 | 561 | kpoint_grid.o: find_kgrid.o minvec.o parallel.o precision.o siesta_cml.o | 561 | kpoint_grid.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o |
36 | 562 | kpoint_grid.o: siesta_options.o sys.o units.o | 562 | kpoint_grid.o: siesta_cml.o siesta_options.o sys.o units.o |
37 | 563 | kpoint_pdos.o: find_kgrid.o minvec.o parallel.o precision.o siesta_options.o | 563 | kpoint_pdos.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o |
38 | 564 | kpoint_pdos.o: sys.o units.o | 564 | kpoint_pdos.o: siesta_options.o sys.o units.o |
39 | 565 | ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o parallel.o precision.o sys.o | 565 | ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o parallel.o precision.o sys.o |
40 | 566 | ksvinit.o: alloc.o parallel.o precision.o sys.o | 566 | ksvinit.o: alloc.o parallel.o precision.o sys.o |
41 | 567 | listsc.o: alloc.o | 567 | listsc.o: alloc.o |
42 | 568 | 568 | ||
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 | 99 | logical getD | 99 | logical getD |
48 | 100 | 100 | ||
49 | 101 | ! Internal variables ............................................. | 101 | ! Internal variables ............................................. |
51 | 102 | real(dp) psi(2,2,nuotot,2*nuo) | 102 | complex(dp) :: psi(2,nuotot,2*nuo) |
52 | 103 | complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux | 103 | complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux |
53 | 104 | complex(dp),dimension(:,:), allocatable :: caux | 104 | complex(dp),dimension(:,:), allocatable :: caux |
54 | 105 | 105 | ||
55 | @@ -196,8 +196,8 @@ | |||
56 | 196 | if (abs(qe).gt.occtol) then | 196 | if (abs(qe).gt.occtol) then |
57 | 197 | if (Node.eq.BNode) then | 197 | if (Node.eq.BNode) then |
58 | 198 | do j = 1,nuotot | 198 | do j = 1,nuotot |
61 | 199 | caux(1,j)=dcmplx( psi(1,1,j,iie), psi(2,1,j,iie)) ! c_{i,up} | 199 | caux(1,j) = psi(1,j,iie) ! c_{i,up} |
62 | 200 | caux(2,j)=dcmplx( psi(1,2,j,iie), psi(2,2,j,iie)) ! c_{i,dn} | 200 | caux(2,j) = psi(2,j,iie) ! c_{i,dn} |
63 | 201 | enddo | 201 | enddo |
64 | 202 | endif | 202 | endif |
65 | 203 | #ifdef MPI | 203 | #ifdef MPI |
66 | @@ -211,45 +211,42 @@ | |||
67 | 211 | ind = listdptr(io) + j | 211 | ind = listdptr(io) + j |
68 | 212 | jo = listd(ind) | 212 | jo = listd(ind) |
69 | 213 | 213 | ||
75 | 214 | ! | ------- 1,1 ------- ------- 2,1 ------- | | 214 | ! | ------- 1,1 ------- ------- 1,2 ------- | |
76 | 215 | ! | c_{j,up} c_{i,up}^* c_{j,dn} c_{i,up)^* | | 215 | ! | c_{j,up}^* c_{i,up} c_{j,dn}^* c_{i,up) | |
77 | 216 | ! D_{j,i} = | | | 216 | ! D_{j,i} = | | |
78 | 217 | ! | ------- 1,2 ------- ------- 2,2 ------- | | 217 | ! | ------- 2,1 ------- ------- 2,2 ------- | |
79 | 218 | ! | c_{j,up} c_{i,dn}^* c_{j,dn} c_{i,dn)^* | | 218 | ! | c_{j,up}^* c_{i,dn} c_{j,dn}^* c_{i,dn) | |
80 | 219 | ! | 219 | ! |
81 | 220 | !------- 1,1 ----------------------------------------------------------- | 220 | !------- 1,1 ----------------------------------------------------------- |
83 | 221 | D11 = dconjg(caux(1,iio)) * caux(1,jo) | 221 | D11 = dconjg(caux(1,jo)) * caux(1,iio) |
84 | 222 | !------- 2,2 ----------------------------------------------------------- | 222 | !------- 2,2 ----------------------------------------------------------- |
86 | 223 | D22 = dconjg(caux(2,iio)) * caux(2,jo) | 223 | D22 = dconjg(caux(2,jo)) * caux(2,iio) |
87 | 224 | !------- 1,2 ----------------------------------------------------------- | ||
88 | 225 | D12 = dconjg(caux(2,jo)) * caux(1,iio) | ||
89 | 224 | !------- 2,1 ----------------------------------------------------------- | 226 | !------- 2,1 ----------------------------------------------------------- |
97 | 225 | D12 = dconjg(caux(1,iio)) * caux(2,jo) | 227 | D21 = dconjg(caux(1,jo)) * caux(2,iio) |
98 | 226 | !------- 1,2 ----------------------------------------------------------- | 228 | |
99 | 227 | D21 = dconjg(caux(2,iio)) * caux(1,jo) | 229 | ! Make D12/D21 Hermitian |
93 | 228 | |||
94 | 229 | !------------ Density matrix has to be hermitian ---------------------- | ||
95 | 230 | D11 = 0.5_dp * (D11 + dconjg(D11)) | ||
96 | 231 | D22 = 0.5_dp * (D22 + dconjg(D22)) | ||
100 | 232 | D12 = 0.5_dp * (D12 + dconjg(D21)) | 230 | D12 = 0.5_dp * (D12 + dconjg(D21)) |
101 | 233 | D21 = dconjg(D12) | ||
102 | 234 | 231 | ||
103 | 235 | ! Add contribution to density matrices of unit-cell orbitals | 232 | ! Add contribution to density matrices of unit-cell orbitals |
104 | 236 | ! ---------------------------------------------------------------- | 233 | ! ---------------------------------------------------------------- |
111 | 237 | ! | D11 = D_{j,i}(1) D21 = D_{j,i}(3)-i D_{j,i}(4) | | 234 | ! | D11 = D_{j,i}(1) D12 = D_{j,i}(3)+i D_{j,i}(4) | |
112 | 238 | ! | D12 = D_{i,j}(3)+i D_{i,j}(4) D22 = D_{j,i}(2) | | 235 | ! | D12 = D_{i,j}(3)-i D_{i,j}(4) D22 = D_{j,i}(2) | |
113 | 239 | ! ---------------------------------------------------------------- | 236 | ! ---------------------------------------------------------------- |
114 | 240 | ! ---------------------------------------------------------------- | 237 | ! ---------------------------------------------------------------- |
115 | 241 | ! | D11 = Dnew(1) D21 = Dnew(3)-i Dnew(4) | | 238 | ! | D11 = Dnew(1) D12 = Dnew(3)+i Dnew(4) | |
116 | 242 | ! | D12 = Dnew(3)+i Dnew(4) D22 = Dnew(2) | | 239 | ! | D21 = Dnew(3)-i Dnew(4) D22 = Dnew(2) | |
117 | 243 | ! ---------------------------------------------------------------- | 240 | ! ---------------------------------------------------------------- |
118 | 244 | Dnew(ind,1) = Dnew(ind,1) + dreal(D11) * qe | 241 | Dnew(ind,1) = Dnew(ind,1) + dreal(D11) * qe |
119 | 245 | Dnew(ind,2) = Dnew(ind,2) + dreal(D22) * qe | 242 | Dnew(ind,2) = Dnew(ind,2) + dreal(D22) * qe |
120 | 246 | Dnew(ind,3) = Dnew(ind,3) + dreal(D12) * qe | 243 | Dnew(ind,3) = Dnew(ind,3) + dreal(D12) * qe |
122 | 247 | Dnew(ind,4) = Dnew(ind,4) + dimag(D12) * qe | 244 | Dnew(ind,4) = Dnew(ind,4) - dimag(D12) * qe |
123 | 248 | 245 | ||
124 | 249 | Enew(ind,1) = Enew(ind,1) + dreal(D11) * ee | 246 | Enew(ind,1) = Enew(ind,1) + dreal(D11) * ee |
125 | 250 | Enew(ind,2) = Enew(ind,2) + dreal(D22) * ee | 247 | Enew(ind,2) = Enew(ind,2) + dreal(D22) * ee |
126 | 251 | Enew(ind,3) = Enew(ind,3) + dreal(D12) * ee | 248 | Enew(ind,3) = Enew(ind,3) + dreal(D12) * ee |
128 | 252 | Enew(ind,4) = Enew(ind,4) + dimag(D12) * ee | 249 | Enew(ind,4) = Enew(ind,4) - dimag(D12) * ee |
129 | 253 | 250 | ||
130 | 254 | enddo | 251 | enddo |
131 | 255 | enddo | 252 | enddo |
132 | 256 | 253 | ||
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 | 109 | real(dp) kpoint(3,nk), wk(nk), xij(3,maxnh) | 109 | real(dp) kpoint(3,nk), wk(nk), xij(3,maxnh) |
138 | 110 | real(dp) e1, e2, ef, eo(maxo*4,nk), qo(maxo*4,nk) | 110 | real(dp) e1, e2, ef, eo(maxo*4,nk), qo(maxo*4,nk) |
139 | 111 | real(dp) occtol, qtot, temp, Entropy | 111 | real(dp) occtol, qtot, temp, Entropy |
141 | 112 | 112 | complex(dp) :: psi(2,nuotot,nuo*2) | |
142 | 113 | |||
143 | 113 | logical getD | 114 | logical getD |
144 | 114 | 115 | ||
145 | 115 | ! TEMPOS, INTERNAL VARIABLES etc. | 116 | ! TEMPOS, INTERNAL VARIABLES etc. |
146 | 116 | 117 | ||
147 | 117 | real(dp) psi(2,2,nuotot,nuo*2) | ||
148 | 118 | |||
149 | 119 | integer BNode, BTest, ie, ierror, iie, ik, ind, io, iio | 118 | integer BNode, BTest, ie, ierror, iie, ik, ind, io, iio |
150 | 120 | integer iuo, j, jo, juo, neigneeded | 119 | integer iuo, j, jo, juo, neigneeded |
151 | 121 | real(dp) ee, qe, t | 120 | real(dp) ee, qe, t |
152 | @@ -123,9 +122,9 @@ | |||
153 | 123 | ! Haux(js,juo,is,iuo) = <js,juo|H|is,iuo> | 122 | ! Haux(js,juo,is,iuo) = <js,juo|H|is,iuo> |
154 | 124 | ! Indices is and js are for spin components | 123 | ! Indices is and js are for spin components |
155 | 125 | ! Indices iuo and juo are for orbital components | 124 | ! Indices iuo and juo are for orbital components |
157 | 126 | complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux | 125 | complex(dp),dimension(:,:,:,:), allocatable, target :: Haux, Saux |
158 | 127 | 126 | ||
160 | 128 | complex(dp),dimension(:,:,:,:), allocatable :: Dkc, Ekc | 127 | complex(dp),dimension(:,:,:,:), pointer :: Dkc, Ekc |
161 | 129 | complex(dp) :: cicj | 128 | complex(dp) :: cicj |
162 | 130 | complex(dp) :: D11, D22, D12, D21 | 129 | complex(dp) :: D11, D22, D12, D21 |
163 | 131 | complex(dp),dimension(:,:), allocatable :: caux | 130 | complex(dp),dimension(:,:), allocatable :: caux |
164 | @@ -144,12 +143,10 @@ | |||
165 | 144 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') | 143 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') |
166 | 145 | allocate(Saux(MColl,nuotot,MColl,nuo)) | 144 | allocate(Saux(MColl,nuotot,MColl,nuo)) |
167 | 146 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') | 145 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') |
174 | 147 | allocate(Dkc(MColl,nuotot,MColl,nuo)) | 146 | Dkc => Haux |
175 | 148 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') | 147 | Ekc => Saux |
176 | 149 | allocate(Ekc(MColl,nuotot,MColl,nuo)) | 148 | allocate(caux(MColl,nuotot)) |
177 | 150 | call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k') | 149 | call memory('A','Z',MColl*nuotot,'diag2k') |
172 | 151 | allocate(caux(MColl,MColl*nuotot)) | ||
173 | 152 | call memory('A','Z',MColl*MColl*nuotot,'diag2k') | ||
178 | 153 | 150 | ||
179 | 154 | eo = 0.0_dp | 151 | eo = 0.0_dp |
180 | 155 | 152 | ||
181 | @@ -174,7 +171,7 @@ | |||
182 | 174 | kxij = kpoint(1,ik) * xij(1,ind) + | 171 | kxij = kpoint(1,ik) * xij(1,ind) + |
183 | 175 | . kpoint(2,ik) * xij(2,ind) + | 172 | . kpoint(2,ik) * xij(2,ind) + |
184 | 176 | . kpoint(3,ik) * xij(3,ind) | 173 | . kpoint(3,ik) * xij(3,ind) |
186 | 177 | kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij) | 174 | kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij) |
187 | 178 | 175 | ||
188 | 179 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs | 176 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs |
189 | 180 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs | 177 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs |
190 | @@ -243,7 +240,7 @@ | |||
191 | 243 | kxij = kpoint(1,ik) * xij(1,ind) + | 240 | kxij = kpoint(1,ik) * xij(1,ind) + |
192 | 244 | . kpoint(2,ik) * xij(2,ind) + | 241 | . kpoint(2,ik) * xij(2,ind) + |
193 | 245 | . kpoint(3,ik) * xij(3,ind) | 242 | . kpoint(3,ik) * xij(3,ind) |
195 | 246 | kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij) | 243 | kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij) |
196 | 247 | 244 | ||
197 | 248 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs | 245 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs |
198 | 249 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs | 246 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs |
199 | @@ -274,7 +271,7 @@ | |||
200 | 274 | kxij = kpoint(1,ik) * xij(1,ind) + | 271 | kxij = kpoint(1,ik) * xij(1,ind) + |
201 | 275 | . kpoint(2,ik) * xij(2,ind) + | 272 | . kpoint(2,ik) * xij(2,ind) + |
202 | 276 | . kpoint(3,ik) * xij(3,ind) | 273 | . kpoint(3,ik) * xij(3,ind) |
204 | 277 | kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij) | 274 | kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij) |
205 | 278 | 275 | ||
206 | 279 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs | 276 | Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs |
207 | 280 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs | 277 | Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs |
208 | @@ -290,14 +287,13 @@ | |||
209 | 290 | . neigneeded,iscf,ierror) | 287 | . neigneeded,iscf,ierror) |
210 | 291 | endif | 288 | endif |
211 | 292 | 289 | ||
213 | 293 | !----------------------------------------------------------------------- | 290 | !----------------------------------------------------------------------- |
214 | 294 | ! Store the products of eigenvectors in matrices Dk and Ek | 291 | ! Store the products of eigenvectors in matrices Dk and Ek |
215 | 295 | ! WARNING: Dk and Ek may be EQUIVALENCE'd to Haux and Saux | 292 | ! WARNING: Dk and Ek may be EQUIVALENCE'd to Haux and Saux |
217 | 296 | !----------------------------------------------------------------------- | 293 | !----------------------------------------------------------------------- |
218 | 297 | 294 | ||
219 | 298 | Dkc = dcmplx(0.0_dp,0.0_dp) | 295 | Dkc = dcmplx(0.0_dp,0.0_dp) |
220 | 299 | Ekc = dcmplx(0.0_dp,0.0_dp) | 296 | Ekc = dcmplx(0.0_dp,0.0_dp) |
221 | 300 | caux = dcmplx(0.0_dp,0.0_dp) | ||
222 | 301 | 297 | ||
223 | 302 | BNode = 0 | 298 | BNode = 0 |
224 | 303 | iie = 0 | 299 | iie = 0 |
225 | @@ -311,8 +307,8 @@ | |||
226 | 311 | if (qe.gt.occtol) then | 307 | if (qe.gt.occtol) then |
227 | 312 | if (Node.eq.BNode) then | 308 | if (Node.eq.BNode) then |
228 | 313 | do j = 1,nuotot | 309 | do j = 1,nuotot |
231 | 314 | caux(1,j)=dcmplx(psi(1,1,j,iie),psi(2,1,j,iie)) ! c_{i,up} | 310 | caux(1,j) = psi(1,j,iie) ! c_{i,up} |
232 | 315 | caux(2,j)=dcmplx(psi(1,2,j,iie),psi(2,2,j,iie)) ! c_{i,dn} | 311 | caux(2,j) = psi(2,j,iie) ! c_{i,dn} |
233 | 316 | enddo | 312 | enddo |
234 | 317 | endif | 313 | endif |
235 | 318 | #ifdef MPI | 314 | #ifdef MPI |
236 | @@ -324,37 +320,33 @@ | |||
237 | 324 | call LocalToGlobalOrb(iuo,Node,Nodes,iio) | 320 | call LocalToGlobalOrb(iuo,Node,Nodes,iio) |
238 | 325 | do juo = 1,nuotot | 321 | do juo = 1,nuotot |
239 | 326 | 322 | ||
256 | 327 | ! Relation: c_{i,up} = caux(1,i) | 323 | ! | ------- 1,1 ------- ------- 1,2 ------- | |
257 | 328 | ! c_{i,dn} = caux(2,i) | 324 | ! | c_{j,up}^* c_{i,up} c_{j,dn}^* c_{i,up) | |
258 | 329 | ! | 325 | ! D_{j,i} = | | |
259 | 330 | ! | ----- 1,1 ------- ----- 2,1 ------- | | 326 | ! | ------- 2,1 ------- ------- 2,2 ------- | |
260 | 331 | ! | c_{j,u} c_{i,u}^* c_{j,u} c_{i,d)^* | | 327 | ! | c_{j,up}^* c_{i,dn} c_{j,dn}^* c_{i,dn) | |
261 | 332 | ! D_{j,i} = | | | 328 | ! |
262 | 333 | ! | ----- 1,2 ------- ----- 2,2 ------- | | 329 | ! |
263 | 334 | ! | c_{j,d} c_{i,u}^* c_{j,d} c_{i,d)^* | | 330 | ! | ------- 1,1 ------- ------- 1,2 ------- | |
264 | 335 | ! | 331 | ! | D_{j,i}(1) D_{j,i}(3)+i D_{j,i}(4) | |
265 | 336 | ! | 332 | ! = | | |
266 | 337 | ! | ----- 1,1 ------- ----- 2,1 ------- | | 333 | ! | ------- 2,1 ------- ------- 2,2 ------- | |
267 | 338 | ! | D_{j,i}(1) D_{j,i}(3)+i D_{j,i}(4) | | 334 | ! | D_{i,j}(3)-i D_{i,j}(4) D_{j,i}(2) | |
252 | 339 | ! = | | | ||
253 | 340 | ! | ----- 1,2 ------- ----- 2,2 ------- | | ||
254 | 341 | ! | D_{i,j}(3)-i D_{i,j}(4) D_{j,i}(2) | | ||
255 | 342 | ! | ||
268 | 343 | 335 | ||
269 | 344 | !------- 1,1 ----------------------------------------------------------- | 336 | !------- 1,1 ----------------------------------------------------------- |
271 | 345 | cicj = dconjg(caux(1,iio)) * caux(1,juo) | 337 | cicj = dconjg(caux(1,juo)) * caux(1,iio) |
272 | 346 | Dkc(1,juo,1,iuo) = Dkc(1,juo,1,iuo) + qe * cicj | 338 | Dkc(1,juo,1,iuo) = Dkc(1,juo,1,iuo) + qe * cicj |
273 | 347 | Ekc(1,juo,1,iuo) = Ekc(1,juo,1,iuo) + ee * cicj | 339 | Ekc(1,juo,1,iuo) = Ekc(1,juo,1,iuo) + ee * cicj |
274 | 348 | !------- 2,2 ----------------------------------------------------------- | 340 | !------- 2,2 ----------------------------------------------------------- |
276 | 349 | cicj = dconjg(caux(2,iio)) * caux(2,juo) | 341 | cicj = dconjg(caux(2,juo)) * caux(2,iio) |
277 | 350 | Dkc(2,juo,2,iuo) = Dkc(2,juo,2,iuo) + qe * cicj | 342 | Dkc(2,juo,2,iuo) = Dkc(2,juo,2,iuo) + qe * cicj |
278 | 351 | Ekc(2,juo,2,iuo) = Ekc(2,juo,2,iuo) + ee * cicj | 343 | Ekc(2,juo,2,iuo) = Ekc(2,juo,2,iuo) + ee * cicj |
281 | 352 | !------- 2,1 ----------------------------------------------------------- | 344 | !------- 1,2 ----------------------------------------------------------- |
282 | 353 | cicj = dconjg(caux(1,iio)) * caux(2,juo) | 345 | cicj = dconjg(caux(2,juo)) * caux(1,iio) |
283 | 354 | Dkc(1,juo,2,iuo) = Dkc(1,juo,2,iuo) + qe * cicj | 346 | Dkc(1,juo,2,iuo) = Dkc(1,juo,2,iuo) + qe * cicj |
284 | 355 | Ekc(1,juo,2,iuo) = Ekc(1,juo,2,iuo) + ee * cicj | 347 | Ekc(1,juo,2,iuo) = Ekc(1,juo,2,iuo) + ee * cicj |
287 | 356 | !------- 1,2 ----------------------------------------------------------- | 348 | !------- 2,1 ----------------------------------------------------------- |
288 | 357 | cicj = dconjg(caux(2,iio)) * caux(1,juo) | 349 | cicj = dconjg(caux(1,juo)) * caux(2,iio) |
289 | 358 | Dkc(2,juo,1,iuo) = Dkc(2,juo,1,iuo) + qe * cicj | 350 | Dkc(2,juo,1,iuo) = Dkc(2,juo,1,iuo) + qe * cicj |
290 | 359 | Ekc(2,juo,1,iuo) = Ekc(2,juo,1,iuo) + ee * cicj | 351 | Ekc(2,juo,1,iuo) = Ekc(2,juo,1,iuo) + ee * cicj |
291 | 360 | enddo | 352 | enddo |
292 | @@ -383,47 +375,31 @@ | |||
293 | 383 | . kpoint(3,ik) * xij(3,ind) | 375 | . kpoint(3,ik) * xij(3,ind) |
294 | 384 | kphs = cdexp(dcmplx(0.0_dp,-1.0_dp)*kxij) | 376 | kphs = cdexp(dcmplx(0.0_dp,-1.0_dp)*kxij) |
295 | 385 | 377 | ||
309 | 386 | ! Average k and -k solutions because time-reversal symetry | 378 | D11 = Dkc(1,juo,1,iuo) * kphs |
310 | 387 | D11 = 0.5_dp * (Dkc(1,juo,1,iuo) * kphs | 379 | D22 = Dkc(2,juo,2,iuo) * kphs |
311 | 388 | . + dconjg(Dkc(1,juo,1,iuo) * kphs)) | 380 | D12 = Dkc(1,juo,2,iuo) * kphs |
312 | 389 | 381 | D21 = Dkc(2,juo,1,iuo) * kphs | |
313 | 390 | D22 = 0.5_dp * (Dkc(2,juo,2,iuo) * kphs | 382 | |
314 | 391 | . + dconjg(Dkc(2,juo,2,iuo) * kphs)) | 383 | ! Make D12/D21 Hermitian |
302 | 392 | |||
303 | 393 | D12 = 0.5_dp * (Dkc(1,juo,2,iuo) * kphs | ||
304 | 394 | . + dconjg(Dkc(2,juo,1,iuo) * kphs)) | ||
305 | 395 | |||
306 | 396 | D21 = 0.5_dp * (Dkc(2,juo,1,iuo) * kphs | ||
307 | 397 | . + dconjg(Dkc(1,juo,2,iuo) * kphs)) | ||
308 | 398 | |||
315 | 399 | D12 = 0.5_dp * (D12 + dconjg(D21)) | 384 | D12 = 0.5_dp * (D12 + dconjg(D21)) |
318 | 400 | D21 = dconjg(D12) | 385 | |
317 | 401 | |||
319 | 402 | Dnew(ind,1) = Dnew(ind,1) + dreal(D11) | 386 | Dnew(ind,1) = Dnew(ind,1) + dreal(D11) |
320 | 403 | Dnew(ind,2) = Dnew(ind,2) + dreal(D22) | 387 | Dnew(ind,2) = Dnew(ind,2) + dreal(D22) |
321 | 404 | Dnew(ind,3) = Dnew(ind,3) + dreal(D12) | 388 | Dnew(ind,3) = Dnew(ind,3) + dreal(D12) |
337 | 405 | Dnew(ind,4) = Dnew(ind,4) + dimag(D12) | 389 | Dnew(ind,4) = Dnew(ind,4) - dimag(D12) |
338 | 406 | 390 | ||
339 | 407 | ! Average k and -k solutions because time-reversal symetry | 391 | D11 = Ekc(1,juo,1,iuo) * kphs |
340 | 408 | D11 = 0.5_dp * (Ekc(1,juo,1,iuo) * kphs | 392 | D22 = Ekc(2,juo,2,iuo) * kphs |
341 | 409 | . + dconjg(Ekc(1,juo,1,iuo) * kphs)) | 393 | D12 = Ekc(1,juo,2,iuo) * kphs |
342 | 410 | 394 | D21 = Ekc(2,juo,1,iuo) * kphs | |
343 | 411 | D22 = 0.5_dp * (Ekc(2,juo,2,iuo) * kphs | 395 | |
344 | 412 | . + dconjg(Ekc(2,juo,2,iuo) * kphs)) | 396 | ! Make D12/D21 Hermitian |
330 | 413 | |||
331 | 414 | D12 = 0.5_dp * (Ekc(1,juo,2,iuo) * kphs | ||
332 | 415 | . + dconjg(Ekc(2,juo,1,iuo) * kphs)) | ||
333 | 416 | |||
334 | 417 | D21 = 0.5_dp * (Ekc(2,juo,1,iuo) * kphs | ||
335 | 418 | . + dconjg(Ekc(1,juo,2,iuo) * kphs)) | ||
336 | 419 | |||
345 | 420 | D12 = 0.5_dp * (D12 + dconjg(D21)) | 397 | D12 = 0.5_dp * (D12 + dconjg(D21)) |
346 | 421 | D21 = dconjg(D12) | ||
347 | 422 | 398 | ||
348 | 423 | Enew(ind,1) = Enew(ind,1) + dreal(D11) | 399 | Enew(ind,1) = Enew(ind,1) + dreal(D11) |
349 | 424 | Enew(ind,2) = Enew(ind,2) + dreal(D22) | 400 | Enew(ind,2) = Enew(ind,2) + dreal(D22) |
350 | 425 | Enew(ind,3) = Enew(ind,3) + dreal(D12) | 401 | Enew(ind,3) = Enew(ind,3) + dreal(D12) |
352 | 426 | Enew(ind,4) = Enew(ind,4) + dimag(D12) | 402 | Enew(ind,4) = Enew(ind,4) - dimag(D12) |
353 | 427 | 403 | ||
354 | 428 | enddo | 404 | enddo |
355 | 429 | enddo | 405 | enddo |
356 | @@ -436,30 +412,9 @@ | |||
357 | 436 | deallocate(Haux) | 412 | deallocate(Haux) |
358 | 437 | call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') | 413 | call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') |
359 | 438 | deallocate(Saux) | 414 | deallocate(Saux) |
365 | 439 | call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') | 415 | call memory('D','Z',MColl*nuotot,'diag2k') |
361 | 440 | deallocate(Dkc) | ||
362 | 441 | call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k') | ||
363 | 442 | deallocate(Ekc) | ||
364 | 443 | call memory('D','Z',MColl*MColl*nuotot,'diag2k') | ||
366 | 444 | deallocate(caux) | 416 | deallocate(caux) |
367 | 445 | 417 | ||
368 | 446 | ! write(160+node,*)'ITERATION' | ||
369 | 447 | ! write(170+node,*)'ITERATION' | ||
370 | 448 | ! do iuo = 1,nuo | ||
371 | 449 | ! do j = 1,numd(iuo) | ||
372 | 450 | ! ind = listdptr(iuo) + j | ||
373 | 451 | ! jo = listd(ind) | ||
374 | 452 | ! juo = indxuo(jo) | ||
375 | 453 | ! write(160+node,'(3i5,4f15.9)')iuo,juo,jo,Dnew(ind,1:4) | ||
376 | 454 | ! write(170+node,'(3i5,4f15.9)')iuo,juo,jo, | ||
377 | 455 | ! . (Dnew(ind,1)+Dnew(ind,2))*0.5, | ||
378 | 456 | ! . (Dnew(ind,1)-Dnew(ind,2))*0.5,Dnew(ind,3:4) | ||
379 | 457 | ! enddo | ||
380 | 458 | ! enddo | ||
381 | 459 | ! | ||
382 | 460 | ! call die('maslyuk') | ||
383 | 461 | !*********************************************************************** | ||
384 | 462 | return | 418 | return |
385 | 463 | end subroutine diag2k | 419 | end subroutine diag2k |
386 | 464 | !*********************************************************************** | ||
387 | 465 | 420 | ||
388 | 466 | 421 | ||
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 | 44 | USE parallel, only : Node | 44 | USE parallel, only : Node |
394 | 45 | USE fdf, only : fdf_defined, fdf_get | 45 | USE fdf, only : fdf_defined, fdf_get |
395 | 46 | USE m_find_kgrid, only : find_kgrid | 46 | USE m_find_kgrid, only : find_kgrid |
396 | 47 | use m_spin, only: MColl | ||
397 | 47 | 48 | ||
398 | 48 | implicit none | 49 | implicit none |
399 | 49 | real(dp) :: ucell(3,3) | 50 | real(dp) :: ucell(3,3) |
400 | @@ -52,11 +53,12 @@ | |||
401 | 52 | if (scf_kgrid_first_time) then | 53 | if (scf_kgrid_first_time) then |
402 | 53 | nullify(kweight,kpoint) | 54 | nullify(kweight,kpoint) |
403 | 54 | spiral = fdf_defined('SpinSpiral') | 55 | spiral = fdf_defined('SpinSpiral') |
409 | 55 | ! Allow the user to control the use of time-reversal-symmetry | 56 | ! Allow the user to control the use of time-reversal-symmetry |
410 | 56 | ! By default, it is on, except for "spin-spiral" calculations | 57 | ! By default, it is on, except for "spin-spiral" calculations |
411 | 57 | time_reversal_symmetry = fdf_get( & | 58 | ! and/or non-colinear calculations |
412 | 58 | "TimeReversalSymmetryForKpoints", & | 59 | time_reversal_symmetry = fdf_get( & |
413 | 59 | (.not. spiral)) | 60 | "TimeReversalSymmetryForKpoints", & |
414 | 61 | (.not. spiral) .and. MColl == 1) | ||
415 | 60 | call setup_scf_kscell(ucell, firm_displ) | 62 | call setup_scf_kscell(ucell, firm_displ) |
416 | 61 | 63 | ||
417 | 62 | scf_kgrid_first_time = .false. | 64 | scf_kgrid_first_time = .false. |
418 | 63 | 65 | ||
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 | 43 | USE parallel, only : Node | 43 | USE parallel, only : Node |
424 | 44 | USE fdf, only : fdf_defined, fdf_get | 44 | USE fdf, only : fdf_defined, fdf_get |
425 | 45 | USE m_find_kgrid, only : find_kgrid | 45 | USE m_find_kgrid, only : find_kgrid |
426 | 46 | use m_spin, only: MColl | ||
427 | 46 | 47 | ||
428 | 47 | implicit none | 48 | implicit none |
429 | 48 | real(dp), intent(in) :: ucell(3,3) | 49 | real(dp), intent(in) :: ucell(3,3) |
430 | @@ -52,11 +53,12 @@ | |||
431 | 52 | if (pdos_kgrid_first_time) then | 53 | if (pdos_kgrid_first_time) then |
432 | 53 | nullify(kweight_pdos,kpoints_pdos) | 54 | nullify(kweight_pdos,kpoints_pdos) |
433 | 54 | spiral = fdf_defined('SpinSpiral') | 55 | spiral = fdf_defined('SpinSpiral') |
439 | 55 | ! Allow the user to control the use of time-reversal-symmetry | 56 | ! Allow the user to control the use of time-reversal-symmetry |
440 | 56 | ! By default, it is on, except for "spin-spiral" calculations | 57 | ! By default, it is on, except for "spin-spiral" calculations |
441 | 57 | time_reversal_symmetry = fdf_get( & | 58 | ! and/or non-colinear calculations |
442 | 58 | "TimeReversalSymmetryForKpoints", & | 59 | time_reversal_symmetry = fdf_get( & |
443 | 59 | (.not. spiral)) | 60 | "TimeReversalSymmetryForKpoints", & |
444 | 61 | (.not. spiral) .and. MColl == 1) | ||
445 | 60 | 62 | ||
446 | 61 | call setup_pdos_kscell(ucell, firm_displ) | 63 | call setup_pdos_kscell(ucell, firm_displ) |
447 | 62 | 64 | ||
448 | 63 | 65 | ||
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 | 513 | end if ! nspin .ge. 4 | 513 | end if ! nspin .ge. 4 |
454 | 514 | end if | 514 | end if |
455 | 515 | 515 | ||
456 | 516 | C ................... | ||
457 | 517 | 516 | ||
458 | 518 | #ifdef DEBUG | 517 | #ifdef DEBUG |
459 | 519 | call write_debug( ' POS mulliken' ) | 518 | call write_debug( ' POS mulliken' ) |
460 | 520 | 519 | ||
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 @@ | |||
466 | 1 | siesta-4.0--563 | 1 | siesta-4.0--563--trs-7 |
It looks good to me, but I will wait for Ramón's opinion.