Check on the transmission matrix unitarity is added (A.Smogunov)

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1697 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
smogunov 2005-03-09 17:44:51 +00:00
parent 20f84da38d
commit 59940c1826
3 changed files with 71 additions and 1 deletions

View File

@ -42,6 +42,7 @@ scatter_back.o \
scatter_forw.o \
summary_band.o \
summary_tran.o \
sunitary.o \
transmit.o
MODULES = \

48
PWCOND/sunitary.f90 Normal file
View File

@ -0,0 +1,48 @@
!
! Copyright (C) 2003 A. Smogunov
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
subroutine sunitary(nchanl, nchanr, smat, info)
!
! It performs a check of unitarity of the scattering matrix
! S = {R_ij, T_ij}
! \sum R_ki^* R_kj + \sum T_ki^* R_kj = \delta_ij
!
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
implicit none
integer :: info, i, j, k
integer :: nchanl, & ! number of channels in the left tip
nchanr ! ------------ right tip
real(kind=DP), parameter :: eps=1.d-4
real(kind=DP) :: raux, raux1
complex(kind=DP) :: &
s, smat(nchanl+nchanr, nchanl) ! S matrix
info = 0
do i = 1, nchanl
do j = 1, nchanl
s = 0.d0
do k = 1, nchanl
s = s + conjg(smat(k,i))*smat(k,j)
enddo
do k = 1, nchanr
s = s + conjg(smat(nchanl+k,i))*smat(nchanl+k,j)
enddo
raux = sqrt(real(s)**2 + aimag(s)**2)
raux1 = raux
if(i.eq.j) raux1 = abs(raux1-1.d0)
if(raux1.gt.eps) then
write(stdout, '(2i5,f12.7)') i, j, raux
info = 1
endif
enddo
enddo
return
end subroutine sunitary

View File

@ -30,7 +30,7 @@ implicit none
complex(kind=DP) :: x1, x2
complex(kind=DP), allocatable :: amat(:,:), vec1(:,:), &
tmat(:,:), veceig(:,:), zps_nc(:,:), &
vec2(:,:)
vec2(:,:), smat(:,:)
eev = earr(ien)
ntran=4*n2d+npol*(norbs+nocrosl+nocrosr)
@ -221,6 +221,27 @@ implicit none
enddo
WRITE( stdout,'(15x,f9.5)') tj
enddo
!
! Check for S matrix unitarity
!
!
! elements of S_ij = (r_ij, t_ij) and T_ij = (t_ij) matrices
!
allocate( smat(nchanl+nchanr, nchanl) )
do n=1, nchanl
do ig=1, nchanl
smat(ig,n) = vec1(2*n2d+npol*norbs+ig,n)
enddo
do ig=1, nchanr
smat(nchanl+ig,n) = tmat(ig,n)
enddo
enddo
call sunitary(nchanl, nchanr, smat, info)
call errore('transmit','S matrix is not unitary', &
-abs(info))
deallocate( smat )
!
! eigenchannel decomposition
!