hsmt_spinor.F90 4.2 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,kj_start,kj_end)
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
    TYPE(t_lapw),INTENT(IN)      :: lapw
    INTEGER,INTENT(IN)           :: n,ki
    COMPLEX,INTENT(out)          :: chi_so(:,:,:,:)
    COMPLEX,INTENT(out),OPTIONAL :: angso(:,:,:)
62
    INTEGER,INTENT(in), OPTIONAL :: kj_start,kj_end
Daniel Wortmann's avatar
Daniel Wortmann committed
63 64 65 66 67 68

    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)
69

Daniel Wortmann's avatar
Daniel Wortmann committed
70 71 72 73 74 75 76 77
    !     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)
78

Daniel Wortmann's avatar
Daniel Wortmann committed
79 80
    !--->       set up the spinors of this atom within global
    !--->       spin-coordinateframe
81 82 83 84
    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
85 86 87 88 89 90

    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
91 92 93 94
          chi_so(1,1,j1,j2)=chi(1,j2)*CONJG(chi(1,j1))
          chi_so(2,1,j1,j2)=chi(2,j2)*CONJG(chi(1,j1))
          chi_so(2,2,j1,j2)=chi(2,j2)*CONJG(chi(2,j1))
          chi_so(1,2,j1,j2)=chi(1,j2)*CONJG(chi(2,j1))
Daniel Wortmann's avatar
Daniel Wortmann committed
95 96
       ENDDO
    ENDDO
97
    IF (.not.present(angso)) RETURN !only chis are needed
98 99 100 101 102 103 104 105 106 107 108
    !In the first variation SOC case the off-diagonal spinors are needed
    IF (present(angso)) THEN
      IF ((.not.present(kj_start)).or.((.not.present(kj_end)))) RETURN
    ENDIF
    DO kj = kj_start,kj_end
       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-kj_start+1,j1,j2)= isigma_x(j1,j2)*cross_k(1)+&
Daniel Wortmann's avatar
Daniel Wortmann committed
109
                     isigma_y(j1,j2)*cross_k(2)+ isigma_z(j1,j2)*cross_k(3)
110 111
          ENDDO
       ENDDO
112 113
    ENDDO
  END SUBROUTINE hsmt_spinor_soc
114

115

116
END MODULE m_hsmt_spinor