Commit cc7db29b authored by Daniel Wortmann's avatar Daniel Wortmann

New attempt to bugfix SOC in first variation

parent f5d8e499
......@@ -41,9 +41,9 @@ SUBROUTINE orbMagMoms(input,atoms,noco,clmom)
phii = noco%alph(iType)
!Fix of sign of moment in first variation calculations. Perhaps it would be better to understand this :-(
slxmom=-1*slxmom
slymom=-1*slymom
slmom=-1*slmom
!slxmom=-1*slxmom
!slymom=-1*slymom
!slmom=-1*slmom
END IF
! rotation: orbital moment || spin moment (extended to incude phi - hopefully)
......
......@@ -222,9 +222,9 @@ CONTAINS
#else
ne_found=ne_all
#endif
!IF (.NOT.zMat%l_real) THEN
! zMat%data_c(:lapw%nmat,:ne_found) = CONJG(zMat%data_c(:lapw%nmat,:ne_found))
!END IF
IF (.NOT.zMat%l_real) THEN
zMat%data_c(:lapw%nmat,:ne_found) = CONJG(zMat%data_c(:lapw%nmat,:ne_found))
END IF
IF (mpi%n_rank == 0) THEN
! Only process 0 writes out the value of ne_all and the
! eigenvalues.
......
......@@ -48,13 +48,13 @@ CONTAINS
ii=-1*ii
in = stars%ig(ii(1),ii(2),ii(3))
IF (in.EQ.0) CYCLE
th = stars%rgphs(ii(1),ii(2),ii(3))*vpw(in,3)
th = stars%rgphs(ii(1),ii(2),ii(3))*conjg(vpw(in,3))
ts=0.0
ELSEIF(ispin==2.and.jspin==1) THEN
! ii = -1*ii
in = stars%ig(ii(1),ii(2),ii(3))
IF (in.EQ.0) CYCLE
th = stars%rgphs(ii(1),ii(2),ii(3))*conjg(vpw(in,3))
th = stars%rgphs(ii(1),ii(2),ii(3))*vpw(in,3)
ts=0.0
ELSE
!--> determine index and phase factor
......
......@@ -37,8 +37,7 @@ CONTAINS
COMPLEX:: chi(2,2,2,2),angso(lapw%nv(1),2,2)
REAL, ALLOCATABLE :: plegend(:,:),dplegend(:,:)
COMPLEX, ALLOCATABLE :: cph(:)
CALL timestart("offdiagonal soc-setup")
DO l = 0,atoms%lmaxd
......@@ -87,6 +86,7 @@ CONTAINS
DO l = 1,atoms%lmax(n)
DO j1=1,2
DO j2=1,2
!DO j2=j1,j1
DO kj = 1,ki
fct =cph(kj) * dplegend(kj,l)*fl2p1(l)*(&
fj(ki,l,j1)*fj(kj,l,j2) *td%rsoc%rsopp(n,l,j1,j2) + &
......
......@@ -24,21 +24,21 @@ CONTAINS
!---> set up the spinors of this atom within global
!---> spin-coordinateframe
chi(1,1) = exp(-ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
chi(1,2) = -exp(-ImagUnit*noco%alph(n)/2)*sin(noco%beta(n)/2)
chi(2,1) = exp(ImagUnit*noco%alph(n)/2)*sin(noco%beta(n)/2)
chi(2,2) = exp(ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
chi(1,1) = exp(ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
chi(1,2) = -EXP(ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
chi(2,1) = EXP(-ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
chi(2,2) = EXP(-ImagUnit*noco%alph(n)/2)*COS(noco%beta(n)/2)
!---> and determine the prefactors for the Hamitonian- and
!---> overlapp-matrix elements
IF (isp<3) THEN
isp1=isp
isp2=isp
ELSEIF(isp==3) THEN
isp1=1
isp2=2
ELSE
isp1=2
isp2=1
ELSE
isp1=1
isp2=2
ENDIF
chi_mat(1,1) = chi(1,isp1)*CONJG(chi(1,isp2))
......@@ -77,10 +77,10 @@ CONTAINS
!---> set up the spinors of this atom within global
!---> spin-coordinateframe
chi(1,1) = exp(-ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
chi(1,2) = -exp(-ImagUnit*noco%alph(n)/2)*sin(noco%beta(n)/2)
chi(2,1) = exp(ImagUnit*noco%alph(n)/2)*sin(noco%beta(n)/2)
chi(2,2) = EXP(ImagUnit*noco%alph(n)/2)*COS(noco%beta(n)/2)
chi(1,1) = exp(ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
chi(1,2) = -EXP(ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
chi(2,1) = EXP(-ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
chi(2,2) = EXP(-ImagUnit*noco%alph(n)/2)*COS(noco%beta(n)/2)
isigma_x=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,1),chi))
isigma_y=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,2),chi))
......
......@@ -53,7 +53,7 @@ CONTAINS
REAL u(vacuum%nmzd,size(duz,1),input%jspins),ud(vacuum%nmzd,size(duz,1),input%jspins)
REAL v(3),x(vacuum%nmzd), qssbti(2,2)
! ..
fac=MERGE(1.0,-1.0,jspin1<=jspin2)
fac=MERGE(1.0,-1.0,jspin1>=jspin2)
ipot=MERGE(jspin1,3,jspin1==jspin2)
tuuv=0.0;tudv=0.0;tddv=0.0;tduv=0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment