LCOV - code coverage report
Current view: top level - eigen - hsmt_spinor.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 40 43 93.0 %
Date: 2019-09-08 04:53:50 Functions: 2 2 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             : MODULE m_hsmt_spinor
       8             :   IMPLICIT NONE
       9             : CONTAINS
      10             : 
      11             :   !The spinors are calculated both in hssphn_sph & hssphn_nonsph, hence this is a
      12             :   !common subroutine
      13        2576 :   SUBROUTINE hsmt_spinor(isp,n,noco,chi_mat)
      14             :     USE m_types
      15             :     use m_constants
      16             :     IMPLICIT NONE
      17             : 
      18             :     TYPE(t_noco),INTENT(IN)      :: noco
      19             :     INTEGER,INTENT(IN)           :: isp, n
      20             :     COMPLEX,INTENT(OUT)          :: chi_mat(2,2)
      21             :    
      22             :     INTEGER           :: isp1,isp2
      23             :     COMPLEX           :: chi(2,2)
      24             : 
      25             :     !--->       set up the spinors of this atom within global
      26             :     !--->       spin-coordinateframe
      27        2576 :     chi(1,1) =  exp(ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
      28        2576 :     chi(1,2) = -EXP(ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
      29        2576 :     chi(2,1) =  EXP(-ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
      30        2576 :     chi(2,2) =  EXP(-ImagUnit*noco%alph(n)/2)*COS(noco%beta(n)/2)
      31             :     !--->       and determine the prefactors for the Hamitonian- and
      32             :     !--->       overlapp-matrix elements
      33        2576 :     IF (isp<3) THEN
      34             :        isp1=isp
      35             :        isp2=isp
      36           0 :     ELSEIF(isp==3) THEN
      37             :        isp1=2
      38             :        isp2=1
      39             :     ELSE
      40           0 :        isp1=1
      41           0 :        isp2=2
      42             :     ENDIF
      43             :     
      44        2576 :     chi_mat(1,1) = chi(1,isp1)*CONJG(chi(1,isp2))
      45        2576 :     chi_mat(2,1) = chi(2,isp1)*CONJG(chi(1,isp2))
      46        2576 :     chi_mat(2,2) = chi(2,isp1)*CONJG(chi(2,isp2))
      47        2576 :     chi_mat(1,2) = chi(1,isp1)*CONJG(chi(2,isp2))
      48             : 
      49             :     
      50             :     
      51        2576 :   END SUBROUTINE hsmt_spinor
      52             : 
      53       24720 :   SUBROUTINE hsmt_spinor_soc(n,ki,noco,lapw,chi_so,angso)
      54             :     USE m_types
      55             :     use m_constants
      56             :     IMPLICIT NONE
      57             :     TYPE(t_noco),INTENT(IN)      :: noco
      58             :     TYPE(t_lapw),INTENT(IN)      :: lapw
      59             :     INTEGER,INTENT(IN)           :: n,ki
      60             :     COMPLEX,INTENT(out)          :: chi_so(:,:,:,:)
      61             :     COMPLEX,INTENT(out),OPTIONAL :: angso(:,:,:)
      62             : 
      63             :     REAL     :: cross_k(3)
      64             :     INTEGER  :: j1,j2,kj
      65             :     COMPLEX  :: isigma(2,2,3)
      66             :     COMPLEX  :: chi(2,2)
      67             :     COMPLEX  :: isigma_x(2,2),isigma_y(2,2),isigma_z(2,2)
      68             :     
      69             :     !     isigma= -i * sigma, where sigma is Pauli matrix
      70       24720 :     isigma=CMPLX(0.0,0.0)
      71       24720 :     isigma(1,2,1)=CMPLX(0.0,-1.0)
      72       24720 :     isigma(2,1,1)=CMPLX(0.0,-1.0)
      73       24720 :     isigma(1,2,2)=CMPLX(-1.0,0.0)
      74       24720 :     isigma(2,1,2)=CMPLX(1.0,0.0)
      75       24720 :     isigma(1,1,3)=CMPLX(0.0,-1.0)
      76       24720 :     isigma(2,2,3)=CMPLX(0.0,1.0)
      77             :     
      78             :     !--->       set up the spinors of this atom within global
      79             :     !--->       spin-coordinateframe
      80       24720 :     chi(1,1) =  exp(ImagUnit*noco%alph(n)/2)*cos(noco%beta(n)/2)
      81       24720 :     chi(1,2) = -EXP(ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
      82       24720 :     chi(2,1) =  EXP(-ImagUnit*noco%alph(n)/2)*SIN(noco%beta(n)/2)
      83       24720 :     chi(2,2) =  EXP(-ImagUnit*noco%alph(n)/2)*COS(noco%beta(n)/2)
      84             : 
      85       24720 :     isigma_x=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,1),chi))
      86       24720 :     isigma_y=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,2),chi))
      87       24720 :     isigma_z=MATMUL(CONJG(TRANSPOSE(chi)), MATMUL(isigma(:,:,3),chi))
      88       74160 :     DO j1=1,2
      89      271920 :        DO j2=1,2
      90       98880 :           chi_so(1,1,j1,j2)=chi(1,j1)*CONJG(chi(1,j2))
      91       98880 :           chi_so(2,1,j1,j2)=chi(2,j1)*CONJG(chi(1,j2))
      92       98880 :           chi_so(2,2,j1,j2)=chi(2,j1)*CONJG(chi(2,j2))
      93      148320 :           chi_so(1,2,j1,j2)=chi(1,j1)*CONJG(chi(2,j2))
      94             :        ENDDO
      95             :     ENDDO
      96       24720 :     IF (.not.present(angso)) RETURN !only chis are needed 
      97             :   !In the first variation SOC case the off-diagonal spinors are needed
      98     1310720 :        DO kj = 1,ki
      99     1286000 :           cross_k(1)=lapw%gk(2,ki,1)*lapw%gk(3,kj,1)- lapw%gk(3,ki,1)*lapw%gk(2,kj,1)
     100     1286000 :           cross_k(2)=lapw%gk(3,ki,1)*lapw%gk(1,kj,1)- lapw%gk(1,ki,1)*lapw%gk(3,kj,1)
     101     1286000 :           cross_k(3)=lapw%gk(1,ki,1)*lapw%gk(2,kj,1)- lapw%gk(2,ki,1)*lapw%gk(1,kj,1)
     102     3882720 :           DO j1=1,2
     103    14146000 :              DO j2=1,2
     104             :                 angso(kj,j1,j2)= isigma_x(j1,j2)*cross_k(1)+&
     105     7716000 :                      isigma_y(j1,j2)*cross_k(2)+ isigma_z(j1,j2)*cross_k(3)
     106             :              ENDDO
     107             :           ENDDO
     108             :        ENDDO
     109             :      END SUBROUTINE hsmt_spinor_soc
     110             : 
     111             :   
     112             : END MODULE m_hsmt_spinor

Generated by: LCOV version 1.13