The Elk Code
eveqnuv.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2019 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 eveqnuv(n,au,bv,w)
7 implicit none
8 ! arguments
9 integer, intent(in) :: n
10 complex(8), intent(inout) :: au(n,n),bv(n,n)
11 real(8), intent(out) :: w(n)
12 ! local variables
13 integer n2,i,j
14 ! allocatable arrays
15 real(8), allocatable :: w2(:)
16 complex(8), allocatable :: h(:,:)
17 n2=2*n
18 ! setup the fermionic Bogoliubov Hamiltonian
19 allocate(w2(n2),h(n2,n2))
20 do j=1,n
21  do i=1,j
22  h(i,j)=au(i,j)
23  h(n+i,n+j)=-au(i,j)
24  end do
25 end do
26 do j=1,n
27  do i=1,n
28  h(i,n+j)=bv(i,j)
29  end do
30 end do
31 ! find the eigenvalues and eigenvectors
32 call eveqnzh(n2,n2,h,w2)
33 ! copy to output arrays
34 do i=1,n
35 ! choose the positive eigenvalues
36  j=n+i
37  w(i)=w2(j)
38  call zcopy(n,h(1,j),1,au(1,i),1)
39  call zcopy(n,h(n+1,j),1,bv(1,i),1)
40 end do
41 deallocate(w2,h)
42 end subroutine
43 
subroutine eveqnzh(n, ld, a, w)
Definition: eveqnzh.f90:7
subroutine eveqnuv(n, au, bv, w)
Definition: eveqnuv.f90:7