File: gensdmat.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (44 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

! Copyright (C) 2008 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
! This file is distributed under the terms of the GNU General Public License.
! See the file COPYING for license details.

!BOP
! !ROUTINE: gensdmat
! !INTERFACE:
subroutine gensdmat(evecsv,sdmat)
! !USES:
use modmain
! !INPUT/OUTPUT PARAMETERS:
!   evecsv : second-variational eigenvectors (in,complex(nstsv,nstsv))
!   sdmat  : spin density matrices (out,complex(nspinor,nspinor,nstsv))
! !DESCRIPTION:
!   Computes the spin density matrices for a set of second-variational states.
!
! !REVISION HISTORY:
!   Created September 2008 (JKD)
!EOP
!BOC
implicit none
! arguments
complex(8), intent(in) :: evecsv(nstsv,nstsv)
complex(8), intent(out) :: sdmat(nspinor,nspinor,nstsv)
! local variables
integer ispn,jspn,ist,j
complex(8) z1,z2
sdmat(:,:,:)=0.d0
do j=1,nstsv
  do ispn=1,nspinor
    do jspn=1,nspinor
      do ist=1,nstfv
        z1=evecsv(ist+nstfv*(ispn-1),j)
        z2=evecsv(ist+nstfv*(jspn-1),j)
        sdmat(ispn,jspn,j)=sdmat(ispn,jspn,j)+z1*conjg(z2)
      end do
    end do
  end do
end do
return
end subroutine
!EOC