The Elk Code
 
Loading...
Searching...
No Matches
dynevs.f90
Go to the documentation of this file.
1
2! Copyright (C) 2014 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine dynevs(ev,dq,wq)
7use modmain
8use modphonon
9implicit none
10! arguments
11complex(8), intent(in) :: ev(nbph,nbph)
12complex(8), intent(inout) :: dq(nbph,nbph)
13real(8), intent(out) :: wq(nbph)
14! local variables
15integer i,j,k
16real(8) t1,t2
17complex(8) z1
18! automatic arrays
19real(8) wt(nbph)
20! find the eigenvalues and eigenvectors of the matrix dq
21call eveqnzh(nbph,nbph,dq,wq)
22! reorder eigenvalues so that the eigenvectors maximally overlap with ev
23wt(:)=wq(:)
24do i=1,nbph
25 j=1
26 t1=0.d0
27 do k=1,nbph
28 z1=dot_product(ev(:,i),dq(:,k))
29 t2=z1%re**2+z1%im**2
30 if (t2 > t1) then
31 j=k
32 t1=t2
33 end if
34 end do
35 wq(i)=wt(j)
36end do
37end subroutine
38
subroutine dynevs(ev, dq, wq)
Definition dynevs.f90:7
subroutine eveqnzh(n, ld, a, w)
Definition eveqnzh.f90:7