The Elk Code
gensdmat.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2008 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: gensdmat
8 ! !INTERFACE:
9 pure subroutine gensdmat(evecsv,sdmat)
10 ! !USES:
11 use modmain
12 ! !INPUT/OUTPUT PARAMETERS:
13 ! evecsv : second-variational eigenvectors (in,complex(nstsv,nstsv))
14 ! sdmat : spin density matrices (out,complex(nspinor,nspinor,nstsv))
15 ! !DESCRIPTION:
16 ! Computes the spin density matrices for a set of second-variational states.
17 !
18 ! !REVISION HISTORY:
19 ! Created September 2008 (JKD)
20 !EOP
21 !BOC
22 implicit none
23 ! arguments
24 complex(8), intent(in) :: evecsv(nstsv,nstsv)
25 complex(8), intent(out) :: sdmat(nspinor,nspinor,nstsv)
26 ! local variables
27 integer ispn,jspn,ist,j
28 complex(8) z1,z2
29 sdmat(:,:,:)=0.d0
30 do j=1,nstsv
31  do ispn=1,nspinor
32  do jspn=1,nspinor
33  do ist=1,nstfv
34  z1=evecsv(ist+nstfv*(ispn-1),j)
35  z2=evecsv(ist+nstfv*(jspn-1),j)
36  sdmat(ispn,jspn,j)=sdmat(ispn,jspn,j)+z1*conjg(z2)
37  end do
38  end do
39  end do
40 end do
41 end subroutine
42 !EOC
43 
pure subroutine gensdmat(evecsv, sdmat)
Definition: gensdmat.f90:10
integer nstsv
Definition: modmain.f90:889
integer nspinor
Definition: modmain.f90:267
integer nstfv
Definition: modmain.f90:887