The Elk Code
 
Loading...
Searching...
No Matches
dmatuv.f90
Go to the documentation of this file.
1
2! Copyright (C) 2020 Chung-Yu Wang, J. K. Dewhurst, S. Sharma and
3! E. K. U. Gross. This file is distributed under the terms of the GNU General
4! Public License. See the file COPYING for license details.
5
6subroutine dmatuv(n,ef,e,u,v,dvv,duv,vn)
7use modmain
8implicit none
9! arguments
10integer, intent(in) :: n
11real(8), intent(in) :: ef,e(n)
12complex(8), intent(in) :: u(n,n),v(n,n)
13complex(8), intent(out) :: dvv(n,n),duv(n,n)
14real(8), intent(out) :: vn(n)
15! local variables
16integer i
17! external functions
18real(8), external :: dznrm2
19! normal fermionic density matrix VV†
20call zgemm('N','C',n,n,n,(1.d0,0.d0),v,n,v,n,(0.d0,0.d0),dvv,n)
21do i=1,n
22! store the V-norm
23 vn(i)=dznrm2(n,v(:,i),1)**2
24! subtract unperturbed density matrix
25 if (e(i) <= ef) dvv(i,i)=dvv(i,i)-1.d0
26end do
27! anomalous density matrix UV†
28call zgemm('N','C',n,n,n,(1.d0,0.d0),u,n,v,n,(0.d0,0.d0),duv,n)
29end subroutine
30
subroutine dmatuv(n, ef, e, u, v, dvv, duv, vn)
Definition dmatuv.f90:7