The Elk Code
dmatwx.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 dmatwx(n,w,x,dxx,dwx,xn)
7 implicit none
8 ! arguments
9 integer, intent(in) :: n
10 complex(8), intent(in) :: w(n,n),x(n,n)
11 complex(8), intent(out) :: dxx(n,n),dwx(n,n)
12 real(8), intent(out) :: xn(n)
13 ! local variables
14 integer i
15 real(8), external :: dznrm2
16 ! normal bosonic density matrix XX†
17 call zgemm('N','C',n,n,n,(1.d0,0.d0),x,n,x,n,(0.d0,0.d0),dxx,n)
18 ! store the X-norm
19 do i=1,n
20  xn(i)=dznrm2(n,x(:,i),1)**2
21 end do
22 ! anomalous density matrix -WX†
23 call zgemm('N','C',n,n,n,(-1.d0,0.d0),w,n,x,n,(0.d0,0.d0),dwx,n)
24 end subroutine
25 
subroutine dmatwx(n, w, x, dxx, dwx, xn)
Definition: dmatwx.f90:7