The Elk Code
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 
6 subroutine dmatuv(n,ef,e,u,v,dvv,duv,vn)
7 use modmain
8 implicit none
9 ! arguments
10 integer, intent(in) :: n
11 real(8), intent(in) :: ef,e(n)
12 complex(8), intent(in) :: u(n,n),v(n,n)
13 complex(8), intent(out) :: dvv(n,n),duv(n,n)
14 real(8), intent(out) :: vn(n)
15 ! local variables
16 integer i
17 ! external functions
18 real(8), external :: dznrm2
19 ! normal fermionic density matrix VV†
20 call zgemm('N','C',n,n,n,(1.d0,0.d0),v,n,v,n,(0.d0,0.d0),dvv,n)
21 do 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
26 end do
27 ! anomalous density matrix UV†
28 call zgemm('N','C',n,n,n,(1.d0,0.d0),u,n,v,n,(0.d0,0.d0),duv,n)
29 end subroutine
30 
subroutine dmatuv(n, ef, e, u, v, dvv, duv, vn)
Definition: dmatuv.f90:7