Merge lp:~nickpapior/siesta/4.0-trs into lp:siesta/4.0

Proposed by Nick Papior
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
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

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.

To post a comment you must log in.
lp:~nickpapior/siesta/4.0-trs updated
556. By Nick Papior

Further cleaned interface to clear out an inconsistency in the code

Revision history for this message
Alberto Garcia (albertog) wrote :

It looks good to me, but I will wait for Ramón's opinion.

Revision history for this message
Nick Papior (nickpapior) wrote :

Super, I agree! :)

Revision history for this message
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

review: Needs Information
Revision history for this message
Nick Papior (nickpapior) wrote :

I cannot attach the output, but I send it offsite.

lp:~nickpapior/siesta/4.0-trs updated
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.

Revision history for this message
Nick Papior (nickpapior) wrote :

Amended!

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Docs/siesta.tex'
--- Docs/siesta.tex 2018-04-09 13:45:49 +0000
+++ Docs/siesta.tex 2018-04-12 11:54:08 +0000
@@ -2779,13 +2779,14 @@
2779\item[{\bf TimeReversalSymmetryForKpoints}] ({\it boolean}):2779\item[{\bf TimeReversalSymmetryForKpoints}] ({\it boolean}):
2780\index{TimeReversalSymmetryForKpoints@{\bf TimeReversalSymmetryForKpoints}}2780\index{TimeReversalSymmetryForKpoints@{\bf TimeReversalSymmetryForKpoints}}
27812781
2782If {\tt .true.}, the k-points in the BZ generated by the methods above2782If {\tt .true.}, the $k$-points in the BZ generated by the methods above
2783are paired as (k,-k) and only one member of the pair is retained. This2783are paired as ($k$,$-k$) and only one member of the pair is retained. This
2784symmetry is valid in the absence of external magnetic fields or2784symmetry is valid in the absence of external magnetic fields or
2785spin-orbit interaction.2785non-collinear/spin-orbit interaction.
27862786
2787{\it Default value:} {\tt .true.} unless the option {\bf SpinSpiral} 2787{\it Default value:} {\tt .true.} unless the option {\bf SpinSpiral}
2788is used. In this case time-reversal-symmetry is broken explicitly.2788is used. In this case time-reversal-symmetry is broken explicitly. It is also default {\tt
2789 .false.} for non-collinear calculations.
27892790
2790\end{description}2791\end{description}
27912792
27922793
=== modified file 'Src/Makefile'
--- Src/Makefile 2018-04-11 09:23:27 +0000
+++ Src/Makefile 2018-04-12 11:54:08 +0000
@@ -558,10 +558,10 @@
558kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o558kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o
559kinefsm.o: precision.o559kinefsm.o: precision.o
560kpoint_convert.o: precision.o sys.o units.o560kpoint_convert.o: precision.o sys.o units.o
561kpoint_grid.o: find_kgrid.o minvec.o parallel.o precision.o siesta_cml.o561kpoint_grid.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o
562kpoint_grid.o: siesta_options.o sys.o units.o562kpoint_grid.o: siesta_cml.o siesta_options.o sys.o units.o
563kpoint_pdos.o: find_kgrid.o minvec.o parallel.o precision.o siesta_options.o563kpoint_pdos.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o
564kpoint_pdos.o: sys.o units.o564kpoint_pdos.o: siesta_options.o sys.o units.o
565ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o parallel.o precision.o sys.o565ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o parallel.o precision.o sys.o
566ksvinit.o: alloc.o parallel.o precision.o sys.o566ksvinit.o: alloc.o parallel.o precision.o sys.o
567listsc.o: alloc.o567listsc.o: alloc.o
568568
=== modified file 'Src/diag2g.F'
--- Src/diag2g.F 2016-01-25 16:00:16 +0000
+++ Src/diag2g.F 2018-04-12 11:54:08 +0000
@@ -99,7 +99,7 @@
99 logical getD99 logical getD
100 100
101! Internal variables .............................................101! Internal variables .............................................
102 real(dp) psi(2,2,nuotot,2*nuo)102 complex(dp) :: psi(2,nuotot,2*nuo)
103 complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux103 complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux
104 complex(dp),dimension(:,:), allocatable :: caux104 complex(dp),dimension(:,:), allocatable :: caux
105 105
@@ -196,8 +196,8 @@
196 if (abs(qe).gt.occtol) then196 if (abs(qe).gt.occtol) then
197 if (Node.eq.BNode) then197 if (Node.eq.BNode) then
198 do j = 1,nuotot198 do j = 1,nuotot
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}
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}
201 enddo201 enddo
202 endif202 endif
203#ifdef MPI203#ifdef MPI
@@ -211,45 +211,42 @@
211 ind = listdptr(io) + j211 ind = listdptr(io) + j
212 jo = listd(ind)212 jo = listd(ind)
213 213
214! | ------- 1,1 ------- ------- 2,1 ------- |214! | ------- 1,1 ------- ------- 1,2 ------- |
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) |
216! D_{j,i} = | |216! D_{j,i} = | |
217! | ------- 1,2 ------- ------- 2,2 ------- |217! | ------- 2,1 ------- ------- 2,2 ------- |
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) |
219!219!
220!------- 1,1 -----------------------------------------------------------220!------- 1,1 -----------------------------------------------------------
221 D11 = dconjg(caux(1,iio)) * caux(1,jo)221 D11 = dconjg(caux(1,jo)) * caux(1,iio)
222!------- 2,2 -----------------------------------------------------------222!------- 2,2 -----------------------------------------------------------
223 D22 = dconjg(caux(2,iio)) * caux(2,jo)223 D22 = dconjg(caux(2,jo)) * caux(2,iio)
224!------- 1,2 -----------------------------------------------------------
225 D12 = dconjg(caux(2,jo)) * caux(1,iio)
224!------- 2,1 -----------------------------------------------------------226!------- 2,1 -----------------------------------------------------------
225 D12 = dconjg(caux(1,iio)) * caux(2,jo)227 D21 = dconjg(caux(1,jo)) * caux(2,iio)
226!------- 1,2 -----------------------------------------------------------228
227 D21 = dconjg(caux(2,iio)) * caux(1,jo)229 ! Make D12/D21 Hermitian
228
229!------------ Density matrix has to be hermitian ----------------------
230 D11 = 0.5_dp * (D11 + dconjg(D11))
231 D22 = 0.5_dp * (D22 + dconjg(D22))
232 D12 = 0.5_dp * (D12 + dconjg(D21))230 D12 = 0.5_dp * (D12 + dconjg(D21))
233 D21 = dconjg(D12)
234 231
235! Add contribution to density matrices of unit-cell orbitals232! Add contribution to density matrices of unit-cell orbitals
236! ----------------------------------------------------------------233! ----------------------------------------------------------------
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) |
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) |
239! ----------------------------------------------------------------236! ----------------------------------------------------------------
240! ----------------------------------------------------------------237! ----------------------------------------------------------------
241! | D11 = Dnew(1) D21 = Dnew(3)-i Dnew(4) |238! | D11 = Dnew(1) D12 = Dnew(3)+i Dnew(4) |
242! | D12 = Dnew(3)+i Dnew(4) D22 = Dnew(2) |239! | D21 = Dnew(3)-i Dnew(4) D22 = Dnew(2) |
243! ----------------------------------------------------------------240! ----------------------------------------------------------------
244 Dnew(ind,1) = Dnew(ind,1) + dreal(D11) * qe241 Dnew(ind,1) = Dnew(ind,1) + dreal(D11) * qe
245 Dnew(ind,2) = Dnew(ind,2) + dreal(D22) * qe242 Dnew(ind,2) = Dnew(ind,2) + dreal(D22) * qe
246 Dnew(ind,3) = Dnew(ind,3) + dreal(D12) * qe243 Dnew(ind,3) = Dnew(ind,3) + dreal(D12) * qe
247 Dnew(ind,4) = Dnew(ind,4) + dimag(D12) * qe244 Dnew(ind,4) = Dnew(ind,4) - dimag(D12) * qe
248 245
249 Enew(ind,1) = Enew(ind,1) + dreal(D11) * ee246 Enew(ind,1) = Enew(ind,1) + dreal(D11) * ee
250 Enew(ind,2) = Enew(ind,2) + dreal(D22) * ee247 Enew(ind,2) = Enew(ind,2) + dreal(D22) * ee
251 Enew(ind,3) = Enew(ind,3) + dreal(D12) * ee248 Enew(ind,3) = Enew(ind,3) + dreal(D12) * ee
252 Enew(ind,4) = Enew(ind,4) + dimag(D12) * ee249 Enew(ind,4) = Enew(ind,4) - dimag(D12) * ee
253 250
254 enddo251 enddo
255 enddo252 enddo
256253
=== modified file 'Src/diag2k.F'
--- Src/diag2k.F 2016-01-25 16:00:16 +0000
+++ Src/diag2k.F 2018-04-12 11:54:08 +0000
@@ -109,13 +109,12 @@
109 real(dp) kpoint(3,nk), wk(nk), xij(3,maxnh)109 real(dp) kpoint(3,nk), wk(nk), xij(3,maxnh)
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)
111 real(dp) occtol, qtot, temp, Entropy111 real(dp) occtol, qtot, temp, Entropy
112 112 complex(dp) :: psi(2,nuotot,nuo*2)
113
113 logical getD114 logical getD
114 115
115! TEMPOS, INTERNAL VARIABLES etc.116! TEMPOS, INTERNAL VARIABLES etc.
116 117
117 real(dp) psi(2,2,nuotot,nuo*2)
118
119 integer BNode, BTest, ie, ierror, iie, ik, ind, io, iio118 integer BNode, BTest, ie, ierror, iie, ik, ind, io, iio
120 integer iuo, j, jo, juo, neigneeded119 integer iuo, j, jo, juo, neigneeded
121 real(dp) ee, qe, t120 real(dp) ee, qe, t
@@ -123,9 +122,9 @@
123! Haux(js,juo,is,iuo) = <js,juo|H|is,iuo>122! Haux(js,juo,is,iuo) = <js,juo|H|is,iuo>
124! Indices is and js are for spin components123! Indices is and js are for spin components
125! Indices iuo and juo are for orbital components124! Indices iuo and juo are for orbital components
126 complex(dp),dimension(:,:,:,:), allocatable :: Haux, Saux125 complex(dp),dimension(:,:,:,:), allocatable, target :: Haux, Saux
127 126
128 complex(dp),dimension(:,:,:,:), allocatable :: Dkc, Ekc127 complex(dp),dimension(:,:,:,:), pointer :: Dkc, Ekc
129 complex(dp) :: cicj128 complex(dp) :: cicj
130 complex(dp) :: D11, D22, D12, D21129 complex(dp) :: D11, D22, D12, D21
131 complex(dp),dimension(:,:), allocatable :: caux130 complex(dp),dimension(:,:), allocatable :: caux
@@ -144,12 +143,10 @@
144 call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k')143 call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k')
145 allocate(Saux(MColl,nuotot,MColl,nuo))144 allocate(Saux(MColl,nuotot,MColl,nuo))
146 call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k')145 call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k')
147 allocate(Dkc(MColl,nuotot,MColl,nuo))146 Dkc => Haux
148 call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k')147 Ekc => Saux
149 allocate(Ekc(MColl,nuotot,MColl,nuo))148 allocate(caux(MColl,nuotot))
150 call memory('A','Z',MColl*nuotot*MColl*nuo,'diag2k')149 call memory('A','Z',MColl*nuotot,'diag2k')
151 allocate(caux(MColl,MColl*nuotot))
152 call memory('A','Z',MColl*MColl*nuotot,'diag2k')
153 150
154 eo = 0.0_dp151 eo = 0.0_dp
155 152
@@ -174,7 +171,7 @@
174 kxij = kpoint(1,ik) * xij(1,ind) +171 kxij = kpoint(1,ik) * xij(1,ind) +
175 . kpoint(2,ik) * xij(2,ind) +172 . kpoint(2,ik) * xij(2,ind) +
176 . kpoint(3,ik) * xij(3,ind)173 . kpoint(3,ik) * xij(3,ind)
177 kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij)174 kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij)
178 175
179 Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs176 Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs
180 Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs177 Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs
@@ -243,7 +240,7 @@
243 kxij = kpoint(1,ik) * xij(1,ind) +240 kxij = kpoint(1,ik) * xij(1,ind) +
244 . kpoint(2,ik) * xij(2,ind) +241 . kpoint(2,ik) * xij(2,ind) +
245 . kpoint(3,ik) * xij(3,ind)242 . kpoint(3,ik) * xij(3,ind)
246 kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij)243 kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij)
247 244
248 Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs245 Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs
249 Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs246 Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs
@@ -274,7 +271,7 @@
274 kxij = kpoint(1,ik) * xij(1,ind) +271 kxij = kpoint(1,ik) * xij(1,ind) +
275 . kpoint(2,ik) * xij(2,ind) +272 . kpoint(2,ik) * xij(2,ind) +
276 . kpoint(3,ik) * xij(3,ind)273 . kpoint(3,ik) * xij(3,ind)
277 kphs = cdexp(dcmplx(0.0_dp, 1.0_dp)*kxij)274 kphs = cdexp(dcmplx(0.0_dp, -1.0_dp)*kxij)
278 275
279 Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs276 Saux(1,juo,1,iuo) = Saux(1,juo,1,iuo) + S(ind) * kphs
280 Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs277 Saux(2,juo,2,iuo) = Saux(2,juo,2,iuo) + S(ind) * kphs
@@ -290,14 +287,13 @@
290 . neigneeded,iscf,ierror)287 . neigneeded,iscf,ierror)
291 endif288 endif
292 289
293!----------------------------------------------------------------------- 290!-----------------------------------------------------------------------
294! Store the products of eigenvectors in matrices Dk and Ek291! Store the products of eigenvectors in matrices Dk and Ek
295! WARNING: Dk and Ek may be EQUIVALENCE'd to Haux and Saux292! WARNING: Dk and Ek may be EQUIVALENCE'd to Haux and Saux
296!----------------------------------------------------------------------- 293!-----------------------------------------------------------------------
297 294
298 Dkc = dcmplx(0.0_dp,0.0_dp)295 Dkc = dcmplx(0.0_dp,0.0_dp)
299 Ekc = dcmplx(0.0_dp,0.0_dp)296 Ekc = dcmplx(0.0_dp,0.0_dp)
300 caux = dcmplx(0.0_dp,0.0_dp)
301 297
302 BNode = 0298 BNode = 0
303 iie = 0299 iie = 0
@@ -311,8 +307,8 @@
311 if (qe.gt.occtol) then307 if (qe.gt.occtol) then
312 if (Node.eq.BNode) then308 if (Node.eq.BNode) then
313 do j = 1,nuotot309 do j = 1,nuotot
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}
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}
316 enddo312 enddo
317 endif313 endif
318#ifdef MPI314#ifdef MPI
@@ -324,37 +320,33 @@
324 call LocalToGlobalOrb(iuo,Node,Nodes,iio)320 call LocalToGlobalOrb(iuo,Node,Nodes,iio)
325 do juo = 1,nuotot321 do juo = 1,nuotot
326 322
327! Relation: c_{i,up} = caux(1,i)323! | ------- 1,1 ------- ------- 1,2 ------- |
328! c_{i,dn} = caux(2,i)324! | c_{j,up}^* c_{i,up} c_{j,dn}^* c_{i,up) |
329!325! D_{j,i} = | |
330! | ----- 1,1 ------- ----- 2,1 ------- |326! | ------- 2,1 ------- ------- 2,2 ------- |
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) |
332! D_{j,i} = | |328!
333! | ----- 1,2 ------- ----- 2,2 ------- |329!
334! | c_{j,d} c_{i,u}^* c_{j,d} c_{i,d)^* |330! | ------- 1,1 ------- ------- 1,2 ------- |
335!331! | D_{j,i}(1) D_{j,i}(3)+i D_{j,i}(4) |
336!332! = | |
337! | ----- 1,1 ------- ----- 2,1 ------- |333! | ------- 2,1 ------- ------- 2,2 ------- |
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) |
339! = | |
340! | ----- 1,2 ------- ----- 2,2 ------- |
341! | D_{i,j}(3)-i D_{i,j}(4) D_{j,i}(2) |
342!
343 335
344!------- 1,1 -----------------------------------------------------------336!------- 1,1 -----------------------------------------------------------
345 cicj = dconjg(caux(1,iio)) * caux(1,juo)337 cicj = dconjg(caux(1,juo)) * caux(1,iio)
346 Dkc(1,juo,1,iuo) = Dkc(1,juo,1,iuo) + qe * cicj338 Dkc(1,juo,1,iuo) = Dkc(1,juo,1,iuo) + qe * cicj
347 Ekc(1,juo,1,iuo) = Ekc(1,juo,1,iuo) + ee * cicj339 Ekc(1,juo,1,iuo) = Ekc(1,juo,1,iuo) + ee * cicj
348!------- 2,2 -----------------------------------------------------------340!------- 2,2 -----------------------------------------------------------
349 cicj = dconjg(caux(2,iio)) * caux(2,juo)341 cicj = dconjg(caux(2,juo)) * caux(2,iio)
350 Dkc(2,juo,2,iuo) = Dkc(2,juo,2,iuo) + qe * cicj342 Dkc(2,juo,2,iuo) = Dkc(2,juo,2,iuo) + qe * cicj
351 Ekc(2,juo,2,iuo) = Ekc(2,juo,2,iuo) + ee * cicj343 Ekc(2,juo,2,iuo) = Ekc(2,juo,2,iuo) + ee * cicj
352!------- 2,1 -----------------------------------------------------------344!------- 1,2 -----------------------------------------------------------
353 cicj = dconjg(caux(1,iio)) * caux(2,juo)345 cicj = dconjg(caux(2,juo)) * caux(1,iio)
354 Dkc(1,juo,2,iuo) = Dkc(1,juo,2,iuo) + qe * cicj346 Dkc(1,juo,2,iuo) = Dkc(1,juo,2,iuo) + qe * cicj
355 Ekc(1,juo,2,iuo) = Ekc(1,juo,2,iuo) + ee * cicj347 Ekc(1,juo,2,iuo) = Ekc(1,juo,2,iuo) + ee * cicj
356!------- 1,2 -----------------------------------------------------------348!------- 2,1 -----------------------------------------------------------
357 cicj = dconjg(caux(2,iio)) * caux(1,juo)349 cicj = dconjg(caux(1,juo)) * caux(2,iio)
358 Dkc(2,juo,1,iuo) = Dkc(2,juo,1,iuo) + qe * cicj350 Dkc(2,juo,1,iuo) = Dkc(2,juo,1,iuo) + qe * cicj
359 Ekc(2,juo,1,iuo) = Ekc(2,juo,1,iuo) + ee * cicj351 Ekc(2,juo,1,iuo) = Ekc(2,juo,1,iuo) + ee * cicj
360 enddo352 enddo
@@ -383,47 +375,31 @@
383 . kpoint(3,ik) * xij(3,ind)375 . kpoint(3,ik) * xij(3,ind)
384 kphs = cdexp(dcmplx(0.0_dp,-1.0_dp)*kxij)376 kphs = cdexp(dcmplx(0.0_dp,-1.0_dp)*kxij)
385 377
386! Average k and -k solutions because time-reversal symetry378 D11 = Dkc(1,juo,1,iuo) * kphs
387 D11 = 0.5_dp * (Dkc(1,juo,1,iuo) * kphs379 D22 = Dkc(2,juo,2,iuo) * kphs
388 . + dconjg(Dkc(1,juo,1,iuo) * kphs))380 D12 = Dkc(1,juo,2,iuo) * kphs
389 381 D21 = Dkc(2,juo,1,iuo) * kphs
390 D22 = 0.5_dp * (Dkc(2,juo,2,iuo) * kphs382
391 . + dconjg(Dkc(2,juo,2,iuo) * kphs))383 ! Make D12/D21 Hermitian
392
393 D12 = 0.5_dp * (Dkc(1,juo,2,iuo) * kphs
394 . + dconjg(Dkc(2,juo,1,iuo) * kphs))
395
396 D21 = 0.5_dp * (Dkc(2,juo,1,iuo) * kphs
397 . + dconjg(Dkc(1,juo,2,iuo) * kphs))
398
399 D12 = 0.5_dp * (D12 + dconjg(D21))384 D12 = 0.5_dp * (D12 + dconjg(D21))
400 D21 = dconjg(D12)385
401
402 Dnew(ind,1) = Dnew(ind,1) + dreal(D11)386 Dnew(ind,1) = Dnew(ind,1) + dreal(D11)
403 Dnew(ind,2) = Dnew(ind,2) + dreal(D22)387 Dnew(ind,2) = Dnew(ind,2) + dreal(D22)
404 Dnew(ind,3) = Dnew(ind,3) + dreal(D12)388 Dnew(ind,3) = Dnew(ind,3) + dreal(D12)
405 Dnew(ind,4) = Dnew(ind,4) + dimag(D12)389 Dnew(ind,4) = Dnew(ind,4) - dimag(D12)
406 390
407! Average k and -k solutions because time-reversal symetry391 D11 = Ekc(1,juo,1,iuo) * kphs
408 D11 = 0.5_dp * (Ekc(1,juo,1,iuo) * kphs392 D22 = Ekc(2,juo,2,iuo) * kphs
409 . + dconjg(Ekc(1,juo,1,iuo) * kphs))393 D12 = Ekc(1,juo,2,iuo) * kphs
410 394 D21 = Ekc(2,juo,1,iuo) * kphs
411 D22 = 0.5_dp * (Ekc(2,juo,2,iuo) * kphs395
412 . + dconjg(Ekc(2,juo,2,iuo) * kphs))396 ! Make D12/D21 Hermitian
413
414 D12 = 0.5_dp * (Ekc(1,juo,2,iuo) * kphs
415 . + dconjg(Ekc(2,juo,1,iuo) * kphs))
416
417 D21 = 0.5_dp * (Ekc(2,juo,1,iuo) * kphs
418 . + dconjg(Ekc(1,juo,2,iuo) * kphs))
419
420 D12 = 0.5_dp * (D12 + dconjg(D21))397 D12 = 0.5_dp * (D12 + dconjg(D21))
421 D21 = dconjg(D12)
422 398
423 Enew(ind,1) = Enew(ind,1) + dreal(D11)399 Enew(ind,1) = Enew(ind,1) + dreal(D11)
424 Enew(ind,2) = Enew(ind,2) + dreal(D22)400 Enew(ind,2) = Enew(ind,2) + dreal(D22)
425 Enew(ind,3) = Enew(ind,3) + dreal(D12) 401 Enew(ind,3) = Enew(ind,3) + dreal(D12)
426 Enew(ind,4) = Enew(ind,4) + dimag(D12) 402 Enew(ind,4) = Enew(ind,4) - dimag(D12)
427 403
428 enddo404 enddo
429 enddo405 enddo
@@ -436,30 +412,9 @@
436 deallocate(Haux)412 deallocate(Haux)
437 call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k')413 call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k')
438 deallocate(Saux)414 deallocate(Saux)
439 call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k')415 call memory('D','Z',MColl*nuotot,'diag2k')
440 deallocate(Dkc)
441 call memory('D','Z',MColl*nuotot*MColl*nuo,'diag2k')
442 deallocate(Ekc)
443 call memory('D','Z',MColl*MColl*nuotot,'diag2k')
444 deallocate(caux)416 deallocate(caux)
445 417
446! write(160+node,*)'ITERATION'
447! write(170+node,*)'ITERATION'
448! do iuo = 1,nuo
449! do j = 1,numd(iuo)
450! ind = listdptr(iuo) + j
451! jo = listd(ind)
452! juo = indxuo(jo)
453! write(160+node,'(3i5,4f15.9)')iuo,juo,jo,Dnew(ind,1:4)
454! write(170+node,'(3i5,4f15.9)')iuo,juo,jo,
455! . (Dnew(ind,1)+Dnew(ind,2))*0.5,
456! . (Dnew(ind,1)-Dnew(ind,2))*0.5,Dnew(ind,3:4)
457! enddo
458! enddo
459!
460! call die('maslyuk')
461!***********************************************************************
462 return418 return
463 end subroutine diag2k419 end subroutine diag2k
464!***********************************************************************
465 420
466421
=== modified file 'Src/kpoint_grid.F90'
--- Src/kpoint_grid.F90 2017-10-05 10:01:03 +0000
+++ Src/kpoint_grid.F90 2018-04-12 11:54:08 +0000
@@ -44,6 +44,7 @@
44 USE parallel, only : Node44 USE parallel, only : Node
45 USE fdf, only : fdf_defined, fdf_get45 USE fdf, only : fdf_defined, fdf_get
46 USE m_find_kgrid, only : find_kgrid46 USE m_find_kgrid, only : find_kgrid
47 use m_spin, only: MColl
4748
48 implicit none49 implicit none
49 real(dp) :: ucell(3,3)50 real(dp) :: ucell(3,3)
@@ -52,11 +53,12 @@
52 if (scf_kgrid_first_time) then53 if (scf_kgrid_first_time) then
53 nullify(kweight,kpoint)54 nullify(kweight,kpoint)
54 spiral = fdf_defined('SpinSpiral')55 spiral = fdf_defined('SpinSpiral')
55 ! Allow the user to control the use of time-reversal-symmetry56 ! Allow the user to control the use of time-reversal-symmetry
56 ! By default, it is on, except for "spin-spiral" calculations57 ! By default, it is on, except for "spin-spiral" calculations
57 time_reversal_symmetry = fdf_get( &58 ! and/or non-colinear calculations
58 "TimeReversalSymmetryForKpoints", &59 time_reversal_symmetry = fdf_get( &
59 (.not. spiral))60 "TimeReversalSymmetryForKpoints", &
61 (.not. spiral) .and. MColl == 1)
60 call setup_scf_kscell(ucell, firm_displ)62 call setup_scf_kscell(ucell, firm_displ)
6163
62 scf_kgrid_first_time = .false.64 scf_kgrid_first_time = .false.
6365
=== modified file 'Src/kpoint_pdos.F90'
--- Src/kpoint_pdos.F90 2017-10-05 10:01:03 +0000
+++ Src/kpoint_pdos.F90 2018-04-12 11:54:08 +0000
@@ -43,6 +43,7 @@
43 USE parallel, only : Node43 USE parallel, only : Node
44 USE fdf, only : fdf_defined, fdf_get44 USE fdf, only : fdf_defined, fdf_get
45 USE m_find_kgrid, only : find_kgrid45 USE m_find_kgrid, only : find_kgrid
46 use m_spin, only: MColl
4647
47 implicit none48 implicit none
48 real(dp), intent(in) :: ucell(3,3)49 real(dp), intent(in) :: ucell(3,3)
@@ -52,11 +53,12 @@
52 if (pdos_kgrid_first_time) then53 if (pdos_kgrid_first_time) then
53 nullify(kweight_pdos,kpoints_pdos)54 nullify(kweight_pdos,kpoints_pdos)
54 spiral = fdf_defined('SpinSpiral')55 spiral = fdf_defined('SpinSpiral')
55 ! Allow the user to control the use of time-reversal-symmetry56 ! Allow the user to control the use of time-reversal-symmetry
56 ! By default, it is on, except for "spin-spiral" calculations57 ! By default, it is on, except for "spin-spiral" calculations
57 time_reversal_symmetry = fdf_get( &58 ! and/or non-colinear calculations
58 "TimeReversalSymmetryForKpoints", &59 time_reversal_symmetry = fdf_get( &
59 (.not. spiral))60 "TimeReversalSymmetryForKpoints", &
61 (.not. spiral) .and. MColl == 1)
6062
61 call setup_pdos_kscell(ucell, firm_displ)63 call setup_pdos_kscell(ucell, firm_displ)
6264
6365
=== modified file 'Src/mulliken.F'
--- Src/mulliken.F 2018-04-11 23:32:54 +0000
+++ Src/mulliken.F 2018-04-12 11:54:08 +0000
@@ -513,7 +513,6 @@
513 end if ! nspin .ge. 4513 end if ! nspin .ge. 4
514 end if514 end if
515515
516C ...................
517516
518#ifdef DEBUG517#ifdef DEBUG
519 call write_debug( ' POS mulliken' )518 call write_debug( ' POS mulliken' )
520519
=== modified file 'version.info'
--- version.info 2018-04-11 23:32:54 +0000
+++ version.info 2018-04-12 11:54:08 +0000
@@ -1,1 +1,1 @@
1siesta-4.0--5631siesta-4.0--563--trs-7

Subscribers

People subscribed via source and target branches