The Elk Code
 
Loading...
Searching...
No Matches
dmatls.f90
Go to the documentation of this file.
1
2! Copyright (C) 2019 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine dmatls(dmat,xl,xs)
7use modmain
8implicit none
9! arguments
10complex(8), intent(in) :: dmat(lmmaxo,nspinor,lmmaxo,nspinor)
11real(8), intent(out) :: xl(3),xs(3)
12! local variables
13integer ispn,lm
14! automatic arrays
15complex(8) zlflm(lmmaxo,3)
16! compute tr(LD)
17xl(:)=0.d0
18do ispn=1,nspinor
19 do lm=1,lmmaxo
20 call lopzflm(lmaxo,dmat(:,ispn,lm,ispn),lmmaxo,zlflm)
21 xl(:)=xl(:)+dble(zlflm(lm,:))
22 end do
23end do
24! compute tr(sigma D)
25xs(:)=0.d0
26if (spinpol) then
27 do lm=1,lmmaxo
28 xs(1)=xs(1)+dble(dmat(lm,2,lm,1)+dmat(lm,1,lm,2))
29 xs(2)=xs(2)+dble(-zi*dmat(lm,2,lm,1)+zi*dmat(lm,1,lm,2))
30 xs(3)=xs(3)+dble(dmat(lm,1,lm,1)-dmat(lm,2,lm,2))
31 end do
32! S = 1/2 sigma
33 xs(:)=0.5d0*xs(:)
34end if
35end subroutine
36
subroutine dmatls(dmat, xl, xs)
Definition dmatls.f90:7
pure subroutine lopzflm(lmax, zflm, ld, zlflm)
Definition lopzflm.f90:10
logical spinpol
Definition modmain.f90:228
complex(8), parameter zi
Definition modmain.f90:1239
integer lmaxo
Definition modmain.f90:201