hsmt_spinor.F90 4.03 KB
Newer Older
1 2 3 4 5 6
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------

7 8 9 10 11 12
MODULE m_hsmt_spinor
  IMPLICIT NONE
CONTAINS

  !The spinors are calculated both in hssphn_sph & hssphn_nonsph, hence this is a
  !common subroutine
13
  SUBROUTINE hsmt_spinor(isp,n,nococonv,chi_mat)
14
    USE m_types
15
    use m_constants
16 17
    IMPLICIT NONE

18
    TYPE(t_nococonv),INTENT(IN)      :: nococonv
Daniel Wortmann's avatar
Daniel Wortmann committed
19 20
    INTEGER,INTENT(IN)           :: isp, n
    COMPLEX,INTENT(OUT)          :: chi_mat(2,2)
21

Daniel Wortmann's avatar
Daniel Wortmann committed
22 23
    INTEGER           :: isp1,isp2
    COMPLEX           :: chi(2,2)
24 25 26

    !--->       set up the spinors of this atom within global
    !--->       spin-coordinateframe
27 28 29 30
    chi(1,1) =  exp(ImagUnit*nococonv%alph(n)/2)*cos(nococonv%beta(n)/2)
    chi(1,2) = -EXP(ImagUnit*nococonv%alph(n)/2)*SIN(nococonv%beta(n)/2)
    chi(2,1) =  EXP(-ImagUnit*nococonv%alph(n)/2)*SIN(nococonv%beta(n)/2)
    chi(2,2) =  EXP(-ImagUnit*nococonv%alph(n)/2)*COS(nococonv%beta(n)/2)
31 32
    !--->       and determine the prefactors for the Hamitonian- and
    !--->       overlapp-matrix elements
33 34 35 36 37 38
    IF (isp<3) THEN
       isp1=isp
       isp2=isp
    ELSEIF(isp==3) THEN
       isp1=2
       isp2=1
39 40 41
    ELSE
       isp1=1
       isp2=2
42
    ENDIF
43

44 45 46 47
    chi_mat(1,1) = chi(1,isp1)*CONJG(chi(1,isp2))
    chi_mat(2,1) = chi(2,isp1)*CONJG(chi(1,isp2))
    chi_mat(2,2) = chi(2,isp1)*CONJG(chi(2,isp2))
    chi_mat(1,2) = chi(1,isp1)*CONJG(chi(2,isp2))
Daniel Wortmann's avatar
Daniel Wortmann committed
48

49 50


Daniel Wortmann's avatar
Daniel Wortmann committed
51
  END SUBROUTINE hsmt_spinor
52

53
  SUBROUTINE hsmt_spinor_soc(n,ki,nococonv,lapw,chi_so,angso)
Daniel Wortmann's avatar
Daniel Wortmann committed
54
    USE m_types
55
    use m_constants
Daniel Wortmann's avatar
Daniel Wortmann committed
56
    IMPLICIT NONE
57
    TYPE(t_nococonv),INTENT(IN)      :: nococonv
Daniel Wortmann's avatar
Daniel Wortmann committed
58 59 60 61 62 63 64 65 66 67
    TYPE(t_lapw),INTENT(IN)      :: lapw
    INTEGER,INTENT(IN)           :: n,ki
    COMPLEX,INTENT(out)          :: chi_so(:,:,:,:)
    COMPLEX,INTENT(out),OPTIONAL :: angso(:,:,:)

    REAL     :: cross_k(3)
    INTEGER  :: j1,j2,kj
    COMPLEX  :: isigma(2,2,3)
    COMPLEX  :: chi(2,2)
    COMPLEX  :: isigma_x(2,2),isigma_y(2,2),isigma_z(2,2)
68

Daniel Wortmann's avatar
Daniel Wortmann committed
69 70 71 72 73 74 75 76
    !     isigma= -i * sigma, where sigma is Pauli matrix
    isigma=CMPLX(0.0,0.0)
    isigma(1,2,1)=CMPLX(0.0,-1.0)
    isigma(2,1,1)=CMPLX(0.0,-1.0)
    isigma(1,2,2)=CMPLX(-1.0,0.0)
    isigma(2,1,2)=CMPLX(1.0,0.0)
    isigma(1,1,3)=CMPLX(0.0,-1.0)
    isigma(2,2,3)=CMPLX(0.0,1.0)
77

Daniel Wortmann's avatar
Daniel Wortmann committed
78 79
    !--->       set up the spinors of this atom within global
    !--->       spin-coordinateframe
80 81 82 83
    chi(1,1) =  exp(ImagUnit*nococonv%alph(n)/2)*cos(nococonv%beta(n)/2)
    chi(1,2) = -EXP(ImagUnit*nococonv%alph(n)/2)*SIN(nococonv%beta(n)/2)
    chi(2,1) =  EXP(-ImagUnit*nococonv%alph(n)/2)*SIN(nococonv%beta(n)/2)
    chi(2,2) =  EXP(-ImagUnit*nococonv%alph(n)/2)*COS(nococonv%beta(n)/2)
Daniel Wortmann's avatar
Daniel Wortmann committed
84 85 86 87 88 89 90 91 92 93 94 95

    isigma_x=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,1),chi))
    isigma_y=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,2),chi))
    isigma_z=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,3),chi))
    DO j1=1,2
       DO j2=1,2
          chi_so(1,1,j1,j2)=chi(1,j1)*CONJG(chi(1,j2))
          chi_so(2,1,j1,j2)=chi(2,j1)*CONJG(chi(1,j2))
          chi_so(2,2,j1,j2)=chi(2,j1)*CONJG(chi(2,j2))
          chi_so(1,2,j1,j2)=chi(1,j1)*CONJG(chi(2,j2))
       ENDDO
    ENDDO
96
    IF (.not.present(angso)) RETURN !only chis are needed
Daniel Wortmann's avatar
Daniel Wortmann committed
97 98 99 100 101 102 103 104 105
  !In the first variation SOC case the off-diagonal spinors are needed
       DO kj = 1,ki
          cross_k(1)=lapw%gk(2,ki,1)*lapw%gk(3,kj,1)- lapw%gk(3,ki,1)*lapw%gk(2,kj,1)
          cross_k(2)=lapw%gk(3,ki,1)*lapw%gk(1,kj,1)- lapw%gk(1,ki,1)*lapw%gk(3,kj,1)
          cross_k(3)=lapw%gk(1,ki,1)*lapw%gk(2,kj,1)- lapw%gk(2,ki,1)*lapw%gk(1,kj,1)
          DO j1=1,2
             DO j2=1,2
                angso(kj,j1,j2)= isigma_x(j1,j2)*cross_k(1)+&
                     isigma_y(j1,j2)*cross_k(2)+ isigma_z(j1,j2)*cross_k(3)
106 107 108
             ENDDO
          ENDDO
       ENDDO
Daniel Wortmann's avatar
Daniel Wortmann committed
109
     END SUBROUTINE hsmt_spinor_soc
110

111

112
END MODULE m_hsmt_spinor