The Elk Code
 
Loading...
Searching...
No Matches
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:
9pure subroutine gensdmat(evecsv,sdmat)
10! !USES:
11use 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
22implicit none
23! arguments
24complex(8), intent(in) :: evecsv(nstsv,nstsv)
25complex(8), intent(out) :: sdmat(nspinor,nspinor,nstsv)
26! local variables
27integer ispn,jspn,ist,j
28complex(8) z1,z2
29sdmat(:,:,:)=0.d0
30do 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
40end do
41end subroutine
42!EOC
43
pure subroutine gensdmat(evecsv, sdmat)
Definition gensdmat.f90:10
integer nspinor
Definition modmain.f90:267
integer nstsv
Definition modmain.f90:886
integer nstfv
Definition modmain.f90:884